Key_resp.corr not storing properly

I am an undergrad who is still very new to coding and Psychopy.

OS (e.g. Win10): Win10

What are you trying to achieve?: I have a simple digit span experiment where I have a list of numbers being displayed, followed by participants inputting the correct number. In the key_resp.corr
section on the Excel spreadsheet the answers are randomly coming out as ‘0’ or ‘1’. There seems to be no rhyme or reason as to how the answers are coming out. I have tested this many times already by only inputting correct answers and the same thing occurs. As far as I understand from looking at the code, ‘0’ represents that there is an incorrect answer and ‘1’ represents a correct one. I am looking for key_resp.corr to display the actually correct output based on the participants response. I attached images of my key_resp as that might help.

What is NumList?

Is it a list of numbers or the current digit? How is it set?

Thank you for the response! NumList is a list of numbers. I’m not sure what you mean regarding how its set. I have multiple lists of numbers, all of which are referenced as xlsx files in one master file that I inserted into the loop function in the builder.

What I’m getting at here is…how can the correct answer for a single key response be a whole list? I am assuming that you must be looping through the list to display the numbers one at a time.

BTW, I have a digit span demo in online demos which generates the number sequences on the fly.

Digit Span code | try it

Random digits are presented at a rate of one per second. The first digit cannot be 0 Following digits can be 0 but cannot be the same as the previous digit. If the answer is correct the span is increased for the next trial If the answer is wrong the span is decreased for the next trial. If there are at least two errors at a given span and that represents more than half of the total attempts at that span then the experiment ends, returning a span of one less than the final span attempted.

Yep, I’m looping through the list to display the numbers one at a time. The participant would then have to repeat the numbers following a prompt. An asterick appears to prompt the participant whenever they need to type in a response. The correct answer would not be the whole list but rather a single key response. Perhaps I can attach my experiment on here?
New Number List.psyexp (17.4 KB)

Your CollectLoop is set to random. It also needs to be sequential.