alain
New Member
Posts: 3
|
Post by alain on Sept 16, 2020 11:33:15 GMT
Hello, I'm trying to have an expe with failed trials taken into account, i.e., if there is a failed trial, it is immediately replayed.
So i tried the command "repeat_on_error"
for example I tried the little example of the help :
table MyTable "condition1" 255 0 0 1 ## respond with "r" to red rectangle "condition2" 0 255 0 2 ## respond with "g" to green rectangle
task Mytask table MyTable keys r g show rectangle 0 0 10 10 @2 @3 @4 readkey @5 2000 if STATUS == WRONG error ## this tells PsyTookit that this trial is considered an error fi clear -1 delay 500 save @1 STATUS RT
block MyTraining tasklist Mytask 2 repeat_on_error end
But there is always only 2 trials, even if both are failed (r key for a green box for example). If I'm understanding correctly it should be played until 2 correct trials are done no ? Am I missing something ? Is there a problem with the "repeat_on_error" command ?
Thanks a lot for your attention and your help. Alain
|
|
|
Post by PsyToolkit on Sept 16, 2020 22:08:08 GMT
Good question! Also really good for adding the code, which makes it much easier to check what you mean.
I changed the line in red. Also, if you have only one table, you do not need to have a "table" line in your task, because the parse will figure out on its own which table to use.
STATUS can have three values (you can use number or word) as follows:
1: CORRECT "correct key pressed"
2: WRONG "wrong key pressed"
3: TIMEOUT "no key pressed within the requested time"
The "WRONG" status means people pressed a button, the wrong button. You basically mean that people are either pressing wrong button or none at all, so we use the "NOT EQUAL" sign, which in computer sciences is !=
Here is the code which works. I added a text line for ease of following:
table MyTable "condition1" 255 0 0 1 ## respond with "r" to red rectangle "condition2" 0 255 0 2 ## respond with "g" to green rectangle
task Mytask keys r g show text @1 0 200 show rectangle 0 0 10 10 @2 @3 @4 readkey @5 2000 if STATUS != CORRECT error ## this tells PsyTookit that this trial is considered an error fi clear -1 delay 500 save @1 STATUS RT
block MyTraining tasklist Mytask 2 repeat_on_error end
|
|
alain
New Member
Posts: 3
|
Post by alain on Sept 17, 2020 7:26:45 GMT
Thank you very much for your answer. Maybe I miss something, for me the code you gave does not work : even if I'm pressing "r" when it's green (WRONG) or if I'm waiting without pressing anything (TIMEOUT), I have only 2 trials in my experiment whereas what I would like is that these 2 trials are repeated until correctly done. Is this working for you? I mean would it be a problem on my side only? (but I don't see why it would be the case : I have ubuntu 16.04 and firefox). Thanks again for your attention. Alain
|
|
alain
New Member
Posts: 3
|
Post by alain on Sept 22, 2020 12:37:38 GMT
Hello PsyToolkit Administrator, just to check if you have seen that for me it is not working ? Would you have an advice for me ? Thanks a lot for your attention. Alain
|
|