Dear all,
For an adjusted version of the cyberball game I am trying to use a list element within an if statement.
The idea is that when participants click on a certain player to throw the ball, the ball sometimes is thrown to a different player. Therefore, I created lists. When the participants' response is, for example, "player1label", I want to tell Inquisit to use the list.recipient1. Based on the value of this list I want values to change and the next trial also depends on the value of that list. Right now the script just quits, so obviously something is wrong. I am just not sure how to do this correctly.
I hope my question is clear, I included my code below.
<trial 1to2_unpred_motiv>
/ontrialbegin = [values.player = 2]
/ ontrialbegin = [shape.progressbar.width=100%*(values.count_throws/25)]
/ stimulusframes = [1 = 1to2, player1label, player2label, player3label, player4label, durgameinstr, progressbar, text.score]
/ validresponse = (text.player1label, text.player3label, text.player4label)
/ inputdevice = mouse
/ontrialend = [if (trial.1to2_unpred_motiv.response == "player1label") {values.recipient = list.recipient1}]
/ontrialend = [if (trial.1to2_unpred_motiv.response == "player3label") {values.recipient = list.recipient3}]
/ontrialend = [if (trial.1to2_unpred_motiv.response == "player4label") {values.recipient = list.recipient4}]
/ ontrialend = [if (values.recipient == 1){values.count_player2throws += 1; values.count_throws +=1; values.count_21 += 1; values.score -=2}]
/ ontrialend = [if (values.recipient == 3){values.count_player2throws += 1; values.count_throws +=1; values.count_23 += 1; values.score +=2}]
/ ontrialend = [if (values.recipient == 4){values.count_player2throws += 1; values.count_throws +=1; values.count_24 += 1; values.score +=2}]
/ branch = [if (list.recipient1.currentvalue == 1) trial.2to1_unpred_motiv]
/ branch = [if (list.recipient3.currentvalue == 3) trial.2to3_unpred_motiv]
/ branch = [if (list.recipient4.currentvalue == 4) trial.2to4_unpred_motiv]
</trial>
Thank you in advance for you answer.
Kind regards,
Esther