﻿<?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  » Tick or text box in a trial</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 16 Sep 2026 15:38:35 GMT</lastBuildDate><ttl>20</ttl><item><title>Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18858.aspx</link><description>I have a set of tasks where people need to choose between options, but on each trial they can tick a box to make the choice count for real or not. It looks like checkbox and dropdown can only be used in surveys not trials and I dont see how to make a trial like i need as a surveypage (see below, maybe its not possible). Any ideas on something I could use that would function like a tickbox within a trial?&lt;br/&gt;&lt;br/&gt;&amp;lt;trial twopzero&amp;gt;&lt;br/&gt;/ stimulusframes = [1=  intaskzero, LabelAa, LabelBa,  quitwithoutpay]&lt;br/&gt;/ validresponse = (LabelAa, LabelBa, quitwithoutpay)&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ ontrialend = [values.choice += 1]&lt;br/&gt;/ ontrialbegin = [values.gamble = 1; values.prob = rand(1,100);]&lt;br/&gt;/ ontrialend = [if(trial.twopzero.response == "quitwithoutpay") script.abort();]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelA" &amp;amp;&amp;amp; values.side &amp;lt;= 50 &amp;amp;&amp;amp; values.prob &amp;lt;= 33) {values.outcome=(53); values.spicked = 0; values.picked = 1; text.o1a.item.1 = "53 pts";}]&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelA" &amp;amp;&amp;amp; values.side &amp;lt;= 50 &amp;amp;&amp;amp; values.prob &amp;gt; 33) {values.outcome=(27); values.spicked = 0; values.picked = 1; text.o1a.item.1 = "27 pts";}]&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelB" &amp;amp;&amp;amp; values.side &amp;gt; 50 &amp;amp;&amp;amp; values.prob &amp;lt;= 33) {values.outcome=(53); values.spicked = 1; values.picked = 1; text.o2a.item.1 = "53 pts";}]&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelB" &amp;amp;&amp;amp; values.side &amp;gt; 50 &amp;amp;&amp;amp; values.prob &amp;gt; 33) {values.outcome=(27); values.spicked = 1; values.picked = 1; text.o2a.item.1 = "27 pts";}]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelA" &amp;amp;&amp;amp; values.side &amp;gt; 50)  {values.outcome=(0); values.spicked = 0; values.picked = 0; text.o1a.item.1 = "0 pts";}]&lt;br/&gt;/ ontrialend = [ if (trial.twopzero.response == "LabelB" &amp;amp;&amp;amp; values.side &amp;lt;= 50) {values.outcome=(0); values.spicked = 1; values.picked = 0; text.o2a.item.1 = "0 pts";}]&lt;br/&gt;/ ontrialend = [values.tots += values.outcome]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;</description><pubDate>Tue, 12 Apr 2016 08:21:58 GMT</pubDate><dc:creator>nashby</dc:creator></item><item><title>RE: Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18891.aspx</link><description>/ontrialend attributes are executed *after* correct response evaluation (via /iscorrectresponse or otherwise).&lt;br/&gt;&lt;br/&gt;I.e.,&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&lt;br/&gt;/ &lt;strong&gt;ontrialend &lt;/strong&gt;= [ if(trial.getresponses2pengage.response == "LabelAa" &amp;amp;&amp;amp; values.prob &amp;lt;= 33) {values.outcome=(53); values.spicked = 0; values.picked = 1; text.o1a.item.1 = "53 pts";&lt;strong&gt; values.choicemade = 1&lt;/strong&gt;;}]&lt;br/&gt;/ &lt;strong&gt;ontrialend &lt;/strong&gt;= [ if(trial.getresponses2pengage.response == "LabelAa" &amp;amp;&amp;amp; values.prob &amp;gt; 33) {values.outcome=(27); values.spicked = 0; values.picked = 1;  text.o1a.item.1 = "27 pts";&lt;strong&gt;values.choicemade = 1&lt;/strong&gt;;}]&lt;br/&gt;&lt;br/&gt;values.choicemade is *still zero* at the point &lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [ values.choicemade ;]&lt;br/&gt;&lt;br/&gt;is evaluated.&lt;br/&gt;&lt;br/&gt;Hence the response counts as *not correct* and the /branch &lt;br/&gt;&lt;br/&gt;/ branch = [if (!trial.getresponses2pengage.correct) trial.getresponses2pengage]&lt;br/&gt;&lt;br/&gt;applies: another instance of trial.getresponses2pengage is called.&lt;br/&gt;&lt;br/&gt;You should be able to simply change the /branch to&lt;br/&gt;&lt;br/&gt;/ branch = [if (values.choicemade==0) trial.getresponses2pengage]&lt;br/&gt;&lt;br/&gt;to avoid that. /branch attributes are executed *after* /ontrialend attributes.&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 12 Apr 2016 08:21:58 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18889.aspx</link><description>Hey Dave thanks for this. I have tried to get it to be more in line with what i need - the participants need to be able to decide to make the choice for real or not or simply let it carry over from their previous trial. I cant have a submit button, the trial must end when one of the buttons is clicked. So i built the following, which seems to work, but it leads to repeating trials for some reason (two choice 1s, two choice 2s, etc...)&lt;br/&gt;&amp;nbsp;&lt;br/&gt;(can post full experiment code if that would help let me know)&lt;br/&gt;&lt;br/&gt;&amp;lt;trial setup2pengage&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.gamble = 1; values.condition = 0; values.prob = rand(1,100); values.choicemade = 0;]&lt;br/&gt;/ trialduration = 0&lt;br/&gt;/ branch = [trial.getresponses2pengage]&lt;br/&gt;/ ontrialend = [values.choice += 1;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial getresponses2pengage&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;/ ontrialend = [ if(trial.getresponses2pengage.response == "LabelAa" &amp;amp;&amp;amp; values.prob &amp;lt;= 33) {values.outcome=(53); values.spicked = 0; values.picked = 1; text.o1a.item.1 = "53 pts"; values.choicemade = 1;}]&lt;br/&gt;/ ontrialend = [ if(trial.getresponses2pengage.response == "LabelAa" &amp;amp;&amp;amp; values.prob &amp;gt; 33) {values.outcome=(27); values.spicked = 0; values.picked = 1;  text.o1a.item.1 = "27 pts";values.choicemade = 1;}]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (trial.getresponses2pengage.response == "no") {text.yes.textbgcolor = grey; text.no.textbgcolor = yellow; values.real = 0; }; ]&lt;br/&gt;/ ontrialend = [if (trial.getresponses2pengage.response == "yes") {text.yes.textbgcolor = yellow; text.no.textbgcolor = grey; values.real = 1; }; ]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if(trial.getresponses2pengage.response == "quitwithoutpay") script.abort();]&lt;br/&gt;/ ontrialend = [ if(values.real == 1) {values.tots += values.outcome}]&lt;br/&gt;&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulusframes = [1=  intaskengage, LabelAa,o1a , yes, no, quitwithoutpay]&lt;br/&gt;/ validresponse = (Labelaa, yes, no, quitwithoutpay )&lt;br/&gt;/ iscorrectresponse = [ values.choicemade ;]&lt;br/&gt;/ branch = [if (!trial.getresponses2pengage.correct) trial.getresponses2pengage]&lt;br/&gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 12 Apr 2016 08:07:40 GMT</pubDate><dc:creator>nashby</dc:creator></item><item><title>RE: Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18867.aspx</link><description>You need &lt;br/&gt;&lt;br/&gt;(1) A dummy-trial that sets up the round parameters so they remain unchanged for the entire round:&lt;br/&gt;(2) A trial that you run repeatedly, which collects the required responses (the actual choice and (dis)confirmation), and allows subjects to "submit" their selections once they've locked it all in.&lt;br/&gt;&lt;br/&gt;In a nutshell, you do something like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ leftchoice = 0&lt;br/&gt;/ rightchoice = 0&lt;br/&gt;/ choicemade = 0&lt;br/&gt;/ affirmationmade = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-4 = setup]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial setup&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.leftchoice = round(rand(5,100)); values.rightchoice = 3;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.affirmationmade = 0; values.choicemade = 0; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.left.textbgcolor = white; text.right.textbgcolor = white;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.yes.textbgcolor = white; text.no.textbgcolor = white; ]&lt;br/&gt;/ trialduration = 0&lt;br/&gt;/ branch = [trial.getresponses]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial getresponses&amp;gt;&lt;br/&gt;/ ontrialend = [if (trial.getresponses.response == "left") {text.left.textbgcolor = green; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.right.textbgcolor = white; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.choicemade = 1; }; ]&lt;br/&gt;/ ontrialend = [if (trial.getresponses.response == "right") {text.left.textbgcolor = white; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.right.textbgcolor = green; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.choicemade = 1; }; ]&lt;br/&gt;/ ontrialend = [if (trial.getresponses.response == "yes") {text.yes.textbgcolor = green; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.no.textbgcolor = white; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.affirmationmade = 1; }; ]&lt;br/&gt;/ ontrialend = [if (trial.getresponses.response == "no") {text.yes.textbgcolor = white; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.no.textbgcolor = green; &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.affirmationmade = 1; }; ]&lt;br/&gt;/ stimulusframes = [1=left, right, yes, no, submit]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (left, right, yes, no, submit)&lt;br/&gt;/ iscorrectresponse = [trial.getresponses.response == "submit" &amp;amp;&amp;amp; values.choicemade &amp;amp;&amp;amp; values.affirmationmade]&lt;br/&gt;/ branch = [if (!trial.getresponses.correct) trial.getresponses]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text left&amp;gt;&lt;br/&gt;/ items = ("Win &amp;lt;%values.leftchoice%&amp;gt;")&lt;br/&gt;/ position = (40%, 50%)&lt;br/&gt;/ size = (10%, 3%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text right&amp;gt;&lt;br/&gt;/ items = ("Win &amp;lt;%values.rightchoice%&amp;gt;")&lt;br/&gt;/ position = (60%, 50%)&lt;br/&gt;/ size = (10%, 3%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text yes&amp;gt;&lt;br/&gt;/ items = ("For real")&lt;br/&gt;/ position = (40%, 70%)&lt;br/&gt;/ size = (10%, 3%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text no&amp;gt;&lt;br/&gt;/ items = ("Not for real")&lt;br/&gt;/ position = (60%, 70%)&lt;br/&gt;/ size = (10%, 3%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text submit&amp;gt;&lt;br/&gt;/ items = ("SUBMIT")&lt;br/&gt;/ position = (50%, 90%)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 11 Apr 2016 06:58:53 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18860.aspx</link><description>Thanks Dave. The problem is I have to have it all on one page. That is they can tick/untick the box &amp;nbsp;to make it consequential or not then make a choice all on the same screen. We are trying to replicate a previous study so we cannot deviate from the design unfortunately. Any ideas on how to build a tick like box in a trial?</description><pubDate>Mon, 11 Apr 2016 00:04:19 GMT</pubDate><dc:creator>nashby</dc:creator></item><item><title>RE: Tick or text box in a trial</title><link>https://forums.millisecond.com/Topic18859.aspx</link><description>&amp;lt;checkboxes&amp;gt; and the like (&amp;lt;dropdown&amp;gt;, etc.) can only be used with &amp;lt;surveypage&amp;gt;s. A &amp;lt;surveypage&amp;gt;, however, *is* a kind of &amp;lt;trial&amp;gt;. A &amp;lt;survey&amp;gt; element (which is a special kind of &amp;lt;block&amp;gt; is not necessary to use &amp;lt;surveypage&amp;gt;s. You can use and run &amp;lt;surveypage&amp;gt;s in regular &amp;lt;block&amp;gt;s along with regular &amp;lt;trial&amp;gt;s, i.e. you can run them via the &amp;lt;block&amp;gt;s /trials attribute, /branch to them from &amp;lt;trial&amp;gt; elements, etc.&lt;br/&gt;&lt;br/&gt;You can also use a regular &amp;lt;trial&amp;gt; along with &amp;lt;text&amp;gt;, etc. elements to build something like a checkbox.&lt;br/&gt;&lt;br/&gt;At any rate, you essentially want to collect two different responses and thus probably need two separate trial-type elements to implement this:&lt;br/&gt;&lt;br/&gt;(A) The &amp;lt;trial&amp;gt; you already have can collect the initial response / choice. From there you'd /branch to &lt;br/&gt;(B) Another &amp;lt;trial&amp;gt; (or &amp;lt;surveypage&amp;gt;) that collects the response indicating whether the response is to be considered for real or not.&lt;br/&gt;&lt;br/&gt;(I'm not sure about the order; you might want to have people indicate (B) first; however, the same approach applies if the order is reversed.)&lt;br/&gt;</description><pubDate>Sun, 10 Apr 2016 19:52:44 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>