cyril
New Member
Posts: 3
|
Post by cyril on Oct 8, 2020 8:55:29 GMT
Hey there,
I have been using the ToolKit to create a survey and have encountered two problems that either the documentation doesn't specify or I'm completely overlooking. My survey consists of check-type questions where participants have to assign a specific text with a set of descriptors they deem fitting.
The first problem pertains to the fact that the people taking my survey do not have to answer all of the questions. If they complete 50/100 and they want to skip the rest that is perfectly fine. However, I cannot seem to find a 'skip to end' button. In this something I can program myself or will my participants just have to skip trough the remaining questions individually? Second, to present each participant with semi-overlapping sets of questions I want to present each with a random assignment of questionnaires. To accomplish this I've used the "Example of random assignment of questionnaires" which can be found here. Using this code as a framework has given me numerous errors. When I copy the whole example directly and just run that as a script I get the following:
ERROR: unknown_section in line: 1 >>> l: chooserandom Problem: Unknown section l: It then tells me PsyToolKit script have few sections (despite my normal script and examples being fine without using any) and even when adding these sections am still presented with problems.
To summarise, my questions are: is there a 'skip-to-end-of-survey' button to be found somewhere? And could anyone give me some insight as to why the example script is telling me to use sections despite those not being used in the example surveys I checked? Thanks in advance!
|
|
|
Post by matia on Oct 8, 2020 9:12:02 GMT
Dear Cyril, for the second part of your question: l: chooserandom t: set - random 1 2 l: t: jump - if $chooserandom == 1 then goto drink_set1 - if $chooserandom == 2 then goto food_set2 ## survey 1 about drinks ######################## l: drink_set t: radio q: Do you like cola? - Yes - No l: drink2 t: radio q: Do you like fanta? - Yes - No l: t: jump - goto endquestion ## survey 2 about food ######################## l: food_set t: radio q: Do you like bread? - Yes - No l: drink2 t: radio q: Do you like pancakes? - Yes - No l: endquestion q: Did you like this survey? - Yes - No I believe the problem is that when defining a jump, in the if statements, the labels of the experiments are not correct. It says to jump to drink_set1 and the experiment is labeled drink_set (without a 1 at the end). Try renaming the labels. For the first part of the question I do not know the answer, but if evertything fails, you know you can manually add an option to end the survey after each question Best, Matia
|
|
cyril
New Member
Posts: 3
|
Post by cyril on Oct 8, 2020 11:24:49 GMT
Dear Matia,
Thanks for your quick answer! I have made corrections according to your suggestions but sadly this did not give the desired result (though I suspect you saved me from more confusion later on). It seems a bit odd this would cause the error as it seems be on the line:
>>> l: chooserandom
As for the last part of your answer, that would definetly solve my problem! (I am automatically generating most of the code so it wouldn't be a problem anyway). How would I go about this? I found the 'end' statement in the docs but as not sure how to apply it here.
|
|
|
Post by yiannis on Oct 8, 2020 13:31:45 GMT
Hi cyril,
If I were you I would modify Matia's code a bit (some label names are duplicated) and add some additional bits to allow Ps to withdraw from the survey
l: chooserandom
t: set
- random 1 2
l: jump0
t: jump
- if $chooserandom == 1 then goto infoDrink
- if $chooserandom == 2 then goto infoFood
## survey 1 about drinks ########################
l: infoDrink
t: info
q: OK, lets talk about drinks
page: begin
l: drink_set
t: radio
q: Do you like cola?
- Yes
- No
l: drink
t: radio
q: Do you like fanta?
- Yes
- No
l: endquestion0
t: radio
q: Do you want to quit this survey? All responses you have given so far will be saved.
- Yes
- No
j: if $endquestion0 == 1 then goto endOfSurvey
page: end
page: begin
l: drink_set2
t: radio
q: Do you like beer?
- Yes
- No
l: drink2
t: radio
q: Do you like whisky?
- Yes
- No
l: endquestion2
t: radio
q: Do you want to quit this survey? All responses you have given so far will be saved.
- Yes
- No
j: if $endquestion2 == 1 then goto endOfSurvey
page: end
l:
t: jump
- goto endOfSurvey
## survey 2 about food ########################
l: infoFood
t: info
q: OK, lets talk about foods
page: begin
l: food_set
t: radio
q: Do you like bread?
- Yes
- No
l: food
t: radio
q: Do you like pancakes?
- Yes
- No
l: endquestion1
t: radio
q: Do you want to quit this survey? All responses you have given so far will be saved.
- Yes
- No
j: if $endquestion1 == 1 then goto endOfSurvey
page: end
page: begin
l: food_set3
t: radio
q: Do you like burgers?
- Yes
- No
l: food3
t: radio
q: Do you like sausages?
- Yes
- No
l: endquestion3
t: radio
q: Do you want to quit this survey? All responses you have given so far will be saved.
- Yes
- No
j: if $endquestion3 == 1 then goto endOfSurvey
page: end
l: endOfSurvey
t: info
q: OK, click continue to finish this survey
|
|
cyril
New Member
Posts: 3
|
Post by cyril on Oct 9, 2020 7:07:54 GMT
Hey Yiannis,
I still couldn't get the code of the example to work, it still gives the save error on these lines.
l: chooserandom t: set - random 1 2
However, the bits to allow participants to withdraw from the survey were really helpful, thank you very much!
|
|
|
Post by yiannis on Oct 9, 2020 9:41:09 GMT
Hi cyril,
The script above works for me just fine. Can you create a new survey, copy/paste the above and try again? If you attempt to embed it to an existing survey of yours then perhaps it would be prudent to paste your whole script here.
Otherwise, take a screenshot and share it of the full error you get when you compile it (or just share the text of the full error, it's not useful to just say the error is in that line).
|
|
|
Post by PsyToolkit on Oct 26, 2020 9:57:13 GMT
Looking at the error message in the first message, it looks like you are putting survey code into an experiment. The survey and the experiment scripting language are different.
|
|