URL of experiment: The experiment is not public and is currently in piloting mode.
Description of the problem: The task is a stroop. The participant must complete a practice round of 20 trials with at least 50% correct responses otherwise they have to complete another round of 20 practice trials. If at the end of the second round of practice trials the correct responses are still below 50% then the experiment ends by skipping the experimental trials and going straight to the goodbye message. Everything works as it should in builder, but when uploaded to Pavlovia the experiment fails to skip the experimental trials.
I have a code component in the practice feedback:
Begin experiment (Python):
msg = ''
corrCount = 0
totalCount = 0
stopExp = 0
Begin experient (Javascript):
msg = "";
corrCount = 0;
totalCount = 0;
stopExp = 0;
Begin Routine (Python):
totalCount=totalCount+1
if PracticeResponse.corr == 1:
msg = "Correct!"
corrCount=corrCount+1
elif PracticeResponse.rt == []:
msg = "Trop Lent!"
elif PracticeResponse.corr == 0:
msg = "Erreur!"
if totalCount==20:
if corrCount/totalCount >= 0.5:
PracticeLoop.finished = True
Begin Routine (Javascript):
totalCount = (totalCount + 1);
if ((PracticeResponse.corr === 1)) {
msg = "Correct!";
corrCount = (corrCount + 1);
} else {
if ((PracticeResponse.corr === 0) && (PracticeResponse.rt > 0)) {
msg = "Erreur!";
} else {
msg = "Trop Lent!!";
}
}
if (totalCount == 20) {
if ((corrCount/totalCount) >= 0.5) {
PracticeLoop.finished = True;
}
}
End Routine (Python):
if totalCount==40:
if corrCount/totalCount < 0.5:
stopExp = 1
PracticeLoop.finished = True
Boards.finished = True
else:
totalCount=0
End Routine (Javascript):
if (totalCount == 40) {
if ((corrCount/totalCount) < 0.5) {
stopExp = 1;
PracticeLoop.finished = true;
Boards.finished = true;
} else {
totalCount = 0;
}
}
The loop that contains the practice trials is called “PracticeLoop” and is nested within the larger loop called “Boards” which also contains the trial loop which is called “TrialLoop”. The goodbye screen exists outside of the Boards loop.
If I include the statment: TrialLoop.finished = True (Python)
TrialLoop.finished = true; (Javascript)
in the End Routine the experiment crashes saying that the TrialLoop is not initiated.
How can I get the experiment to exit the Boards loop online?
Thank you for any help you can give me.
Anthony