Hello!
I am programming a Navon task in Qualtrics and have the images set up as a loop & merge question with multiple choices (h and l). Functionally, my code is working to allow the keypress to click the next button and move on, but it's not saving the data from keypress anywhere in my data file and it also doesn't seem to be saving the keypress as a choice value for each loop and merge. Since it's technically allowing me to use the keypress, I'm assuming the lack of data saved has to do with the fact that it's loop & merge. Here's the code I'm currently using (but I have tried others as well):
Qualtrics.SurveyEngine.addOnload(function()
{
this.hideNextButton();
this.hidePreviousButton();
this.hideChoices();
var qid = this.questionId;
document.onkeydown = function(event) {
console.log('keydown',event);
if (event.which == 72) {
event.preventDefault();
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(1, true);
jQuery('#NextButton').click();
} else if (event.which == 76) {
event.preventDefault();
Qualtrics.SurveyEngine.registry[qid].setChoiceValue(2, true);
jQuery('#NextButton').click();
}
}
});
If anyone has tips on what I might be doing wrong, I'd appreciate it.
Question
Saving keypress as choice for each loop in multiple choice question
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
