I would like to present a typical multiple choice question, but allow participants to complete it in either the typical fashion (select a response then click continue) or by pressing a specific key (right bracket), at which point the question will auto-forward to the next question. I am able to do this with the following added to Qualtrics.SurveyEngine.addOnReady:
/* Allow right bracket to auto-advance this question. */
var that = this;
Event.observe(document, 'keydown', function keydownCallback(e){
var choiceID = null;
if (e.keyCode == 221)
{
Qualtrics.SurveyEngine.setEmbeddedData( 'PassAttChk', 1 );
Event.stopObserving(document, 'keydown', keydownCallback);
that.clickNextButton();
}
This actually works okay, but the problem is that it continues to catch the keypress in subsequent questions. I've tried adding this to Qualtrics.SurveyEngine.addOnUnload
Event.observe(document, 'keydown', function keydownCallback(e){ });
But it either does not function or stops the initial keypress from being caught.
Any idea what I'm doing wrong here? Thanks!!
Javascript for keypress within multiple choice question
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
