Having participants advance to the next block automatically instead of having to click the "next" | XM Community
Skip to main content

Hello, I currently have a survey set up where participants are matched in groups of three. After they are matched they are shown a next button that takes them to the next block. However I would like to remove the next button and simply have them advance to the next block automatically. Below is the script I am trying to edit to get this done.

function attemptMatch() {
setTimeout(function () {
makeRequest();
console.log("Attempt = " + attemptCount + " | Status = " + status);
if (attemptCount == maxWaitTime) {timeOut = "yes";}
if (status == "matched" && attemptCount >= freezeTime){
console.log("End MATCH");

if (bots.length < 1){
console.log("Matched with other participant(s)");
if (matchAlert == 1) {
updateAlert();
// alert("Successfully matched!");
}

if (Qualtrics.SurveyEngine.getEmbeddedData("groupSize") == 2){
infoBox.innerHTML = "You have been successfully matched with another participant.";
}
else{
infoBox.innerHTML = "You have been successfully matched with " + (Qualtrics.SurveyEngine.getEmbeddedData("groupSize") - 1) + " other participants.";
}
setTimeout(function () {page.showNextButton();}, 1000 * freezeTime);
}
else{
if (botMatch == "yes"){
console.log("Matched with BOT(s)");
if (matchAlert == 1) {
updateAlert();
// alert("Matched with BOT(s).");
}

botArray = bots.split(",");
numBots = botArray.length;
if (Qualtrics.SurveyEngine.getEmbeddedData("groupSize") == 2){
infoBox.innerHTML = "Unfortunately, there is no one else available.

You have been matched with a BOT.";
}
else{
infoBox.innerHTML = "Unfortunately, there are not enough other participants available.

You have been matched with " + (Qualtrics.SurveyEngine.getEmbeddedData("groupSize") - 1 - numBots) + " other participant(s) and " + numBots + " BOT(s).";
}
setTimeout(function () {page.showNextButton();}, 1000 * freezeTime);
}
else {
console.log("No available participant -- Survey terminated");
if (matchAlert == 1) {alert("Survey terminated.");}

infoBox.innerHTML = "Unfortunately, there are not enough other participants available.

" + terminateText;
Qualtrics.SurveyEngine.setEmbeddedData( "timeOutLog", "No available participant -- Survey terminated" );
setTimeout(function () {page.showNextButton();}, 2000 * freezeTime);

Be the first to reply!

Leave a Reply