[solved] repeat sketchpad until correct response given
Hi,
I am trying to build an experiment with this structure:
1 - Loop with the variables [stimulus] and [correct_response]
2 - Sequence
3 - Sketchpad ([stimulus])
4 - Keyboard_response (a;l as possible keys)
Now, I want another Sketchpad to appear only if the response was wrong:
5 - Sketchpad ('wrong!')
This works, if I set a run if statement for 5 in the surrounding sequence ([response]!=[correct_response]).
But now I want the Sketchpad 5 to be shown until the correct response is given.
How do I do that? I already started with nested loops and break if and also tried to do everything with an inline script but with no success so far. I think I need a while loop that collects a second keyboard_response.
Thanks for your help,
Johannes

Comments
Hi Johannes,
What happens, if you put following script in an
inline_scriptafterSketchpad 5(whosedurationis set tokeypress)?I haven't tried it, but I believe this (or something similar) should do the trick.
Eduard
Thank you Eduard,
That did the trick. I inserted this inline script (I had to change
exp.correct_responsetoexp.get('correct_response'), though).Then I set both Sketchpad 5 and the inline script to run if
[response]!=[correct_response]within the surrounding sequence.I still have to check if all the variables are logged that I want to be logged, but it already runs the way I want it to.
Johannes