Saving multiple random numbers | XM Community
Question

Saving multiple random numbers

  • 9 December 2019
  • 3 replies
  • 26 views

I am fairly new to Qualtrics and I am generating a loop and merge for an experiment.

The block I am looping contains a question with around 30 randomly generated numbers in a matrix. The loop and merge repeats the question with newly generated numbers each time.

I'd appreciate suggestions as to how, for each loop and merge, I might save all these random numbers?

3 replies

Badge +2
Hi IHS,

Would the random numbers be scale points or statements? Are you trying to save all the random numbers presented for each iteration of the loop, or only the random number your respondents select?

This article on Loop and Merge may provide some useful information as well - https://www.qualtrics.com/support/survey-platform/survey-module/block-options/loop-and-merge/

Thanks,

Elliot V.W.
Hi Elliot!

The task is to count the number of 1 among the set of randomly generated numbers in a matrix.

I simply use the ${rand://int/} function to create the numbers, and I want to save every randomly generated number to determine whether a participant's answer is correct.

Hope that clarifies!
Userlevel 4
Badge +4
Hi @IHS ,

This is not going to be a straightforward solution.

What I can suggest is using JS - each time you create the random variables, pull them into JS array, perform your operations and save the Score (count of 1s in the array) into a separate embedded data field.

The first step is perhaps the trickiest - pulling the random variables into JS. After you create the conditions for your loop & merge, on each iteration re-initialise your 30 variables to a random number and pull them in as embedded data fields into JS each time.

Hope that helps.

Nikolay

Leave a Reply