I believe this is doable through javascript, but would anyone be able to help me figure out how to skip to the end of a block using logic captured earlier in the survey?
For example, a respondent is asked to pick a number, and then if a randomly drawn number is higher than that, I would like Qualtrics to automatically end the trial by skipping to the end of the block (it's an experiment). Any ideas would be beneficial, thanks!
Page 1 / 1
You wouldn't do this in JavaScript. You should use survey flow branch logic. It might look something like:
Unfortunately, I need to be able to implement this skipping mechanism on a question-by-question basis. Each question is a new randomly generated number, and it seems this would not allow me that granularity.
maybe you could set a display logic on each question in your block
- create embedded data fields
- randomNumber and showQuestions
question setup
add to the text entry question the below javaScript
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let randomNumber = "${e://Field/randomNumber}"
let enteredNumber = document.getElementById('QR~'+this.questionId).value
let showQuestion
if(Number(randomNumber) > Number(enteredNumber)){
showQuestion = 1
}else if(Number(randomNumber) < Number(enteredNumber)){
showQuestion = 0
}
Qualtrics.SurveyEngine.setEmbeddedData("showQuestions",showQuestion);
});
add the display logic to all questions in your block
hope this is what you are going for
Best regards
Rudi
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.