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?

More
8 years 1 month ago #132853 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?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago - 8 years 1 month ago #132856 by tpartner

I was wondering whether it would also be possible to use the question id instead of the SGQA code?

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.3F

I am programming a javascript choice task in Limesurvey and I want to save the choices and reaction times.

Have a look at the Implicit Association Test workaround, it records decision times - manual.limesurvey.org/Workarounds:_Manip...ation_Test_.28IAT.29

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.
More
8 years 1 month ago #132907 by Nynke
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).
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose