Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Default values in questions of generated surveys

More
6 years 6 months ago #194722 by prmath
We're using LimeSurvey's JSON RPC API for automatically creating surveys with a Python script. The script is generating surveys and question groups, importing questions in lsq format. Basically it's working perfectly fine, except of one thing: default values for questions.

For instance, the script is generating a list of checkboxes (multiple choice) and some of these checkboxes shall be checked by default. So the script is adding some "default values" lines to the lsq, e.g.:
Code:
<defaultvalues> <fields> <fieldname>qid</fieldname> <fieldname>scale_id</fieldname> <fieldname>sqid</fieldname> <fieldname>language</fieldname> <fieldname>specialtype</fieldname> <fieldname>defaultvalue</fieldname> </fields> <rows> <row> <qid><![CDATA[2000]]></qid> <scale_id><![CDATA[0]]></scale_id> <sqid><![CDATA[2002]]></sqid> <language><![CDATA[de]]></language> <specialtype/> <defaultvalue><![CDATA[Y]]></defaultvalue> </row> </rows> </defaultvalues>

Even though the listed IDs match the IDs of the question, the checkboxes are not marked. Even if I'm creating a question in the Web interface of LimeSurvey, exporting it and then finally importing its lsq, default values are not set: no checkbox is checked by default.

Can anybody give me a hint how default values can be defined when generating surveys via API?

Thanks a lot for any advice in advance!
The topic has been locked.
More
6 years 6 months ago #194725 by DenisChenu

Even if I'm creating a question in the Web interface of LimeSurvey, exporting it and then finally importing its lsq, default values are not set: no checkbox is checked by default.

Report issue seems the best solution ..

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
Moderators: holch, tpartner

Lime-years ahead

Online-surveys for every purse and purpose