Weird output for export_responses

More
3 years 6 months ago - 3 years 6 months ago #126157 by mellorine
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 6 months ago by mellorine.

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

LimeSurvey Partners
More
3 years 6 months ago #126159 by Mazi
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
Want to use your survey offline -> www.offlinesurveys.com

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

More
3 years 6 months ago - 3 years 6 months ago #126160 by mellorine
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 6 months ago by mellorine.

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

More
3 years 6 months ago #126161 by Mazi
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
Want to use your survey offline -> www.offlinesurveys.com

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

More
3 years 6 months ago #126162 by mellorine
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 6 months ago #126163 by Mazi
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
Want to use your survey offline -> www.offlinesurveys.com

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

More
3 years 6 months ago - 3 years 6 months ago #126164 by mellorine
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 6 months ago by mellorine.

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

More
3 years 6 months ago #126170 by DenisChenu
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 6 months ago #126191 by mellorine
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!