Hello!
I have this "game" or task that's coded with the Qualtrics API. It lasts about 900 seconds but we would like to give the option for the participant to click the next button if they choose not to do the task to completion. However, the issue with the way the JS is coded is that all of the .setEmbeddedData lines happen after the entire game has completed and the code is finishing up. The way it's written right now, no data from the code will be embedded into Qualtrics if the participant presses the next button early and cuts off the game prematurely.
I was hoping to resolve this by moving the .setEmbeddedData lines from the end of the game to the .addOnUnload section so that all of the data will be embedded when the participant presses the next button. However, I learned that none of the variables/data carry over between the sections. Is there a way to carry over that data from .addOnReady to .addOnUnload or must we rewrite the JS so that code is embedding the data into Qualtrics while they're playing the game?
Thank you!
Page 1 / 1
Declare all your variables, outside/ or above - .addOnload function.
Use addOnPageSubmit function to set the embedded data.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.