﻿<?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  » How can I count trials with correct response?</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 21 Sep 2026 08:01:10 GMT</lastBuildDate><ttl>20</ttl><item><title>How can I count trials with correct response?</title><link>https://forums.millisecond.com/Topic16561.aspx</link><description>Hi, my question is above. My script doesn't count success trials properly. I used command listed below, it was my own invention since I couldn't find one in the instruction.&lt;br/&gt;&lt;br/&gt;F7 doesn't report an error, but it has to be some mistake there. Could you help me?&lt;br/&gt;&lt;br/&gt;***&lt;br/&gt;&amp;lt;trial maintrialhard&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.currentdigit=counter.randomdigit.selectedvalue]&lt;br/&gt;/ ontrialbegin = [values.counttrialsbeforemanip += 1]&lt;br/&gt;/ ontrialend = [values.lastresponse=trial.maintrialhard.response]&lt;br/&gt;&lt;strong&gt;/ ontrialend = [if (trial.maintrialhard == correct) values.correctbefore += 1]&lt;/strong&gt;&lt;br/&gt;/ stimulusframes = [1=mask; 30=mydigit; 32=mask; 62=instructionrepeat]&lt;br/&gt;/ validresponse = (2,3,4,5,6,7,8)&lt;br/&gt;/ iscorrectresponse = [trial.maintrialhard.response==values.currentdigit+1]&lt;br/&gt;/ branch = [if (contains(values.allowablekeys, values.lastresponse)==false) trial.repeattrialhard]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;***</description><pubDate>Mon, 22 Jun 2015 06:53:18 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: How can I count trials with correct response?</title><link>https://forums.millisecond.com/Topic16562.aspx</link><description>&lt;strong&gt;/ ontrialend = [if (trial.maintrialhard == correct) values.correctbefore += 1]&lt;br/&gt;&lt;/strong&gt;&lt;br/&gt;is invalid syntax and ought to read&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;/ ontrialend = [if (trial.maintrialhard.correct == true) values.correctbefore += 1]&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;or, even shorter&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;/ ontrialend = [if (trial.maintrialhard.correct) values.correctbefore += 1]&lt;br/&gt;&lt;br/&gt;&lt;/strong&gt;See the documentation for the &amp;lt;trial&amp;gt; element's 'correct' property for details.&lt;br/&gt;</description><pubDate>Mon, 22 Jun 2015 06:53:18 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>