﻿<?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  » surveypage if statement branching not working if there's a new line in the question answer</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 12 Sep 2026 11:53:20 GMT</lastBuildDate><ttl>20</ttl><item><title>surveypage if statement branching not working if there's a new line in the question answer</title><link>https://forums.millisecond.com/Topic23029.aspx</link><description>hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;i've created a surveypage where you have to click on the right answer to move to the next page, but if i insert a new line into the correct answer (as well as to the if statement), it no longer registers as correct. do you know what i could do to make this work while including a new line within the question answer?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;for example:&amp;nbsp;&lt;br/&gt;&amp;lt;surveypage questions&amp;gt;&lt;br/&gt;/ caption = "Before starting the experiment, please answer the following questions and click submit. Once you've answered all questions correctly, the task will automatically load. If you do not answer correctly, you will see the instructions again."&lt;br/&gt;/ fontstyle = ("Arial", 30)&lt;br/&gt;/ txcolor = white&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=question1; 2=question2; 3=question3] &lt;br/&gt;/ branch = [&lt;br/&gt;if (radiobuttons.question1.response=="c) the value of each image is determined by the average value of images within that room,~n and this average can change") surveypage.success else surveypage.fail&lt;br/&gt;]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;radiobuttons question1&amp;gt;&lt;br/&gt;/ caption = "Which statement is true about the values of the images in each room?"&lt;br/&gt;/ options = ("a) the value of each image is dependent on its quality", "b) the value of each image is determined by the average value of images within that room, and this average &lt;br/&gt;doesn't change", "c) the value of each image is determined by the average value of images within that room,~n and this average can change")&lt;br/&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 06 Dec 2017 13:42:50 GMT</pubDate><dc:creator>nrouhani</dc:creator></item><item><title>RE: surveypage if statement branching not working if there's a new line in the question answer</title><link>https://forums.millisecond.com/Topic23030.aspx</link><description>&lt;div data-id="23029" class="if-quote-wrapper" unselectable="on" data-guid="1512596229790"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="23029" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="23029" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="23029" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;nrouhani - Wednesday, December 6, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-23029"&gt;&lt;div class="if-quote-message-margin"&gt;hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;i've created a surveypage where you have to click on the right answer to move to the next page, but if i insert a new line into the correct answer (as well as to the if statement), it no longer registers as correct. do you know what i could do to make this work while including a new line within the question answer?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;for example:&amp;nbsp;&lt;br/&gt;&amp;lt;surveypage questions&amp;gt;&lt;br/&gt;/ caption = "Before starting the experiment, please answer the following questions and click submit. Once you've answered all questions correctly, the task will automatically load. If you do not answer correctly, you will see the instructions again."&lt;br/&gt;/ fontstyle = ("Arial", 30)&lt;br/&gt;/ txcolor = white&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ questions = [1=question1; 2=question2; 3=question3] &lt;br/&gt;/ branch = [&lt;br/&gt;if (radiobuttons.question1.response=="c) the value of each image is determined by the average value of images within that room,~n and this average can change") surveypage.success else surveypage.fail&lt;br/&gt;]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;radiobuttons question1&amp;gt;&lt;br/&gt;/ caption = "Which statement is true about the values of the images in each room?"&lt;br/&gt;/ options = ("a) the value of each image is dependent on its quality", "b) the value of each image is determined by the average value of images within that room, and this average &lt;br/&gt;doesn't change", "c) the value of each image is determined by the average value of images within that room,~n and this average can change")&lt;br/&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="23029"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;The best way is to define /optionvalues in your &amp;lt;radiobuttons&amp;gt; that do not contain the new line / line break, and base the /branch on that:&lt;br/&gt;&lt;br/&gt;&amp;lt;radiobuttons question1&amp;gt;&lt;br/&gt;/ caption = "Which statement is true about the values of the images in each room?"&lt;br/&gt;/ options = ("a) the value of each image is dependent on its quality", "b) the value of each image is determined by the average value of images within that room, and this average &lt;br/&gt;doesn't change", "c) the value of each image is determined by the average value of images within that room,~n and this average can change")&lt;br/&gt;&lt;strong&gt;/ optionvalues = ("a", "b", "c")&lt;/strong&gt;&lt;br/&gt;&amp;lt;/radiobuttons&amp;gt;&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage questions&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ questions = [1=question1; 2=question2; 3=question3] &lt;br/&gt;/ branch = [&lt;br/&gt;if (radiobuttons.question1.response==&lt;strong&gt;"c"&lt;/strong&gt;) surveypage.success else surveypage.fail&lt;br/&gt;]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;</description><pubDate>Wed, 06 Dec 2017 13:42:50 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>