Hi Jens,
Thanks! I used the fcolor = "blue"
and corrected my feedback_duration. But still, no feedback messages showing up.
Hi Jens,
I checked the code all over again and ran the experiment. The feedback messages became “feedback” in blue. So maybe something wrong in my 2-back code component?
I took your .py file and added the 2-back code. It turned out to be always “Wrong!” again.
Hello,
your n-back code does not do what you intend it to do. I added some print commands following the if-expression of your n-back code
print("Trial: ", trials.thisN)
print("two_back: ", two_back)
print("one_back: ", one_back)
print("practice_letter: ", practice_letter)
print("corrAns:", corrAns)
print("------")
to check the variable values. As you can see the variables have the wrong values from trial 3 on (one_back should be A aso.). Alas, I reached after-work hours. I take a look in this later this week.
Trial: 0
two_back: B
one_back: not applicable
practice_letter: B
corrAns: None
------
Trial: 1
two_back: B
one_back: H
practice_letter: H
corrAns: None
------
Trial: 2
two_back: B
one_back: H
practice_letter: A
corrAns: None
------
Trial: 3
two_back: H
one_back: H
practice_letter: H
corrAns: space
------
Trial: 4
two_back: H
one_back: A
practice_letter: A
corrAns: None
------
Trial: 5
two_back: A
one_back: C
practice_letter: C
corrAns: None
------
Trial: 6
two_back: C
one_back: S
practice_letter: S
corrAns: None
------
Trial: 7
two_back: S
one_back: D
practice_letter: D
corrAns: None
------
Trial: 8
two_back: D
one_back: S
practice_letter: S
corrAns: None
------
Trial: 9
two_back: S
one_back: H
practice_letter: H
corrAns: None
------
Trial: 10
two_back: H
one_back: C
practice_letter: C
corrAns: None
------
Trial: 11
two_back: C
one_back: D
practice_letter: D
corrAns: None
------
Trial: 12
two_back: D
one_back: H
practice_letter: H
corrAns: None
------
Trial: 13
two_back: H
one_back: D
practice_letter: D
corrAns: None
------
Trial: 14
two_back: D
one_back: E
practice_letter: E
corrAns: None
------
Hi Jens,
Thank you for helping me so much!
I see, I will do more research and check the code in these days.
I look forward to hearing from you soon.
Thank you!
Hello JX.Long
why do you use the code to determine the n-back stimuli? Do you want to randomize your item-list or do present the item-list in the sequential order as in your Excel-file?
Best wishes Jens
Hi Jens,
Actually the code I used was adapting from other experiments, so I am not quite sure if it was a right way to present my task.
The present experiment is a practice section for my 2-back task and I want to present the item-list in the sequential order as in my Excel-file. The next section is formal experiment section, it contains 80 trials and I want to present the letters in a random way.
Thank you!
Hello,
ok, good to know. For your practice trials you do not need the n-back code, because you can specify the expected targets in your excel-file.
With regard to randomization, you certainly want to have a predetermined number of n-back trials, don’t you?
Best wishes Jens
I see! So I just need to set the specific letters to be the correct answers and the feedback as well, right?
Yes, I do! I have another excel file that contains 80 random letters which is generated by the excel random function.
80trials.xlsx (13.1 KB)
Thank you!
Hello JX.Long,
Yes, just set the correct answer for the n-back trials and you should be fine there.
PsychoPy can randomize the Exel-file. If you use a randomized Excel-file all participants will receive the stimuli in the same order! BTW, if you create new random orders, you will see that the number of n-back trials varies between 1 and x. Do you want this?
Best wishes Jens
OK! I will do this. Thank you!
I didn’t expect that. So no, I want the all the participants receive the same percentages of the n-back matches.
Hello JX.Long
you have two options:
- you create an Excel-file for each participant with the intended percentage of n-backs. This is not very flexible and you need some code to read the participant-specific Excel-file.
- you need to write some code that creates a randomized list with the intended percentage of n-backs.
Do plan to run the experiment on-line? If so, I would opt for option 2.
Best wishes jens
Hi Jens,
Yes indeed, I am expecting to run my experiment on-line.
Thank you very much.
Hi Jens,
I found it difficult to set letters in random and remain the same percentage of the consistency of the letters. Do the memory and random functions have to be done in psychopy and the excel file only contains letters and correct answers?
Thank you!
Hello JX.Long
well, I suggest you open a new thread so that it can be easier found when there is a solution.
You have two option: (1) brute force, that is randomize your stimuli until they are ordered as needed. You need to check each randomization if it is as intended. If not, rerandomize your stimuli. Notice that this might take very long. (2) pseudo-randomize your stimuli. Randomize your stimuli and insert the targets at the appropriate places.
Best wishes Jens
Hi Jens,
I’m sorry I am not quite familiar with python so I don’t know how to open a new thread. Are the two options based on the new thread or I can do them in psychopy?
Thank you!
This is definitely something I can code for you if you can find a budget. My latest n back version has an extra routine which is skipped for non n back trials. However, it sounds like you might need a little more than just having a copy of my script.
Hi @wakecarter
Thank you for replying. A budget means you can help me make the 2 back codes and I pay for it via real money?
Correct. I’ve sent you a PM.
Here’s an N-Back task of mine that isn’t yet rewritten to work online.
pm nback.psyexp (64.8 KB)
Hello JX.Long
I meant opening a new topic here.
Best wishes Jens
Thanks Jens! I solved the random problem.
And thank you for helping me so much. I really appreciate it.