﻿<?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 3  » Problems with the if statement</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 12:38:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Problems with the if statement</title><link>https://forums.millisecond.com/Topic9923.aspx</link><description>&lt;p&gt;Well, as you can see, you can do this rather straightforwardly by modifying the code I posted to:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;block myblock&amp;gt;&lt;br /&gt;/ trials = [1=mypage]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage mypage&amp;gt;&lt;br /&gt;/ questions = [1=q1; 2=q2]&lt;br /&gt;/ branch = [if (radiobuttons.q1.response=="H_AB"&amp;nbsp; &amp;amp;&amp;amp; radiobuttons.q2.response=="H") surveypage.ab]&lt;br /&gt;/ branch = [if (radiobuttons.q1.response=="H_AB"&amp;nbsp; &amp;amp;&amp;amp; radiobuttons.q2.response=="T") surveypage.cd]&lt;br /&gt;/ branch = [if (radiobuttons.q1.response=="H_CD"&amp;nbsp; &amp;amp;&amp;amp; radiobuttons.q2.response=="H") surveypage.cd]&lt;br /&gt;/ branch = [if (radiobuttons.q1.response=="H_CD"&amp;nbsp; &amp;amp;&amp;amp; radiobuttons.q2.response=="T") surveypage.ab]&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;radiobuttons q1&amp;gt;&lt;br /&gt;/ options = ("Heads = A and B, Tails = C and D", "Heads = C and D, Tails = A and B")&lt;br /&gt;/ optionvalues = ("H_AB", "H_CD")&lt;br /&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;radiobuttons q2&amp;gt;&lt;br /&gt;/ options = ("Heads", "Tails")&lt;br /&gt;/ optionvalues = ("H", "T")&lt;br /&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage ab&amp;gt;&lt;br /&gt;/caption = "This means from now on you can only chose between the decks A and B."&lt;br /&gt;/ questions = [1=repeat]&lt;br /&gt;/ branch = [if (dropdown.repeat.response=="Yes") surveypage.mypage]&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage cd&amp;gt;&lt;br /&gt;/caption = "This means from now on you can only chose between the decks C and D."&lt;br /&gt;/ questions = [1=repeat]&lt;br /&gt;/ branch = [if (dropdown.repeat.response=="Yes") surveypage.mypage]&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dropdown repeat&amp;gt;&lt;br /&gt;/ caption = "Repeat?"&lt;br /&gt;/ options = ("Yes", "No")&lt;br /&gt;&amp;lt;/dropdown&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please work through this until you fully understand it. Then adapt it to your own needs.&lt;/p&gt;</description><pubDate>Tue, 12 Mar 2013 06:51:43 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Problems with the if statement</title><link>https://forums.millisecond.com/Topic9914.aspx</link><description>&lt;p&gt;I could solve the second problem (thank you so much for that :)), but still not the first one...&lt;/p&gt;
&lt;p&gt;It always shows the "from now on you have to choose fromt he decks c or d" but not the other version (decks a or b).&amp;nbsp;&lt;/p&gt;

&lt;p&gt;1. people have to chose, what heads or tail stands for:&lt;/p&gt;
&lt;p&gt;option1: "Heads stands for decks A and B and tails stands for decks C and D"&lt;/p&gt;
&lt;p&gt;option2: "Heads stands for decks C and D and tails stands for decks A and B"&lt;/p&gt;

&lt;p&gt;2. people have to toss the coin and tell what it showed:&lt;/p&gt;
&lt;p&gt;option1: "Heads"&lt;/p&gt;
&lt;p&gt;option2: "Tails"&lt;/p&gt;

&lt;p&gt;and here's the thing now:&lt;/p&gt;
&lt;p&gt;If they chose&lt;strong&gt;&amp;nbsp;"Heads stands for decks A and B and tails stands for decks C and D" &lt;/strong&gt;and the coin showed &lt;b&gt;"Heads"&lt;/b&gt;&amp;nbsp;than case1 should be shown:&lt;/p&gt;
&lt;p&gt;&amp;lt;surveypage case1&amp;gt;&lt;/p&gt;
&lt;p&gt;/caption = "This means from now on you can only chose between the decks A and B"&lt;/p&gt;
&lt;p&gt;&amp;lt;/surveypage&amp;gt;&lt;/p&gt;
&lt;p&gt;case1 sould also be shown if they chose &lt;b&gt;"Heads stands for decks C and D and tails stands for decks A and B"&amp;nbsp;&lt;/b&gt;and the coin showed &lt;b&gt;"Tails"&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;If they chose&amp;nbsp;&lt;span&gt;&lt;b&gt;"Heads stands for decks A and B and tails stands for decks C and D"&lt;/b&gt;&lt;/span&gt;&amp;nbsp;and the coin showed&amp;nbsp;&lt;b&gt;"Tails"&lt;/b&gt;&amp;nbsp;than case 2 should be shown:&lt;/p&gt;
&lt;p&gt;&amp;lt;surveypage case2&amp;gt;&lt;/p&gt;
&lt;p&gt;/caption = "This means from now on you can only chose between the decks C and D"&lt;/p&gt;
&lt;p&gt;&amp;lt;/surveypage&amp;gt;&lt;/p&gt;
&lt;p&gt;case2 should also be shown if they chose&amp;nbsp;&lt;b&gt;"Heads stands for decks C and D and tails stands for decks A and B"&lt;/b&gt;&amp;nbsp;and the coin showed&amp;nbsp;&lt;b&gt;"Heads"&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;And additionally:&lt;/p&gt;
&lt;p&gt;After they saw that they are asked whether or not they want to toss the coin again. If they answer "Yes" the whole thing is going on again.&lt;/p&gt;
&lt;p&gt;Any ideas...?&lt;/p&gt;

&lt;p&gt;Thank you :)&lt;/p&gt;</description><pubDate>Tue, 12 Mar 2013 03:03:30 GMT</pubDate><dc:creator>beccca</dc:creator></item><item><title>RE: Problems with the if statement</title><link>https://forums.millisecond.com/Topic9902.aspx</link><description>&lt;p&gt;[quote]&lt;/p&gt;
&lt;p&gt;1. Problem:&lt;/p&gt;
&lt;p&gt;I have for conditions:&lt;/p&gt;
&lt;p&gt;- c1: Subject chose A in question1 and A in question2&lt;/p&gt;
&lt;p&gt;- &amp;nbsp;c2: Subject chose A in question1 and B in question2&lt;/p&gt;
&lt;p&gt;- c3: Subject chose B in question1 and A in question2&lt;/p&gt;
&lt;p&gt;- c4: Subject chose B in question1 and B in question2&lt;/p&gt;

&lt;p&gt;After the subject answered the first two questions I want to show a specific sentence depending on what the subject answered.&lt;/p&gt;
&lt;p&gt;--&amp;gt; c1: 'You chose A and A which means you can now play with the decks A and B'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c2: 'You chose A and B which means you can now play with the decks C and D'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c3: 'You chose B and A which means you can now play with the decks C and D'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c4: 'You chose B and B which means you can now play with the decks A and B'&lt;/p&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;&amp;lt;block myblock&amp;gt;&lt;br /&gt;/ trials = [1=mypage]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage mypage&amp;gt;&lt;br /&gt;/ questions = [1=q1; 2=q2]&lt;br /&gt;/ branch = [if (radiobuttons.q1.response==radiobuttons.q2.response) surveypage.ab else surveypage.cd]&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;radiobuttons q1&amp;gt;&lt;br /&gt;/ options = ("A", "B")&lt;br /&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;radiobuttons q2&amp;gt;&lt;br /&gt;/ options = ("A", "B")&lt;br /&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage ab&amp;gt;&lt;br /&gt;/ caption = "'You chose &amp;lt;%radiobuttons.q1.response%&amp;gt; and &amp;lt;%radiobuttons.q2.response%&amp;gt; which means you can now play with the decks A and B."&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;surveypage cd&amp;gt;&lt;br /&gt;/ caption = "'You chose &amp;lt;%radiobuttons.q1.response%&amp;gt; and &amp;lt;%radiobuttons.q2.response%&amp;gt; which means you can now play with the decks C and D."&lt;br /&gt;&amp;lt;/surveypage&amp;gt;&lt;/p&gt;
&lt;p&gt;[quote]&lt;/p&gt;
&lt;p&gt;2. Problem&lt;/p&gt;
&lt;p&gt;Is pretty similia to the first one (also with if statements)&lt;/p&gt;
&lt;p&gt;I want to filter the subjects depending on the answer they gave to a specific question.&lt;/p&gt;
&lt;p&gt;[/quote]&lt;/p&gt;
&lt;p&gt;See the examples at http://www.millisecond.com/forums/Topic5461.aspx#5461&lt;/p&gt;
</description><pubDate>Mon, 11 Mar 2013 10:41:42 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>Problems with the if statement</title><link>https://forums.millisecond.com/Topic9901.aspx</link><description>&lt;p&gt;Hello everyone&lt;/p&gt;
&lt;p&gt;I'm pretty new in the whole coding thing and I have a problem. Actually two problems..&lt;/p&gt;
&lt;p&gt;Background:&lt;/p&gt;
&lt;p&gt;People have 4 decks with cards. They chose cards and can either win or lose some money (Iowa Gambling Task; IGT)&lt;/p&gt;
&lt;p&gt;After they played the IGT they are asked to toss a coin. In question1 they have to specify if head is deck A and B and tail is deck C and D or the other wayaround (head = C and D; tail = A and B)&lt;/p&gt;
&lt;p&gt;Question2 then asks whether heads or tail was shown.&lt;/p&gt;

&lt;p&gt;1. Problem:&lt;/p&gt;
&lt;p&gt;I have for conditions:&lt;/p&gt;
&lt;p&gt;- c1: Subject chose A in question1 and A in question2&lt;/p&gt;
&lt;p&gt;- &amp;nbsp;c2: Subject chose A in question1 and B in question2&lt;/p&gt;
&lt;p&gt;- c3: Subject chose B in question1 and A in question2&lt;/p&gt;
&lt;p&gt;- c4: Subject chose B in question1 and B in question2&lt;/p&gt;

&lt;p&gt;After the subject answered the first two questions I want to show a specific sentence depending on what the subject answered.&lt;/p&gt;
&lt;p&gt;--&amp;gt; c1: 'You chose A and A which means you can now play with the decks A and B'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c2: 'You chose A and B which means you can now play with the decks C and D'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c3: 'You chose B and A which means you can now play with the decks C and D'&lt;/p&gt;
&lt;p&gt;--&amp;gt; c4: 'You chose B and B which means you can now play with the decks A and B'&lt;/p&gt;

&lt;p&gt;But I don't know how to do that. I tried so many things but I could get the whole thing to run correctly... I tried it with the /branch attribute and if-statements.&lt;/p&gt;
&lt;p&gt;I tried to create a string variable and show the sentence with &amp;lt;% item.sentence.item %&amp;gt; depending on what the subject answered (if (radiobuttons.question1.response == "A") &amp;lt;% item.sentence.item %&amp;gt; (I tried this in like 100 different ways; I also tried text.sentence.text) but the /branch attribute doesn't accept &amp;lt;% %&amp;gt;.&lt;/p&gt;
&lt;p&gt;after that I tried to use a variable which tried to specify it depending on the answers and than post the variable with the &amp;lt;%%&amp;gt;. Did'nt work either.&lt;/p&gt;
&lt;p&gt;Does anyone have an idea how I could do it?&lt;/p&gt;

&lt;p&gt;2. Problem&lt;/p&gt;
&lt;p&gt;Is pretty similia to the first one (also with if statements)&lt;/p&gt;
&lt;p&gt;I want to filter the subjects depending on the answer they gave to a specific question.&lt;/p&gt;
&lt;p&gt;If a subject said YES to the answer then he/she has to answer the questions on surveypage 6.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If a ssubject said NO to the answer then he/she can directly go to surveypage 9.&lt;/p&gt;
&lt;p&gt;I tried to do it like that:&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;lt;survey coininstruction&amp;gt;&lt;/p&gt;
&lt;p&gt;/ pages = [1=coininstruction; 2=coindecision; 3=zufallpage; 4=sicherheit; 5=neu; 6=coininstruction_neu; 7=coindecision2; 8=zufallpage2; 9=defdecision; 10=entscheidung]&lt;/p&gt;
&lt;p&gt;/ responsefontstyle = ("Arial", 1.75%)&lt;/p&gt;
&lt;p&gt;/ itemfontstyle = ("Arial", 1.75%)&lt;/p&gt;
&lt;p&gt;/ itemspacing = 2%&lt;/p&gt;
&lt;p&gt;/ showpagenumbers = false&lt;/p&gt;
&lt;p&gt;/ showbackbutton = false&lt;/p&gt;
&lt;p&gt;/ finishlabel = "NEXT"&lt;/p&gt;
&lt;p&gt;/ showquestionnumbers = false&lt;/p&gt;
&lt;p&gt;/ branch = [if (radiobuttons.neu.response == "No") surveypage.defdecision]&lt;/p&gt;
&lt;p&gt;&amp;lt;/survey&amp;gt;&lt;/p&gt;
&lt;div&gt;But, again, it does not work like that. I don't even get an errormessage. Inquisit just totally ignores it.&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;Thank you for any ideas you guys have :)&lt;/p&gt;</description><pubDate>Mon, 11 Mar 2013 10:27:41 GMT</pubDate><dc:creator>beccca</dc:creator></item></channel></rss>