@jaredi,
You’ll need to use a Loop & Merge block and some JavaScript (JS) to set embedded data fields. Each loop will be a scenario.
> Before the block set the embedded data fields currentLoop=0 and endLoop=0 in the survey flow.
> Make the first question in the loop “Do you want to answer another scenario?” with the choices Yes and No. Add display logic to only display if currentLoop>0 and endLoop=0. Add JS (The choice id of No=2):
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
if(this.getSelectedChoices()i0]=="2") Qualtrics.SurveyEngine.setEmbeddedData("endLoop","1");
});
> Add a page break after the first question
> Add JS to the next question:
Qualtrics.SurveyEngine.addOnload(function() {
Qualtrics.SurveyEngine.setEmbeddedData("currentLoop","${lm://CurrentLoopNumber}");
});
> Add display logic endLoop=0 to all questions in the loop after the first one.
thank you so much @TomG for your quick response! I’m working on setting this up as you’ve described, but am not sure where the scenarios themselves should go. Each scenario is a title, an image and a paragraph of text. Would these each be placed in a separate block and randomised?
The scenarios will go in the loop & merge fields. Field 1: name, Field 2: image url, Field 3: paragraph. Then pipe the loop and merge fields (e.g., ${e://Field/1} into your questions.
It worked! I’m really grateful for your help @TomG . There are two final things I can’t work out, if you or anyone are able to advise.
- The display logic is working perfectly if respondents say ‘yes’, but I can’t figure out how to get the survey to go to the next block if they say ‘no’.
- Is there a way for the first randomised scenario to appear automatically, with the questions, and the “Do you want to answer another scenario?” question only to appear after the first scenario is responded to? It’s not such a big problem if not, I think I can come up with wording that will make it clear.
Thank you again!
- The display logic is working perfectly if respondents say ‘yes’, but I can’t figure out how to get the survey to go to the next block if they say ‘no’.
If you’ve set the embedded data field endLoop correctly, it should skip all the remaining question in the loop & merge block and go to the next block
- Is there a way for the first randomised scenario to appear automatically, with the questions, and the “Do you want to answer another scenario?” question only to appear after the first scenario is responded to? It’s not such a big problem if not, I think I can come up with wording that will make it clear.
If you’ve set the embedded data fields and display logic as described, the “Do you want to answer another scenario?” will not appear for the first scenario.
I went back through everything again from your first response, step by step, and both the remaining issues are resolved. Thanks so much!