Millisecond Forums

Removing Valid Response

https://forums.millisecond.com/Topic13554.aspx

By nashby - 6/15/2014

So I have a problem I have three valid responses in a given trial. However, if they select from one of the options 100 times that option needs to go away (not be show) and no longer be a valid response (not be clickable).

In the code below I get the options to disappear but i cannot figure out how to make them to also no longer be selectable (i.e., even though I can't see them I can still click them and move through the trials). Any thoughts on how to fix this?

<trial mytrial1>
/ stimulusframes = [1= InTaskInstructions ; 2= Play; 3= LabelA; 4= LabelB; 5=  Loutcome; 6 = ROutcome;]
/ validresponse = (LabelA, LabelB, Play)
/ inputdevice = mouse
/ ontrialend = [values.samples += 1]
/ ontrialbegin = [values.ran = round(rand(1,100))]
/ ontrialbegin = [if (values.samplesl >= 100) {trial.mytrial1.removestimulusframe(3);trial.mytrial1.removestimulusframe(5);}]
/ ontrialbegin = [if (values.samplesr >= 100) {trial.mytrial1.removestimulusframe(4);trial.mytrial1.removestimulusframe(6);}]

/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran <= values.pw1a && values.side  <= 50) {values.outcome=values.ow1a; values.spicked = 0; }]
/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran > values.pw1a && values.ran <= values.pw1b && values.side  <= 50) {values.outcome=values.ow1b; values.spicked = 0; }]
/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran > values.pw1b && values.side  <= 50) {values.outcome=values.ow1c; values.spicked = 0;}]
/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran <= values.pn1a && values.side  <= 50) {values.outcome=values.on1a; values.spicked = 1;}]
/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran > values.pn1a && values.ran <= values.pn1b && values.side  <= 50) {values.outcome=values.on1b; values.spicked = 1; }]
/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran > values.pn1b && values.side  <= 50) {values.outcome=values.on1c; values.spicked = 1;}]


/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran <= values.pw1a && values.side  > 50) {values.outcome=values.ow1a; values.spicked = 1; }]
/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran > values.pw1a && values.ran <= values.pw1b && values.side  > 50) {values.outcome=values.ow1b; values.spicked = 1;}]
/ ontrialend = [ if (trial.mytrial1.response == "LabelB" && values.ran > values.pw1b && values.side  > 50) {values.outcome=values.ow1c; values.spicked = 1;  }]
/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran <= values.pn1a && values.side  > 50) {values.outcome=values.on1a; values.spicked = 0;}]
/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran > values.pn1a && values.ran <= values.pn1b && values.side  > 50) {values.outcome=values.on1b; ; values.spicked = 0;}]
/ ontrialend = [ if (trial.mytrial1.response == "LabelA" && values.ran > values.pn1b && values.side  > 50) {values.outcome=values.on1c; values.spicked = 0;}]


/ ontrialend = [if (trial.mytrial1.response == "LabelA") {text.Loutcome = "<% values.outcome %> pts."; text.routcome = "  "; values.samplesl += 1;}]
/ ontrialend = [if (trial.mytrial1.response == "LabelB") {text.Routcome = "<% values.outcome %> pts."; text.loutcome = "  "; values.samplesr += 1;}]
</trial>

By Dave - 6/15/2014

You'll want to use /isvalidresponse to invalidate any previously selected response across trials. That, of course, requires you to store those previous responses somewhere (e.g. in a <values> entry). If you want a concrete example, you can take a look at the "Information Sampling Task" or "Columbia Card Task" scripts available via the Task Library. They do precisely that.
By nashby - 6/16/2014

Thanks this does it.