I've implemented the scripts mentioned by user1113568 (i.e., 'It used to be possible to setChoiceValue in Qualtrics. Is there a workaround that does not involve embedded data?'; Jan 20 18) and D. Sam (i.e., In Qualtrics, how to save a key response into an embedded data?; Feb 14-17) in qualtrics in order to register responses by key presses in qualtrics. Unfortunately the responses are not saved in my spss data file. Are both scripts not valid anymore due to changes by qualtrics, and are people familiar with an update? Any help is much appreciated. Best, Koen
script D. Sam In Qualtrics, how to save a key response into an embedded data?
`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) {
Qualtrics.SurveyEngine.setEmbeddedData("choiceID",choiceID);
Event.stopObserving(document, 'keydown', keydownCallback);
that.setChoiceValue(choiceID, true);
that.clickNextButton();
}
});
});
`
script user1113568 It used to be possible to setChoiceValue in Qualtrics. Is there a workaround that does not involve embedded data?
`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();
}
});
});
`