Help with loop placement for sequential image presentation across iterations

OS (e.g. Win10): macOS Big Sur Version 11.6
PsychoPy version (e.g. 1.84.x): 2021.1.2

We are creating a math stress task where participants:

  1. are given a math problem as an image
  2. select a response within a given timeframe
  3. are provided feedback (correct, incorrect, respond more quickly)
  4. are shown a fake bar graph that shows how they are doing in comparison to other participants (“Comparison” routine in the image below)

Steps 1-4 are repeated 5 times per block . Each time, the pre-made image bar graph indicates that the participant’s performance is slightly worse than other participants.

At the end of the block, they are asked how stressful the set of problems are.

I am having a difficult time properly demonstrating the bar graph images, in sequence, only one after each feedback.

I think this may be due to my “comparison_loop_block” placement or the need to add a code component.

For some context, my “comparison_loop_block” references my excel loopfile (entitled Comparison_loopfile.xlsx). Within this file I have the file locations for excel files under the column named “Comparisonfile” - referenced in “comparison_loop_1”. Each of the files contains a column “ComparisonImage” which contains the location for an image of a comparison graph that is referenced in the “comparison” block. It is important that the images stay in the order in which they are currently organized.


Settings of comparison_loop_block

Settings of comparison_loop_1

Example of excel file which leads to the location of the comparison graph image:

What I tested:

When I try placing the “comparison_loop_block” within the bounds of the “trials” block that controls the image presentation of the math problems, the same math problem shows up 5 times. After each time the image shows, the comparison graph does change as it should - in order (suggesting that the participant is doing worse than others), one at a time (only one after each math problem). After showing the same math problem 5 times and all 5 different graphs appear, another math image is shown 5 times and all the graphs again appear one at a time, in order. Basically, I need to fix this scenario so I get a different math problem rather than the same problem showing up 5 times.

When I try placing the "comparison_loop_block outside of the bounds of the “trials” loop, the reverse occurs. The math problems change but the graph stays the same all 5 times. Then, the same 5 math problems appear randomly while the next graph image comes up, etc.

I am unsure what steps I should be taking to ensure both the math problems and comparison graphs are changing each time. I only want each block to contain 5 math problems and the comparison graphs to be shown sequentially (only one after each math problem)

Thank you so much for your time!

Hi there, can I just confirm that regardless of how well participants are doing, the performance graph is already predetermined right?
sequential_image_presentation.psyexp (17.3 KB)
conditions.xlsx (8.4 KB)

If so, this demo should do the trick.

I could only upload 5 files at a time. Here’s the images I used as a placeholder for your performance graphs.

Best wishes,
Sue Lynn


Hi Sue,

Thank you so much! I can’t express how thankful I am for your help! I have been really stuck on this.

You are right, the performance graph is predetermined regardless of how well the participants are doing.

I will take a look at your demo and definitely try to implement this. I will keep you updated!

Thank you!

Thank you so much! I have finished making the math stress task and it works great!

1 Like