conditional statement using "noresponse"


Author
Message
KatrinaMcDonough
KatrinaMcDonough
Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)
Group: Forum Members
Posts: 20, Visits: 74
Hello, 
I am trying to program a conditional statement for the correct response value, so that participants with odd and even subject numbers have different tasks - either press the spacebar or don't respond. However, the I get a message saying "'noresponse' Expression contains an unknown element or property name." It works when I select a different response (i.e. changing "noresponse" to just a different key). 


<shape redcircle>
/ shape = circle
/ color = red
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

<shape bluecircle>
/ shape = circle
/ color = blue
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

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

<text correctmessage>
/ items = ("correct")
</text>

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {noresponse;}
</expressions>

<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, noresponse)
/ correctresponse = (expressions.CorrectCounterbalanced1)
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

<block block>
/ trials = [1-5=circles]
</block>
Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
KatrinaMcDonough - 8/4/2020
Hello, 
I am trying to program a conditional statement for the correct response value, so that participants with odd and even subject numbers have different tasks - either press the spacebar or don't respond. However, the I get a message saying "'noresponse' Expression contains an unknown element or property name." It works when I select a different response (i.e. changing "noresponse" to just a different key). 


<shape redcircle>
/ shape = circle
/ color = red
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

<shape bluecircle>
/ shape = circle
/ color = blue
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

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

<text correctmessage>
/ items = ("correct")
</text>

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {noresponse;}
</expressions>

<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, noresponse)
/ correctresponse = (expressions.CorrectCounterbalanced1)
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

<block block>
/ trials = [1-5=circles]
</block>

0 is the proper indicator for no response. I.e.

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {0;}
</expressions>
KatrinaMcDonough
KatrinaMcDonough
Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)
Group: Forum Members
Posts: 20, Visits: 74
Dave - 8/4/2020
KatrinaMcDonough - 8/4/2020
Hello, 
I am trying to program a conditional statement for the correct response value, so that participants with odd and even subject numbers have different tasks - either press the spacebar or don't respond. However, the I get a message saying "'noresponse' Expression contains an unknown element or property name." It works when I select a different response (i.e. changing "noresponse" to just a different key). 


<shape redcircle>
/ shape = circle
/ color = red
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

<shape bluecircle>
/ shape = circle
/ color = blue
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

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

<text correctmessage>
/ items = ("correct")
</text>

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {noresponse;}
</expressions>

<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, noresponse)
/ correctresponse = (expressions.CorrectCounterbalanced1)
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

<block block>
/ trials = [1-5=circles]
</block>

0 is the proper indicator for no response. I.e.

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {0;}
</expressions>

Thank you. I have tried this, but it still says the response (or lack of in this case) is incorrect. i.e. when I am subject 2 and I do not respond, it shows the error message.
Dave
Dave
Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)Supreme Being (855K reputation)
Group: Administrators
Posts: 10K, Visits: 59K
KatrinaMcDonough - 8/4/2020
Dave - 8/4/2020
KatrinaMcDonough - 8/4/2020
Hello, 
I am trying to program a conditional statement for the correct response value, so that participants with odd and even subject numbers have different tasks - either press the spacebar or don't respond. However, the I get a message saying "'noresponse' Expression contains an unknown element or property name." It works when I select a different response (i.e. changing "noresponse" to just a different key). 


<shape redcircle>
/ shape = circle
/ color = red
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

<shape bluecircle>
/ shape = circle
/ color = blue
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

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

<text correctmessage>
/ items = ("correct")
</text>

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {noresponse;}
</expressions>

<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, noresponse)
/ correctresponse = (expressions.CorrectCounterbalanced1)
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

<block block>
/ trials = [1-5=circles]
</block>

0 is the proper indicator for no response. I.e.

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {0;}
</expressions>

Thank you. I have tried this, but it still says the response (or lack of in this case) is incorrect. i.e. when I am subject 2 and I do not respond, it shows the error message.

You need to use /iscorrectresponse in your <trial>, not /correctresponse:


<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, 0)
/ iscorrectresponse = [trial.circles.response == expressions.CorrectCounterbalanced1]
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>
KatrinaMcDonough
KatrinaMcDonough
Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)Associate Member (58 reputation)
Group: Forum Members
Posts: 20, Visits: 74
Dave - 8/4/2020
KatrinaMcDonough - 8/4/2020
Dave - 8/4/2020
KatrinaMcDonough - 8/4/2020
Hello, 
I am trying to program a conditional statement for the correct response value, so that participants with odd and even subject numbers have different tasks - either press the spacebar or don't respond. However, the I get a message saying "'noresponse' Expression contains an unknown element or property name." It works when I select a different response (i.e. changing "noresponse" to just a different key). 


<shape redcircle>
/ shape = circle
/ color = red
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

<shape bluecircle>
/ shape = circle
/ color = blue
/ size = (20%, 20%)
/ position = (50%, 50%)
</shape>

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

<text correctmessage>
/ items = ("correct")
</text>

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {noresponse;}
</expressions>

<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, noresponse)
/ correctresponse = (expressions.CorrectCounterbalanced1)
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

<block block>
/ trials = [1-5=circles]
</block>

0 is the proper indicator for no response. I.e.

<expressions>
/CorrectCounterbalanced1 = if ( floor(mod(script.subjectid, 2)) != 0 ) {57;} else {0;}
</expressions>

Thank you. I have tried this, but it still says the response (or lack of in this case) is incorrect. i.e. when I am subject 2 and I do not respond, it shows the error message.

You need to use /iscorrectresponse in your <trial>, not /correctresponse:


<trial circles>
/ stimulusframes = [1 = redcircle]
/ inputdevice = keyboard
/ validresponse = (57, 0)
/ iscorrectresponse = [trial.circles.response == expressions.CorrectCounterbalanced1]
/ trialduration = 2000
/ errormessage = true(errormessage, 2000)
/ correctmessage = true(correctmessage, 2000)
</trial>

Problem solved! Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search