- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Fill in flexi text array with javascript: questioncode instead of SGQA?
- Nynke
- Topic Author
- Offline
- New Member
Less
More
8 years 1 month ago #132853
by Nynke
Fill in flexi text array with javascript: questioncode instead of SGQA? was created by Nynke
I am programming a javascript choice task in Limesurvey and I want to save the choices and reaction times. I thought an text array with rows for the different choices (Choice1, Choice2, etc.) and columns for choice (left/right) and reactiontime would be most suitable.
To fill the array with data I used the following line, which makes use of the SGQA:
document.getElementById("answer429791X27X68Choice1_choice").value = "My value";
I was wondering whether it would also be possible to use the question id instead of the SGQA code? I haven't been able to get it working with the questioncode, i.e., the following line does not work (questioncode is testvullenarray:
document.getElementById("testvullenarray_Choice1_choice").value = "My value";
I have been searching around on the forum and google but haven't seen someone trying to do the same. Does anyone know whether this is possible?
To fill the array with data I used the following line, which makes use of the SGQA:
document.getElementById("answer429791X27X68Choice1_choice").value = "My value";
I was wondering whether it would also be possible to use the question id instead of the SGQA code? I haven't been able to get it working with the questioncode, i.e., the following line does not work (questioncode is testvullenarray:
document.getElementById("testvullenarray_Choice1_choice").value = "My value";
I have been searching around on the forum and google but haven't seen someone trying to do the same. Does anyone know whether this is possible?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
8 years 1 month ago - 8 years 1 month ago #132856
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Fill in flexi text array with javascript: questioncode instead of SGQA?
If the script is in the question text, you can use the Expression Manager {SGQ} placeholder. It will automatically replace "429791X27X68" - manual.limesurvey.org/Expression_Manager...ttributes_changed.3FI was wondering whether it would also be possible to use the question id instead of the SGQA code?
Have a look at the Implicit Association Test workaround, it records decision times - manual.limesurvey.org/Workarounds:_Manip...ation_Test_.28IAT.29I am programming a javascript choice task in Limesurvey and I want to save the choices and reaction times.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 1 month ago by tpartner.
The following user(s) said Thank You: Nynke
The topic has been locked.
- Nynke
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
8 years 1 month ago #132907
by Nynke
Replied by Nynke on topic Fill in flexi text array with javascript: questioncode instead of SGQA?
Thanks that worked!
I'm indeed using some of the methods of the IAT workaround. (i.e., a flexi array question that is populated with response times and choices from the javascript task).
I'm indeed using some of the methods of the IAT workaround. (i.e., a flexi array question that is populated with response times and choices from the javascript task).
The topic has been locked.