﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 4  » iscorrectresponse gets evaluated even if response was not valid</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 26 Sep 2026 11:57:32 GMT</lastBuildDate><ttl>20</ttl><item><title>iscorrectresponse gets evaluated even if response was not valid</title><link>https://forums.millisecond.com/Topic16553.aspx</link><description>Hi All,&lt;br/&gt;&lt;br/&gt;I have defined a trial in which certain probe stimuli are shown and the observer has to click on a specific one of those stimuli (i.e., inputdevice = mouse). All stimuli are presented in front of a screen-wide background stimulus covering the complete display area. This background stimulus is not contained in the /validresponse property.&lt;br/&gt;&lt;br/&gt;The names of the actual probe stimuli all contain a trailing index number so that I should be able to do this:&lt;br/&gt;&lt;br/&gt;[code]/ iscorrectresponse = [evaluate(substring(trial.trialname.response,5,1)) == 5][/code]&lt;br/&gt;&lt;br/&gt;What I'd expect to happen is that the /iscorrectresponse property is only invoked when the observer clicks on one of the valid stimuli. It shall not be invoked if the observer clicks somewhere in the background.&lt;br/&gt;&lt;br/&gt;This is not what happens. The /iscorrectresponse property is invoked every time the observer clicks anywhere. Hence, the code produces expression errors whenever the background stimulus - the name of which does not end with a number - is clicked.&lt;br/&gt;&lt;br/&gt;Is that supposed to happen?</description><pubDate>Fri, 26 Jun 2015 08:58:52 GMT</pubDate><dc:creator>Blackadder</dc:creator></item><item><title>RE: iscorrectresponse gets evaluated even if response was not valid</title><link>https://forums.millisecond.com/Topic16599.aspx</link><description>Dear Dave,&lt;br/&gt;&lt;br/&gt;your code is spot-on. I'm going to compare our code to yours and post the result here.&lt;br/&gt;&lt;br/&gt;Bye, Malte&lt;br/&gt;</description><pubDate>Fri, 26 Jun 2015 08:58:52 GMT</pubDate><dc:creator>Blackadder</dc:creator></item><item><title>RE: iscorrectresponse gets evaluated even if response was not valid</title><link>https://forums.millisecond.com/Topic16560.aspx</link><description>Based on your description, I assume you do something along the lines of (greatly simplified)&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-4=trialname]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial trialname&amp;gt;&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulusframes = [1=background, stim15, stim14]&lt;br/&gt;/ validresponse = (stim15, stim14)&lt;br/&gt;/ iscorrectresponse = [substring(trial.trialname.response,5,1) == "5"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape background&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;/ color = (blue)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text stim15&amp;gt;&lt;br/&gt;/ items = ("A")&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text stim14&amp;gt;&lt;br/&gt;/ items = ("B")&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;With the above I am unable to reproduce the issue you observed. The background stimulus is not accepted as response and the /iscorrectresponse evaluation works as expected.&lt;br/&gt;&lt;br/&gt;I suspect there is something about your setup that I'm missing; what that is, I unfortunately have no idea.&lt;br/&gt;</description><pubDate>Mon, 22 Jun 2015 04:13:38 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>