Feedback to a Sequences of Numbers

The explanation of my task is relatively simple
But I do not know how to do it
Numbers 1 through 9 are displayed randomly and Sequential (Each time one number is displayed)
The purpose is to detect a multi-digit sequence of numbers ( for example 3.5.2 )
And whenever the subject sees the target sequence, he/she must answer (For example, press the space bar)

I know how to display numbers, but I do not know how to define the sequence of numbers as the correct answer.

Another problem is that The frequency of the target sequence display should be specified (For example, every 30 times the numbers are displayed, 5 times the target sequence will be displayed)

@Emindor, you can use something like this (attached). The code component first creates your sequences of stimuli shuffled with the target sequences built in, and a column showing True or False to display whether those numbers in that sequence are part of the target sequence. A csv file of the trial list is created and passed to the loop handler, where those values are used to display text and determine whether a stimuli sequence is target or not target. When the participant responds during a target, the code component writes True (for correct) or False (for incorrect) in the data file, depending on whether or not the response was correct (or incorrect). That should give you some ideas.

sequences.psyexp (9.1 KB)

Hello @dvbridges
At first I should express my gratitude and appreciation for spending your time helping me
maybe because of a technical problem with my computer system, I’m not able to execute the file you sent
so this will be very helpful if you put the Python code you entered into the Psychopy here
Thanks again for your help

@Emindor no problem, if you have anymore errors please post them. This should work on the standalone psychopy.

sequences.py (9.6 KB)