0

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();
}
});
});
`
Koen
  • 1
  • 2
  • Where are "the scripts mentioned by user1113568"? Are they in another SO question? If so, you should link to it. – Collin Barrett May 22 '18 at 14:33
  • I changed my original post, so that a link to the scripts are provided above each script I found – Koen Jul 24 '18 at 07:27

0 Answers0