psychopy.org | Reference | Downloads | Github

How to 'jump' back to previous routine after incorrect rating?

#1

Dear community,

I have an unsolved issue regarding this chain of routines.

Unbenannt

The process is as follows: The participants read two instruction pages followed by a manipulation check with a few rating items. If the rating is correct the participant will be guided to the next routine. Otherwise they are stuck at the manipulation check and have to rethink their answers. The evaluation of the ratings is done in a code component (each frame) as follows:

keys = event.getKeys()

if 'space' in keys and m1.getRating() and m2.getRating() and m3.getRating() and m4.getRating() and m5.getRating() and m6.getRating() is not None:
    rating1 = int(m1.getRating())
    rating2 = int(m2.getRating())
    rating3 = int(m3.getRating())
    rating4 = int(m4.getRating())
    rating5 = int(m5.getRating())
    rating6 = int(m6.getRating())
    if rating1 == 4 and rating2 == 2 and rating3 == 3 and rating4 == 4 and rating5 == 1 and rating6 == 5:
        continueRoutine = False

Now, I want to adjust the process a little bit. How is it possible to jump back to the ‘Instruction’ routine if the rating is incorrect? I could not figure it out on my own. Probably, I have to insert a Else: function, right?

Thx for your suggestions! :slight_smile: