This should be a simple question, but, for some reason, I just cannot crack it or find this information online.
I have a set of questions in a block. They are randomized so only one shows to the respondent. I want to use JavaScript to detect which one is shown and have the script take an action based on that. The approach I’ve been taking is to try to detect if it was shown and set an embedded data value to indicate whether it was shown or not. I’ve tried several different things. For example:
if (jQuery("#QID1").isHidden()) {
Qualtrics.SurveyEngine.setEmbeddedData('Q1shown', 0);
} else {
Qualtrics.SurveyEngine.setEmbeddedData('Q1shown', 1);
}
I was hoping to use this to use in a later if/else statement to execute some script if one question is shown rather than another.