Trying to prefill multiple-choice question

Plus d'informations
il y a 4 ans 2 mois #119248 par davidmenefee
Hi folks

I want to prefill a multiple-choice question from the URL, but I can't get it working. I've tried the suggestions on these pages:

manual.limesurvey.org/Workarounds:_Surve...using_the_survey_URL
manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming

I exported a survey result with question and answer codes. The first question in the first group is identified in the exported data like this:

question code: groups[5393]
answer code: Y

I've tried these URLs (I've removed the base URI for clarity):

.../index.php/survey/index/sid/925635/newtest/Y/lang/en?groups[5393]=Y
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?groups[5393]=1
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?groups[5393]="Y"
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?groups[5393]='Y'
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?groups_5393='Y'
.../index.php/survey/index/sid/925635/newtest/Y/lang/en/groups/5393/Y
.../index.php/survey/index/sid/925635/newtest/Y/lang/en/groups[5393]/Y
.../index.php/survey/index/sid/925635/newtest/Y/lang/en/groups?5425=Y

Also tried the SGQA identifier:
.../index.php/survey/index/sid/925635/newtest/Y/lang/en/925635X1X536X5393/1
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?925635X1X536X5393=Y
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?925635X1X536X5393='Y'
.../index.php/survey/index/sid/925635/newtest/Y/lang/en?925635X1X536X5393='1'

This worked for a different, single-choice drop-down list question:

.../index.php/survey/index/sid/925635/newtest/Y/lang/en/School/5393

So I know passing answers via the URL *should* work.

thanks for any help!

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 4 ans 2 mois #119252 par holch
I asume that groups[5393] is your questioncode and it is a multiple answer question, how should limesurvey know which of the answers to tick? You have to look at the survey/question logic page to see how each subquestion is referenced. Probably by adding using something like groups[5393]_1 and so on. And i am not sure if you are allowed to use those brakets in a questioncode.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 2 mois #119259 par tpartner
If, for example, the sub-question codes are "SQ001, SQ002...", using the full SGQA (no "X" between the question and sub-question codes) should work:
.../index/sid/925635/newtest/Y/lang/en?925635X1X536SQ001=Y

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Les utilisateur(s) suivant ont remercié: davidmenefee

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #119750 par davidmenefee
I ended up using a different approach that didn't require that I pass an answer to a multiple-choice question. I couldn't get the latter to work, even with your last suggestion, unfortunately. Passing an answer to a single-choice question worked fine. Thanks!

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!