latency based feedback


Author
Message
Anamaria
Anamaria
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 13, Visits: 1
Hi guys,



I have a question regarding feedback assignment based on participants RTs. For each CSrew trial, I want participants to receive a correct message (+10 & sound) only when they answer correctly (''q'' press) on the CSrew trial & only if their RT is faster than 300 ms. If they answer incorrectly and/or if their RT is slower than 300 ms, I want then to receive no feedback. Also, I want them to receive block feedback that tells participants how many points they won during the current block (the final number of points should be calculated based on the RTs and correct responses to the CSrew trials).


I have attached some parts of my script below.



Any hints would be greatefully received. Thanks in advance.



Ana




++GAMETASK++

<trial CSrew>
/ pretrialpause= 700
/ trialcode = "CSrew"
/ validresponse = ("q", "s")
/ correctresponse = ("q")
/ responsemessage = ("q", correctmessage, 500)
/ responsemessage = ("q", correctnoise, 500)
/ errormessage = (errormessage, 500)
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSrew, CSrewS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
</trial>



<trial CSneu>
/ pretrialpause= 700
/ trialcode = "CSneu"
/ validresponse = ("q", "s")
/ correctresponse = ("s")
/ errormessage = (errormessage, 500)
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSneu, CSneuS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
</trial>



<block intro_gametask>
/ screencolor = (0,0,0)
/ preinstructions = (intro_gametask)
/ trials = [1-12 = random (CSneu, CSrew)]
/ blockfeedback = (meanlatency, correct)
</block>



**Error, ?, Correct, GOAL TASK**


<text ?>
/ numitems = 1
/ items = ("?")
/ color = (255, 0, 0)
/ txbgcolor = (247, 247, 247)
/ position = (50, 50)
/ font = ("Arial Black", -37, 700, 0, 34)
</text>


<text correctmessage>
/ numitems = 1
/ items = (" +10 ")
/ font = ("Arial Black", -107, 700, 0, 34)
/ txbgcolor = (0, 0, 0)
/ position = (50, 50)
/ color = (255, 255, 255)
< /text>



<text errormessage>
/ numitems = 1
/ items = (" FOUT! ")
/ font = ("Arial Black", -107, 700, 0, 34)
/ txbgcolor = (0, 0, 0)
/ position = (50, 50)
/ color = (255, 0, 0)
</text>

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: 13K, Visits: 108K

For each CSrew trial, I want participants to receive a correct message (+10 & sound) only when they answer correctly (''q'' press) on the CSrew trial & only if their RT is faster than 300 ms. If they answer incorrectly and/or if their RT is slower than 300 ms


Use the <trial> element's /iscorrectresponse attribute. I.e.


/ iscorrectresponse = [trial.CSrew.response==16 && trial.CSrew.latency < 300]


Also, I want them to receive block feedback that tells participants how many points they won during the current block (the final number of points should be calculated based on the RTs and correct responses to the CSrew trials).


Calculate their points using <values>, <expressions> and conditional logic via /ontrialend, etc. Then display the result via a <trial> element at the end of the block.


Regards,


~Dave



Anamaria
Anamaria
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 13, Visits: 1

Hi Dave,


Thanks for guiding my steps a little bit. I tried to read the documentation and use the elements you suggested, but I failed abysmally. I have attached the updated script and I would appreciate if you could further help me out or maybe orient my efforts toward a task using similar elements. Thank you.



Ana

<trial CSrew>
/ pretrialpause= 700
/ trialcode = "CSrew"
/ validresponse = ("q", "s")
/ correctresponse = ("q")
/ responsemessage = ("q", correctmessage, 500)
/ responsemessage = ("q", correctnoise, 500)
/ errormessage = (errormessage, 500)
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSrew, CSrewS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
/ iscorrectresponse = [trial.CSrew.response== "q" && trial.CSrew.latency < 300]
/ stimulusframes = [1 = CSrew]
/ ontrialend=[if (trial.CSrew.correct == 1) then values.score = values.score + 10]
</trial>



<values>
/ score = 0
</values>


<text reward>
/ items= ("totalcorrectcount = <% trial.CSrew.totalcorrectcount %>")
</text>


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: 13K, Visits: 108K

#1: 'response' returns the keyboard scancode, not the literal key value. See Tools -> Keyboard Scancodes... See the example I posted in my previous reply.


#2: You don't need a correctresponse attribute when you've defined iscorrectresponse.


#3: /responsemessage won't help. Either use /correctmessage or /branch to a separate <trial> to display your feedback stims.


Anamaria
Anamaria
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 13, Visits: 1

Hi Dave,



I defined an ''iscorrect'' element and deleated the correctresponse element for CSrew trial. Then branched the mean latency < 350 ms. for the current CSrew trial to a another trial that delivers a correctmessage (+10) and a sound.correctnoise. Also, latency > 350 ms was branched to a nopoints message (0). So I am thankful I resolved this part.


However, one problem remains: if I add an errormessage as well for the CSrew trial and i press the correct key''q''it plays the errormessage at the same time with the correctmessage (+10). What I want is to get inquisit play the error message when I press the wrong key ''s''. How could I resolve this?


For instance, for the CSneu trial the error message is played correctly when pressing the wrong key, but for CSneu I use ''correctresponse'' while for CSrew I use ''iscorrectresponse''.


Thanks for helping me out.


Ana


*********************************


<trial  CSneu>
/ pretrialpause= 700
/ trialcode = "CSneu"
/ validresponse = ("q", "s")
/ correctresponse = ("s")
/ errormessage = (errormessage, 500)
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSneu, CSneuS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
</trial>


<trial CSrew>
/ pretrialpause= 700
/ trialcode = "CSrew"
/ validresponse = ("q", "s")
/ errormessage = (errormessage, 500)
/ iscorrectresponse = [trial.CSrew.response== "q" && trial.CSrew.latency < 350]
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSrew, CSrewS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
/ branch=[if (trial.CSrew.meanlatency < 350) trial.points]
/ branch = [if (trial.CSrew.meanlatency > 350) trial.nopoints]
</trial>


<trial points>
/ pretrialpause= 100
/ trialcode = "points"
/ responsemode = timeout (500)
/ stimulustimes = [0=correctmessage, correctnoise]
/ responseinterrupt = trial
/ posttrialpause= 100
</trial>



<trial nopoints>
/ pretrialpause= 100
/ trialcode = "nopoints"
/ responsemode = timeout (500)
/ stimulustimes = [0=nopoints]
/ responseinterrupt = trial
/ posttrialpause= 100
</trial>



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: 13K, Visits: 108K

/ iscorrectresponse = [trial.CSrew.response== "q" && trial.CSrew.latency < 350]


Your /iscorrectresponse attribute is unfunctional. As stated previously, you need to use keyboard scancodes if you want to check the response.


Anamaria
Anamaria
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 13, Visits: 1

Great, I understand it now. However, while using scancodes, the errormessage is still not played correcty. So how can I achieve this? Thanks again.  


<trial CSrew>
/ pretrialpause= 700
/ trialcode = "CSrew"
/ validresponse = ("q", "s")/ errormessage = (errormessage, 500)
/ iscorrectresponse = [trial.CSrew.response== "16" && trial.CSrew.latency < 350]
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSrew, CSrewS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
/ branch=[if (trial.CSrew.meanlatency < 350) trial.points]
/ branch = [if (trial.CSrew.meanlatency > 350) trial.nopoints]
</trial>


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: 13K, Visits: 108K

Here is a drastically stripped down version of your code:


<block myblock>
/ trials = [1-10=CSrew]
</block>

<trial CSrew>
/ trialcode = "CSrew"
/ validresponse = ("q", "s")
/ errormessage = (errormessage, 500)
/ iscorrectresponse = [trial.CSrew.response== "16"]
</trial>

<text errormessage>
/ items = ("ERROR")
</text>


Error messages work perfectly fine for me. If they do for you too with this code, you need to re-check your script for mistakes in other places.


Anamaria
Anamaria
Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)Associate Member (250 reputation)
Group: Forum Members
Posts: 13, Visits: 1

Hi Dave,


Thanks, I think I resolved the error feedback.


I have one more question: I defined values and used ontrialend in order to calculate how many points participants win during the task. But I get a message saying that ''value score'' is invalid.I have also defined a text score that is meant to be shown to participants at the end of the block, but I get a message that ''block_introgametask is invalid''. Could you help me understand what is missing? My goal is to get inquisit count the +10 points delivered during the block and then show participants a total score feedback at the end of each block.Thank you again for your patience.


Ana


*****************************************


<values>
/ score=0
</values>



<trial CSrew>
/ pretrialpause= 700
/ trialcode = "CSpun"
/ validresponse = ("q", "s")
/ errormessage = (errormessage, 500)
/ iscorrectresponse = [trial.CSrew.response== "16"]
/ responsemode = timeout (1500)
/ stimulustimes = [0= kaderm, CSrew, CSrewS; 100 = eraserm, ?]
/ responseinterrupt = trial
/ posttrialpause= 700
/ branch=[if (trial.CSrew.meanlatency < 350) trial.points]
/ branch = [if (trial.CSrew.meanlatency > 350) trial.nopoints]
/ ontrialend=[values.score = values.score + 10 * trial.CSrew.correct]
/ ontrialend=[if (trial.CSrew.correct == 1) values.score = values.score + 10]
</trial>



<text score>
/ items = ("Total score: <% block_introgametask %>")
/ position = (50%, 5%)
</text


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: 13K, Visits: 108K

I get a message saying that ''value score'' is invalid.


This is presumably due to a typo somewhere in your script. Inspect the element the error message is thrown for.


<text score>
/ items = ("Total score: <% block_introgametask %>")
/ position = (50%, 5%)
</text


This does not make sense. You don't want a <text> element to try and display a <block> element. You want the <text> element to display <%values.score%>, you want a <trial> to present said <text> element and a <block> to run said <trial>.


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search