|
Post by morteza on Jun 7, 2020 12:18:53 GMT
Hello, I'm trying to create a backward digit-span experiment and i want the experiment to stop after the participant gives two incorrect answers in a row (every block includes two trials and after the subject answers incorrectly to both of them, i want the experiment to stop). Is there any specific code for this purpose that i can add to my experiment code? Here is an example of the first block :
task block_1 #trial 1 sound sound_3 # sound file saying number 3 delay 1000 sound sound_1 # sound file saying number 1 readkeys 13 10000 clear screen save RT STATUS BLOCKNAME delay 2000 # trial 2 sound sound_2 delay 1000 sound sound_4 readkeys 42 10000 clear screen save RT STATUS BLOCKNAME delay 2000
Many thanks!
|
|
|
Post by PsyToolkit on Jun 8, 2020 10:53:03 GMT
Yes, that would be fairly straightforward to do. What you need to do is the following: 1) Included a counter of incorrect responses in your task 2) If that counter goes over 2, then end the experiment (with end experiment) Something like this at the end of your task if STATUS == CORRECT set &errorcounter 0 fi if STATUS != CORRECT set &errorcounter increase if &errorcounter > 2 end experiment fi fiNote that in the above, you use the "&" sign to use a global variable that keeps its value across trials. Look at the documentation for end here: www.psytoolkit.org/doc3.1.0/syntax.html#_very_advanced_instructions
|
|
|
Post by morteza on Jun 8, 2020 12:14:34 GMT
I really appreciate your help, thank you.
|
|