Generating multiple arithmetic problems | XM Community
Skip to main content

Hi all,
For one part of my study, participants complete simple arithmetic problems for a few minutes. I need to generate 200-300 arithmetic questions. The brute force way of doing this would be to create multiple copies of a question that uses Qualtrics' random number generator (e.g., ${rand://int/1:9} + ${rand://int/0:9} = ?). Ideally, I would like to automate this process so I don't need to copy a question hundreds of times. I tried doing this using Loop and Merge but couldn't figure out a simple solution. There might be a way to accomplish this using the Survey Flow, but I need to use a Timing Question so that the survey advances after a certain number of minutes, and therefore I don't think I can have page breaks.
Is there a better way to copy a simple arithmetic question that contains randomly generated integers multiple times in Qualtrics? Let me know if you would like clarification of any part of my question.

Generate them in excel and paste the entire thing in loop and merge.


https://www.qualtrics.com/community/discussion/comment/38145#Comment_38145Does loop and merge work with timing questions? I want the survey to move forward after a set amount of time, not after a certain number of questions have been answered.
EDIT: I think I figured it out. This thread (https://www.qualtrics.com/community/discussion/10106/integrating-loop-and-merge-and-timing) describes how to integrate a timer with loop and merge. The loop now exits when the set time is reached.
I added the following embedded data variables before the math block:
StartLoop = ${e://field/Q_TotalDuration}
timeout = 0
And I also added the following Javascript code to the loop and merge question under the addOnReady section:
var start = parseInt('${e://Field/StartLoop}');
var end = parseInt('${e://Field/Q_TotalDuration}');
var elapsed = end - start;
Qualtrics.SurveyEngine.setEmbeddedData('elapsed', elapsed);
if(elapsed > 300) Qualtrics.SurveyEngine.setEmbeddedData('timeout', 1);


Leave a Reply