Hello all,
How can I hide the multiple choice buttons for my questions? I have added some JS code so participants can respond using key presses so I don't want participants to answer by mouse-clicking on the buttons on the screen.
I have tried variations of the following code but haven't been able to make it work - could someone kindly help me with this?
Many thanks in advance!
Qualtrics.SurveyEngine.addOnload(function()
{
this.hideNextButton();
this.hidePreviousButton();
var that = this;
Event.observe(document, 'keydown', function keydownCallback(e) {
var choiceID = null;
switch (e.keyCode) {
case 74: // 'j' was pressed
choiceID = 1;
break;
case 75: // 'k' was pressed
choiceID = 2;
break;
}
if (choiceID) {
Event.stopObserving(document, 'keydown', keydownCallback);
that.setChoiceValue(choiceID, true);
that.clickNextButton();
var v = document.getElementsByClassName('MultipleAnswer');
for (i = 0; i < v.length; i++) {
v[i].style.visibility = "hidden";
}
}
});
});
Solved
How to hide multiple choice buttons?
Best answer by ahmedA
So your problem is simple. Because you are adding the images to the question, you just need to hide the choices. Add this line to the JS:
this.getChoiceContainer().hide()and you should get what you are aiming for.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

