Hello SoSci Survey Team,
We are currently working on a survey that includes 11 scenarios (dilemmas). For each one, an audio file is played first, followed on the next page by several questions, including an attention check (control question).
We’ve programmed this so that, depending on whether the German or English version is randomly selected, different questions are shown. For example, we use code like this directly after each attention check:
if (value('IF05') == 2) {
$pt1 = 1;
} elseif (value('IF05') == 1) {
$pt1 = 0;
}
elseif (value('IF16') == 2) {
$pt1 = 1;
} elseif (value('IF16') == 1) {
$pt1 = 0;
}
This pattern repeats for all 11 attention checks, with different variables ($pt1-$pt11)
In this setup, 0 means the question was answered correctly, 1 means it was answered incorrectly. The values 1 and 2 correspond to the actual response options.
What we would now like to achieve at the end of the survey is the following:
If a participant answers three or more attention checks incorrectly, they should not be redirected to the Clickworker page that shows the payment code. Instead, they should immediately see a message like this:
In German: “Leider haben Sie zu viele Kontrollfragen falsch beantwortet und können die Studie nicht abschließen.”
In English: “Unfortunately, you answered too many attention checks incorrectly and cannot complete the study.”
Afterwards, the survey should simply end.
Participants who answered fewer than three attention checks incorrectly should proceed as normal to the Clickworker page, where they receive their code, and then to the final page that contains our closing text.
We have tried several approaches to achieve this, for example summing up and redirecting with goToPage(). Unfortunately, none of these solutions has worked reliably. In some cases we received errors such as “Undefined variable”, and in others participants were incorrectly redirected to the end page even when all attention checks were answered correctly.
We would greatly appreciate your support in finding a stable solution for SoSci Survey. Specifically, we’d like your advice on how best to count the number of incorrectly answered attention checks and then reliably decide whether to redirect the participant to the Clickworker page or terminate the survey with the appropriate message.
Thank you very much in advance for your help!
Best regards,