URL of experiment: Sign in · GitLab

I wrote a digit span task with main 2 loops. the first is for the direct order, and the second for the inverse order. Both work fine, but the second one does not write anything in the output file. Actually, in the psychopy coder there is a message complaing about syntax error when I write digits_inv[::-1] == msg, to check if the typed answer is the inverse of the list of stimuli. I am afraid this is the reason nothing is written in the output from pavlovia, but didnt figure out how to change it. Here is the entire code from the End Routine part of my coder component:

thisExp.addData(“digit_span_serie”, “inversa”)

thisExp.addData(“digit_span_lista”, digits_inv)

thisExp.addData(“digit_span_resposta”, msg)

thisExp.addData(“series_comprimento”, series_len)

if digits_inv[::-1] == msg:

corr = 1

corr_answers += 1

else:

corr = 0

thisExp.addData(“acerto”, corr)

digits_inv = “”

if span_trials_2.thisN == 1:

if corr_answers == 0:

trials_2.finished = True

else:

corr_answers = 0

thank you!