Weird output for export_responses

More
3 years 1 month ago - 3 years 1 month ago #126157 by mellorine
mellorine created the topic: Weird output for export_responses
Hi everyone, I've been working with limesurvey for a few days now. What I'm trying to do is each time a survey is completed, the page goes to an End URL where the responses are looped through and saved to a different database (with a different table structure).

I am still testing some codes by working with remotecontrol_handler and json RPC. The code is working fine and I am able to get proper output with api calls like list_questions, get_response_ids, list_surveys but when I try using export_responses it just returned some garbled text.

Please check attachment for two api calls. The first one is list_questions() while the last garbled text is export_responses()

Edit: The output attached is for 3 api calls, not two. The second one is list_surveys().

Thanks!
Attachments:
Last Edit: 3 years 1 month ago by mellorine.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126159 by Mazi
Mazi replied the topic: Weird output for export_responses
That looks like data stored within a BLOB DB field?!

Can you track down to which question type this refers to?


Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #126160 by mellorine
mellorine replied the topic: Weird output for export_responses
Hi Mazi, I only have one question in the survey and it is using Array (Yes/No/Uncertain) question type. Actually, it was previously long free text but I figured I'd change the type to test but it had the same output.
Last Edit: 3 years 1 month ago by mellorine.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126161 by Mazi
Mazi replied the topic: Weird output for export_responses
That seems to be data of a different variable. The first array being outputted contains 4 data sets (sub-questions?):
array(4)

The one after that contains 2:
array(2) { [0]=> int(13) [1]=> int(14)
} string(776)

Check your code to which var this refers to.


Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126162 by mellorine
mellorine replied the topic: Weird output for export_responses
I'm sorry. I was able to edit my first post a few minutes ago because I noticed I added an extra api call.
The second one is list_surveys().

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126163 by Mazi
Mazi replied the topic: Weird output for export_responses
Please check the API for the return values of the function calls. What should "list_surveys()" return?
That should help tracking this down.


Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #126164 by mellorine
mellorine replied the topic: Weird output for export_responses
Hi Mazi, list_surveys() is going to return two values for me since I have two surveys currently. I am attaching the output of only export_responses. I really have no idea why the output is not what it's supposed to be. Thanks for taking time to reply to this thread :)

I'm attaching the php code I have as well, for reference.
Attachments:
Last Edit: 3 years 1 month ago by mellorine.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126170 by DenisChenu
DenisChenu replied the topic: Weird output for export_responses
Hi,

Reading the API doc: api.limesurvey.org/classes/remotecontrol...hod_export_responses

Returns the requested file as base64 encoded string


Then base64_decode before use/dump.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: mellorine

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #126191 by mellorine
mellorine replied the topic: Weird output for export_responses
Thanks a lot, that worked. :silly:

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!