Access response history for feedback
We are currently designing a simple color coordination game. 2 colored squares are located on the top-left/top-right side of the screen (let's say, red and blue). 2 players should coordinate their choices in order to click on the same colored square as many times as possible(20 trials). In this case, the first trial has a 50% chance to be correct. Except that player 1 is fictional and that the game is rigged so that the first choice of player 2 (an actual participant) will always be 'correct'. Therefore, the most logical thing to do for player 2 would be to stick to the same color as the previous trial. For each 'correct' trial (i.e., same color as the trial before), a positive feedback will appear to reinforce similar choice on further trials.
However, if player 2 doesn't stick to the same color (e.g., Player 2 chose 'red' in trial 1 which was correct and changes to 'blue' in trial 2), an error message should appear saying something like 'Wrong ! You partner clicked on RED again'
For now, I can access to the response color for the current trial:
if var.response=="OptionA": var.responsecolor = var.color_a else: var.responsecolor = var.color_b
But I'm struggling to access the response color of the trial before. I'm assuming that this could help (osdoc.cogsci.nl/3.1/manual/python/responses/ but I'm not sure how to use it.
Also, I included this to mark the first trial as correct all the time:
trial_count = self.get("count_trial") trial_count = trial_count + 1 if trial_count == 1: var.correct = 1
I'm struggling to gather everything together, any help would be greatly appreciated !
All the best