Use keyboard for answering Multiple Choice question
Best answer by TomG
As I said, it was untested. It turns out that the Timing Question works off a mouseup event instead of a click event. Other than that, triggering a click on the input elements has the same effect as setValueByRecodeValue.
So, a modification to the script I posted previously that registers a timing question 'click':
Qualtrics.SurveyEngine.addOnload(function() {
var qobj = this;
jQuery(document).keypress(function(event) {
var key = event.key.toUpperCase();
if(key == "J" || key == "F") {
jQuery(this).trigger("mouseup");
if(key == "J") qobj.setChoiceValueByRecodeValue(1,true);
else qobj.setChoiceValueByRecodeValue(2,true);
}
});
});
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.