Help - Adjust "values" when participant gets incorrect answer


Author
Message
maya_mcg
maya_mcg
Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)
Group: Forum Members
Posts: 12, Visits: 54
Hello,

In my experiment, participants will hear a sound clip with a scream and in the middle of the scream, there will be a control question where a number is played. After the scream trial, participants will be asked a control question and they have to enter the number they heard. At the same time, I will be keeping a tally of the number of coins participants have left. When participants get the number incorrect, I would like them to get notified that they will lose two coins, and I would like their "coins_left" value to subtract two. Is this possible? 

Below is my relevant code

<sound scream1>
/ items = ("one_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream2>
/ items = ("two_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream3>
/ items = ("three_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("1")
</textbox>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("2")
</textbox>

<textbox controlQ3>
/ caption = (controlQ)
/ correctresponse = ("3")
</textbox>


<block waldo1>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream1)
</block>

<block waldo2>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream2)
</block>

<block waldo3>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream3)
</block>

<values coins>
/ coins_left = 130
</values>

<text how_many>
/ items = ("You have <%values.coins_left%> coin(s) left. How many coins do you want to bet?")
/ fontstyle = ("Lucida Grande", 3.11%, true, false, false, false, 5, 0)
/ position = (30,15)
</text>

<surveypage bet>
/ questions = [1=bet_radiobuttons]
/ showpagenumbers = false
/ showquestionnumbers = false
/ stimulustimes = [1=how_many, 1coin, 10coins; 2000=reminder]
/ recorddata = true
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]
</surveypage>

expt questionnaires>
/ blocks = [1=waldo1; 2=controlQ1
3=waldo2; 4=controlQ2
5=waldo3; 6=controlQ3]

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
maya_mcg - 11/27/2020
Hello,

In my experiment, participants will hear a sound clip with a scream and in the middle of the scream, there will be a control question where a number is played. After the scream trial, participants will be asked a control question and they have to enter the number they heard. At the same time, I will be keeping a tally of the number of coins participants have left. When participants get the number incorrect, I would like them to get notified that they will lose two coins, and I would like their "coins_left" value to subtract two. Is this possible? 

Below is my relevant code

<sound scream1>
/ items = ("one_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream2>
/ items = ("two_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream3>
/ items = ("three_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("1")
</textbox>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("2")
</textbox>

<textbox controlQ3>
/ caption = (controlQ)
/ correctresponse = ("3")
</textbox>


<block waldo1>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream1)
</block>

<block waldo2>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream2)
</block>

<block waldo3>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream3)
</block>

<values coins>
/ coins_left = 130
</values>

<text how_many>
/ items = ("You have <%values.coins_left%> coin(s) left. How many coins do you want to bet?")
/ fontstyle = ("Lucida Grande", 3.11%, true, false, false, false, 5, 0)
/ position = (30,15)
</text>

<surveypage bet>
/ questions = [1=bet_radiobuttons]
/ showpagenumbers = false
/ showquestionnumbers = false
/ stimulustimes = [1=how_many, 1coin, 10coins; 2000=reminder]
/ recorddata = true
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]
</surveypage>

expt questionnaires>
/ blocks = [1=waldo1; 2=controlQ1
3=waldo2; 4=controlQ2
5=waldo3; 6=controlQ3]

It's possible in exactly the same way you already subtract coins in the betting trials. The code you provided, however, is not in the least bit functional. <textbox> elements are neither trials not blocks. They belong on surveypages (surveypages are trials), and those pages belong in a block.

Edited 4 Years Ago by Dave
maya_mcg
maya_mcg
Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)
Group: Forum Members
Posts: 12, Visits: 54
Dave - 11/27/2020
maya_mcg - 11/27/2020
Hello,

In my experiment, participants will hear a sound clip with a scream and in the middle of the scream, there will be a control question where a number is played. After the scream trial, participants will be asked a control question and they have to enter the number they heard. At the same time, I will be keeping a tally of the number of coins participants have left. When participants get the number incorrect, I would like them to get notified that they will lose two coins, and I would like their "coins_left" value to subtract two. Is this possible? 

Below is my relevant code

<sound scream1>
/ items = ("one_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream2>
/ items = ("two_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream3>
/ items = ("three_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("1")
</textbox>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("2")
</textbox>

<textbox controlQ3>
/ caption = (controlQ)
/ correctresponse = ("3")
</textbox>


<block waldo1>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream1)
</block>

<block waldo2>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream2)
</block>

<block waldo3>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream3)
</block>

<values coins>
/ coins_left = 130
</values>

<text how_many>
/ items = ("You have <%values.coins_left%> coin(s) left. How many coins do you want to bet?")
/ fontstyle = ("Lucida Grande", 3.11%, true, false, false, false, 5, 0)
/ position = (30,15)
</text>

<surveypage bet>
/ questions = [1=bet_radiobuttons]
/ showpagenumbers = false
/ showquestionnumbers = false
/ stimulustimes = [1=how_many, 1coin, 10coins; 2000=reminder]
/ recorddata = true
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]
</surveypage>

expt questionnaires>
/ blocks = [1=waldo1; 2=controlQ1
3=waldo2; 4=controlQ2
5=waldo3; 6=controlQ3]

It's possible in exactly the same way you already subtract coins in the betting trials. The code you provided, however, is not in the least bit functional. <textbox> elements are neither trials not blocks. They belong on surveypages (surveypages are trials), and those pages belong in a block.

Thanks Dave, yes I do have surveypages sorry! An example surveypage is the following:

<surveypage controlQ1>
/ questions = [
    1=controlQ1]
/ showpagenumbers = false
/ showquestionnumbers=false
</surveypage>

Could you give an example of how the line of code would look to subtract 2 coins for an incorrect response? I'm just not sure what specifically to change from the line of code for the betting coins values. 

The coding line for the betting was
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
maya_mcg - 11/27/2020
Dave - 11/27/2020
maya_mcg - 11/27/2020
Hello,

In my experiment, participants will hear a sound clip with a scream and in the middle of the scream, there will be a control question where a number is played. After the scream trial, participants will be asked a control question and they have to enter the number they heard. At the same time, I will be keeping a tally of the number of coins participants have left. When participants get the number incorrect, I would like them to get notified that they will lose two coins, and I would like their "coins_left" value to subtract two. Is this possible? 

Below is my relevant code

<sound scream1>
/ items = ("one_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream2>
/ items = ("two_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<sound scream3>
/ items = ("three_new.mp3")
/ select = replace
/ erase = false
/ volume = 0
</sound>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("1")
</textbox>

<textbox controlQ1>
/ caption = (controlQ)
/ correctresponse = ("2")
</textbox>

<textbox controlQ3>
/ caption = (controlQ)
/ correctresponse = ("3")
</textbox>


<block waldo1>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream1)
</block>

<block waldo2>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream2)
</block>

<block waldo3>
/ onblockbegin = [
    values.attempts_left = 3;
    values.circle_x = -10%;
    values.circle_y = -10%;
]
/ timeout = 7000
/ trials = [
    1=clip_first;
]
/ bgstim = (scream3)
</block>

<values coins>
/ coins_left = 130
</values>

<text how_many>
/ items = ("You have <%values.coins_left%> coin(s) left. How many coins do you want to bet?")
/ fontstyle = ("Lucida Grande", 3.11%, true, false, false, false, 5, 0)
/ position = (30,15)
</text>

<surveypage bet>
/ questions = [1=bet_radiobuttons]
/ showpagenumbers = false
/ showquestionnumbers = false
/ stimulustimes = [1=how_many, 1coin, 10coins; 2000=reminder]
/ recorddata = true
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]
</surveypage>

expt questionnaires>
/ blocks = [1=waldo1; 2=controlQ1
3=waldo2; 4=controlQ2
5=waldo3; 6=controlQ3]

It's possible in exactly the same way you already subtract coins in the betting trials. The code you provided, however, is not in the least bit functional. <textbox> elements are neither trials not blocks. They belong on surveypages (surveypages are trials), and those pages belong in a block.

Thanks Dave, yes I do have surveypages sorry! An example surveypage is the following:

<surveypage controlQ1>
/ questions = [
    1=controlQ1]
/ showpagenumbers = false
/ showquestionnumbers=false
</surveypage>

Could you give an example of how the line of code would look to subtract 2 coins for an incorrect response? I'm just not sure what specifically to change from the line of code for the betting coins values. 

The coding line for the betting was
/ ontrialend = [
    values.coins_left-=radiobuttons.bet_radiobuttons.response;
]

<block cq1>
/ trials = [1=controlQ1]
</block>

<surveypage controlQ1>
/ ontrialend = [
    if (textbox.controlQ1.response != "1"){
        values.coins_left -= 2;
    }
]
/ questions = [
  1=controlQ1]
/ showpagenumbers = false
/ showquestionnumbers=false
/ branch = [
    if (textbox.controlQ1.response != "1") {
        trial.loss;
    }
]
</surveypage>

<textbox controlQ1>
/ caption = "Control Q1"
/ mask = positiveinteger
</textbox>

<values>
/ coins_left = 130
</values>

<trial loss>
/ stimulusframes = [1=lossmsg]
/ trialduration = 2000
</trial>

<text lossmsg>
/ items = ("Your answer was wrong and you lost 2 coins.
You now have <%values.coins_left%> coins left.")
/ size = (60%, 20%)
</text>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search