Access response history for feedback
Hi there,
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
CL
Comments
EDIT:
Perhaps creating a list might be more suitable ? For now, I came up with something like this that seems to do the job but I might miss something:
Hi,
The
responses
object only stores information about responses. It's not clear to me if that's enough in your case, or if you really need information about experimental variables on the previous trial—which are not stored by theresponses
object.In any case, the
responses
object has several properties that give you alist
of responses, response times, etc. For example, to get the last response:Or the second-to-last response:
So that's easy. But if this doesn't give you the information you need, then you'll indeed have to create your own list-based system, like you're doing in your last post.
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
That makes perfect sense, thank you ! I think that to do what I need, I'll have to stick to the home-made list system !