﻿<?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 5  » Using "if statements" to display certain "expressions" in the instructions (DeathSuicide IAT)</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 06 Apr 2026 14:45:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Using "if statements" to display certain "expressions" in the instructions (DeathSuicide IAT)</title><link>https://forums.millisecond.com/Topic18772.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;I would like words to change in the instructions dependent on which group the subject is in.&amp;nbsp; I think this looks correct based on other code I've found, but I get an error message: "Expression 'groupnumber' is invalid.&amp;nbsp; Expression contains an unknown element or property name."&lt;br/&gt;&lt;br/&gt;I've tried lots of variants according to other "group" type words I've found in the text, but I can't get any to work.&lt;br/&gt;&lt;br/&gt;I've also tried to display the words dependent on the block that is being presented, but that didn't work, either.&amp;nbsp; Code below (shortened the "instructions" section by a few blocks).&lt;br/&gt;&lt;br/&gt;&amp;lt;item instructions&amp;gt;&lt;br/&gt;/ 1 =&amp;nbsp; "&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Block 1 of 7&lt;br/&gt;&lt;br/&gt;During this part of the task, tap the (E) key for &amp;lt;%expressions.grouponedeath%&amp;gt; related words.&amp;nbsp; Tap the (I) key for &amp;lt;%expressions.grouponelife%&amp;gt; related words.&lt;br/&gt;&lt;br/&gt;If you make a mistake, a red 'X' will appear.&amp;nbsp; Tap the other key to continue.&lt;br/&gt;&lt;br/&gt;GO AS FAST AS YOU CAN while making as few mistakes as possible."&lt;br/&gt;&lt;br/&gt;/ 2 =&amp;nbsp; "&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Block 2 of 7&lt;br/&gt;&lt;br/&gt;During this part of the task, tap the (E) key for NOT ME related words.&amp;nbsp; Tap the (I) key for ME related words.&lt;br/&gt;&lt;br/&gt;If you make a mistake, a red 'X' will appear.&amp;nbsp; Tap the other key to continue.&lt;br/&gt;&lt;br/&gt;GO AS FAST AS YOU CAN while making as few mistakes as possible."&lt;br/&gt;&lt;br/&gt;/ 3 =&amp;nbsp; "&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Block 3 of 7&lt;br/&gt;&lt;br/&gt;During this part of the task, tap the (E) key for &amp;lt;%expressions.grouponedeath%&amp;gt; and for NOT ME related words.&amp;nbsp; Tap the (I) key for &amp;lt;%expressions.grouponelife%&amp;gt; and for ME related words.&lt;br/&gt;&lt;br/&gt;If you make a mistake, a red 'X' will appear.&amp;nbsp; Tap the other side of the screen to continue.&lt;br/&gt;&lt;br/&gt;GO AS FAST AS YOU CAN while making as few mistakes as possible."&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;****************************************************************************************************&lt;br/&gt;general instruction expressions: adjust the instruction text depending on the subject's group&lt;br/&gt;****************************************************************************************************&lt;br/&gt;&amp;lt;expressions&amp;gt;&lt;br/&gt;/grouponedeath = if (groupnumber == group1) {"DEATH";} else {"LIFE";}&lt;br/&gt;/grouponelife = if (groupnumber == group1) {"LIFE";} else {"DEATH";}&lt;br/&gt;&amp;lt;/expressions&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;ALSO TRIED:&lt;br/&gt;****************************************************************************************************&lt;br/&gt;general instruction expressions: adjust the instruction text depending on the subject's group&lt;br/&gt;****************************************************************************************************&lt;br/&gt;&amp;lt;expressions&amp;gt;&lt;br/&gt;/grouponedeath = if (block.incompatibletest1 || block.incompatibletest2 || block.incompatibletestinstructions || block.targetincompatiblepractice || block.targetincompatiblepracticeswitch) {"DEATH";} else {"LIFE";}&lt;br/&gt;/grouponelife = if (block.incompatibletest1 || block.incompatibletest2 || block.incompatibletestinstructions || block.targetincompatiblepractice || block.targetincompatiblepracticeswitch) {"LIFE";} else {"DEATH";}&lt;br/&gt;&amp;lt;/expressions&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 05 Apr 2016 10:19:24 GMT</pubDate><dc:creator>hspixley</dc:creator></item><item><title>RE: Using "if statements" to display certain "expressions" in the instructions (DeathSuicide IAT)</title><link>https://forums.millisecond.com/Topic18774.aspx</link><description>You'll probably want to generalize the logic a little further. The group / condition assignment is based on simple modulo arithmetic, i.e. with two conditions this boils down to &lt;br/&gt;&lt;br/&gt;- odd group number -&amp;gt; 1st condition&lt;br/&gt;- even group number -&amp;gt; 2nd condition&lt;br/&gt;&lt;br/&gt;Your logic doesn't cover that yet. Enter 3 or 5 as the group number, and your expressions will not return the right thing.&lt;br/&gt;&lt;br/&gt;What you'll want to do is something along the lines of&lt;br/&gt;&lt;br/&gt;&amp;lt;expressions&amp;gt;&lt;br/&gt;/grouponedeath = if (&lt;strong&gt;mod(script.groupid ,2)&lt;/strong&gt; == 1) {"DEATH";} else {"LIFE";}&lt;br/&gt;/grouponelife = if (&lt;strong&gt;mod(script.groupid,2)&lt;/strong&gt; == 1) {"LIFE";} else {"DEATH";}&lt;br/&gt;&amp;lt;/expressions&amp;gt;			    							    &lt;br/&gt;&lt;br/&gt;Hope this helps.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 05 Apr 2016 10:19:24 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Using "if statements" to display certain "expressions" in the instructions (DeathSuicide IAT)</title><link>https://forums.millisecond.com/Topic18773.aspx</link><description>YESSSSS!!!!!!&lt;br/&gt;I thought I had tried every possible combination...BUT, this works:&lt;br/&gt;&lt;br/&gt;****************************************************************************************************&lt;br/&gt;general instruction expressions: adjust the instruction text depending on device used to run script&lt;br/&gt;****************************************************************************************************&lt;br/&gt;&amp;lt;expressions&amp;gt;&lt;br/&gt;/grouponedeath = if (script.groupid == 1) {"DEATH";} else {"LIFE";}&lt;br/&gt;/grouponelife = if (script.groupid == 1) {"LIFE";} else {"DEATH";}&lt;br/&gt;&amp;lt;/expressions&amp;gt;</description><pubDate>Tue, 05 Apr 2016 10:07:46 GMT</pubDate><dc:creator>hspixley</dc:creator></item></channel></rss>