Hello everyone,
I have a student working on her thesis who is collecting data using an Implicit Association Test (IAT) she designed and built using the materials provided by Project Implicit. This is a JavaScript task that presents people with stimuli and measures reaction times. The IAT itself runs fine when we preview the survey, but moving on to the rest of the survey isn't working. The last screen of the JavaScript says "Press spacebar to proceed" and when I do so the script task seems to go away but it does not proceed to the next question and the "next" button typically in the lower right corner is gone. I don't know JavaScript coding so I don't know if it's something wrong with the script or if I have something set up incorrectly in Qualtrics.
The JavaScript used for the Qualtrics question is:
Qualtrics.SurveyEngine.addOnload(function () {
// hide question and next button
var container = this.getQuestionContainer();
container.querySelector('.Inner').style.display = 'none';
this.hideNextButton();
// load MinnoJS from the CDN (you probably don't need to change this)
var scriptTag = document.createElement('script');
scriptTag.src = 'https://cdn.jsdelivr.net/gh/minnojs/minno-quest@0.3/dist/pi-minno.js';
scriptTag.onload = onLoad;
scriptTag.onreadystatechange = onLoad;
container.appendChild(scriptTag);
// create the root element for Minno
var canvas = document.createElement('div');
container.appendChild(canvas);
// function to proceed to next question
var proceed = this.clickNextButton.bind(this);
// This function gets activated only after MinnoJS is loaded
function onLoad() {
// Run your study (just set the correct URL)
minnoJS(canvas, 'https://cdn.jsdelivr.net/gh/mjleaumont/IAT/script/define.js');
// MinnoJS doesn't know about Qualtrics, we pass a function to inject the results into the question
// For some reason `piGlobal` isn't available so we attach it to `minnoJS`
minnoJS.logger = function (value) {
var el = container.querySelector('textarea');
el.value = value;
}
// At the end of the study let MinnoJS proceed to the next question
// We need to wait a few miliseconds for Qualtrics to register the value that we entered
minnoJS.onEnd = function () { setTimeout(proceed, 100); }
}
});
Here's a screenshot of how the question is set up (I also have other questions in a different block after this just in case that matters):
Can anyone tell what I'm doing wrong?
TIA,
Ian
Solved
Survey doesn't continue after JavaScript
Best answer by ahmedA
You're code isn't configured properly, something about a missing URL. That's why the study isn't ending and the next button is not being clicked. I don't have experience in working with project implicit's IAT, however you can look at PyshJS (https://www.jspsych.org/plugins/jspsych-iat-html/) which can be easily integrated into Qualtrics.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

