By Elina - 5/11/2015
Hi, I'm trying to do an Inquisit experiment where at some point the participant can decide whether he wants to discount points from one of his three ostensible partners. There is a text element where the participant can see everybody's points, like:
Me: 10 points Jennifer: 15 points John: 5 points Matthew: 6 points
Then, there is a radiobutton asking if the participant wants to substract 10 points from one of his partners' accounts. I dont know how I can make the tex change according to the radiobutton response... I would be very grateful for any help! (And sorry for my bad English, I hope you understood what I meant...) Best, Elina
|
By Dave - 5/11/2015
There should be no reason to "change" the text. It's preferable to use variables to keep track of the players' points and use simple math to adjust the amounts based on response:
<values> / me_points = 10 / jennifer_points = 15 / john_points = 5 / matthew_points = 6 / deduceamount = 10 </values>
<block myblock> / trials = [1-3=deducepointspage; 4=endpage] </block>
<caption playerpoints> / caption = "Me: <%values.me_points%> points Jennifer: <%values.jennifer_points%> points John: <%values.john_points%> points Matthew: <%values.matthew_points%> points" </caption>
<radiobuttons deducepoints> / caption = "Deduce <%values.deduceamount%> points from" / options = ("Jennifer", "John", "Matthew") </radiobuttons>
<surveypage deducepointspage> / ontrialend = [if (radiobuttons.deducepoints.response=="Jennifer") values.jennifer_points-=values.deduceamount; ] / ontrialend = [if (radiobuttons.deducepoints.response=="John") values.john_points-=values.deduceamount; ] / ontrialend = [if (radiobuttons.deducepoints.response=="Matthew") values.matthew_points-=values.deduceamount; ] / questions = [1=playerpoints; 2=deducepoints] </surveypage>
<surveypage endpage> / questions = [1=playerpoints] </surveypage>
|
By Elina - 5/11/2015
Thank you very much, that worked out perfectly! :) One last question: If the participant's points depend on his achievement in another block, how do I put that?
<values> / me_points = block.blockname.totalcorrectcount / Jennifer_points = 15 ... / deduceamount = 50 </values>
This was my idea, but it doesn't work. ;)
|
By Dave - 5/11/2015
You do
<block someblock> / onblockend = [values.me_points = block.someblock.totalcorrectcount] ... </block>
|
By Elina - 5/11/2015
Great, thanks for the really fast reply! :)
|
|