Help with trial-specific feedback (delay discounting task)

Thanks everyone for taking the time to read this!

I am creating a delay discounting task (choosing between an immediately-available smaller reward and a larger reward available after a delay) in PsychoPy. I have one routine for the task that is looped 51x and references an excel conditions file.

I am attempting to add a component that would present feedback on the participant’s choice. I want the feedback to state a message that would be specific to each of the 51 trials; it would need to reference information I have in a separate excel file.

For example, say I had normative data for 10 questions. I want the participant to select a choice on any one of those questions, and the subsequent feedback to state, “you made the same choice as X% of people who take this test.” I.e., the message would need to change along with the trial (and corresponding row of information in the conditions file).

I really hope I made sense and I’m sorry if not haha. Thank you for any and all help in advance. Obviously happy to clarify whatever – I’m a super noob to PsychoPy and a little bit of a luddite. The delay discounting task was simple to design, but I’m entirely lost on how to implement this specific-flavor of feedback.

Do you want independent randomisation of two separate elements? If so, please check my online demos.