Millisecond Forums

problem with branching and "other" element

https://forums.millisecond.com/Topic17608.aspx

By vz29 - 11/3/2015

Hi,

My last demo page (demographics5) is for some reason looping back to demographics3. Not sure why.

Also, the text box for "other" isn't appearing, and when Ps select on this option, they can't advance. Again, not sure why.

Below is the syntax:

------------------------------------------------------------------------------------
*** DEMO ****
------------------------------------------------------------------------------------

------------------------------------------------------------------------------------
*** BLOCK ****
------------------------------------------------------------------------------------

<survey demo>
/ pages = [1 = demographics1; 2= demographics2; 3= demographics3; 4=demographics4; 5=demographics5]
/ responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0)
/ itemspacing = 10%
/ showpagenumbers = false
/ finishlabel = "Next"
</survey>

------------------------------------------------------------------------------------
*** PAGES ****
------------------------------------------------------------------------------------

<surveypage demographics1>
/ caption = "Please answer the following demographic questions"
/ questions = [1=idnumber; 2=age; 3=sex; 4=race]
</surveypage>

<surveypage demographics2>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=senseofsmell; 2=headinjuries]
/ branch = [if (radiobuttons.headinjuries.response == 1) surveypage.demographics2b]
/ branch = [if (radiobuttons.headinjuries.response == 0) surveypage.demographics3]
</surveypage>

<surveypage demographics2b>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=headinjuriescheck; 2 = headinjuries_date]
</surveypage>

<surveypage demographics3>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=health; 2=sinus]
/ branch = [if (radiobuttons.health.response == 0) surveypage.demographics3b]
/ branch = [if (radiobuttons.health.response == 1) surveypage.demographics4]
</surveypage>

<surveypage demographics3b>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=healthfill]
</surveypage>

<surveypage demographics4>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=stress; 2=stressfuture]
/ branch = [if (radiobuttons.stressfuture.response == 1) surveypage.demographics4b]
/ branch = [if (radiobuttons.stressfuture.response == 0) surveypage.demographics5]
</surveypage>

<surveypage demographics4b>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=stressfill]
</surveypage>

<surveypage demographics5>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=period; 2=ovulation; 3=regular; 4=pill; 5=pregnant]
</surveypage>

<textbox idnumber>
/ caption = "Please enter your participant ID number, which is marked on the plastic bag you received with your t-shirt."
/ required = true
</textbox>

<dropdown age>
/ caption = "What is your age?"
/ options = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ optionvalues = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ required = false
</dropdown>

<radiobuttons sex>
/ caption = "What is your sex?"
/ options = ("Female", "Male")
/ optionvalues = ("0", "1")
/ orientation = horizontal
/ required = false
</radiobuttons>

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = "Other"
/ required = false
</checkboxes>

<checkboxes senseofsmell>
/ caption = "Please tell us about your sense of smell. You may check more than one option if necessary."
/ options = ("I have a normal sense of smell", "My sense of smell is distorted, that is, things smell peculiar.", "I experience a smell when nothing is there (phantom smell).", "My sense of smell is heightened (hypersensitivity).", "My sense of smell is diminished (partial loss).", "My sense of smell is absent (complete loss).")
/ other = "Other"
/ required = false
</checkboxes>

<radiobuttons headinjuries>
/ caption = "Have you ever had any head or facial injuries?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false
</radiobuttons>

<checkboxes headinjuriescheck>
/ caption = "Please indicate your head/facial injuries. (Select ALL that apply)"
/ options = ("Head Injury", "Facial Injury", "Concussion", "Loss of consciousness associated with head injury", "Amnesia/memory loss due to head injury")
</checkboxes>

<textbox headinjuries_date>
/ caption = "When did your head/facial injuries occur. Please specify the date(s) of their occurrence."
/ required = false
</textbox>

<radiobuttons health>
/ caption = "Are you currently healthy?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false
</radiobuttons>

<textbox healthfill>
/ caption = "Please elaborate on any current health problems you are having."
/ required = false
</textbox>

<checkboxes sinus>
/ caption = "Stuffy nose, allergies, sinus infections, and other similar symptoms can interfere with your ability to accurately identify scents. Please let us know if you are currently experiencing any of these symptoms. Check all options that apply."
/ options = ("Stuffy Nose", "Allergies", "Sinus Infection", "Sore Throat", "Congestion", "None of the above")
/ required = false
</checkboxes>

<radiobuttons stress>
/ caption = "Please tell us about your current level of stress."
/ options = ("Not at all stressed", "A little stressed", "Somewhat stressed", "Very Stressed", "Extremely stressed")
/ optionvalues = ("1", "2", "3", "4", "5")
/ orientation = horizontal
/ required = false
</radiobuttons>

<radiobuttons stressfuture>
/ caption = "Are there any stressful events coming up for you in the next few weeks, such as exams, job interviews, first dates, etc?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false
</radiobuttons>

<textbox stressfill>
/ caption = "Please list, with date if possible, the upcoming events."
/ required = false
</textbox>

<textbox period>
/ caption = "Sense of smell can fluctuate in relation to your menstrual cycle.
Please list the date of your last period."
/ required = false
</textbox>

<textbox ovulation>
/ caption = "If you know (or can estimate) when you last ovulated, please tell us the date. If not, please write n/a."
/ required = false
</textbox>

<radiobuttons regular>
/ caption = "Is your menstrual cycle regular?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false
</radiobuttons>

<radiobuttons pill>
/ caption = "Are you currently taking hormonal birth control (pill, IUD, injections)?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false
</radiobuttons>

<radiobuttons pregnant>
/ caption = "Is there any chance you might currently be pregnant?"
/ options = ("Yes", "No")
/ optionvalues = ("1", "0")
/ orientation = horizontal
/ required = false

By Dave - 11/3/2015

It's not looping to demographics3. You run demographics3 twice under certain conditions:

#1: You /branch to it here:
<surveypage demographics2>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=senseofsmell; 2=headinjuries]
/ branch = [if (radiobuttons.headinjuries.response == 1) surveypage.demographics2b]
/ branch = [if (radiobuttons.headinjuries.response == 0) surveypage.demographics3]
</surveypage>

#2: You also run it via the <survey>:
<survey demo>
/ pages = [1 = demographics1; 2= demographics2; 3= demographics3; 4=demographics4; 5=demographics5]
/ responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0)
/ itemspacing = 10%
/ showpagenumbers = false
/ finishlabel = "Next"
</survey>

When a chain of branches has come to its end, Inquisit goes back to the "regularly scheduled" trials / pages in your <block>'s /trials attribute or your <survey>'s /pages attribute respectively. Do either one or the other, i.e., if you invoke a page via /branch *don't* run it via /pages in addition; if you've already scheduled a page via /pages, don't /branch to it in addition.

As for the "other" issue:

The box is there, but it may be partially obscured by the bounding rectangle around the response options. You can work around this somewhat by using a separate, bigger-sized <textbox> as your other option. That should ensure that the box is (a) easily visible and (b) selectable (the grey screencolor below serves to illustrate the overlap):

<survey demo>
/ screencolor = (grey)
/ pages = [1 = demographics1; ]
/ responsefontstyle = ("Verdana", 1.5%, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", 2%, false, false, false, false, 5, 0)
/ itemspacing = 10%
/ showpagenumbers = false
/ finishlabel = "Next"
</survey>

<surveypage demographics1>
/ caption = "Please answer the following demographic questions"
/ questions = [1=idnumber; 2=age; 3=sex; 4=race]
</surveypage>

<textbox idnumber>
/ caption = "Please enter your participant ID number, which is marked on the plastic bag you received with your t-shirt."
/ required = true
</textbox>

<dropdown age>
/ caption = "What is your age?"
/ options = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ optionvalues = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ required = false
</dropdown>

<radiobuttons sex>
/ caption = "What is your sex?"
/ options = ("Female", "Male")
/ optionvalues = ("0", "1")
/ orientation = horizontal
/ required = false
</radiobuttons>

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = raceother
/ required = false
</checkboxes>

<textbox raceother>
/ caption = "Other"
/ textboxsize = (25%,5%)
</textbox>
By vz29 - 11/3/2015

thanks. I fixed the first problem, but the second problem with the text box for other remains. I'm not sure what to do.

here's the script I'm using:

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = raceother
/ required = false
</checkboxes>

<textbox raceother>
/ caption = "Other"
/ textboxsize = (25%,5%)

By vz29 - 11/3/2015

Here's the script (the end tag didn't come through in my last post).

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = raceother
/ required = false
</checkboxes>

<textbox raceother>
/ caption = "Other"
/ textboxsize = (25%,5%)
</textbox>
By Dave - 11/3/2015

I am unable to reproduce that. Here's a screenshot of that code running on my system, as you can see the box is present:

https://www.millisecond.com/forums/uploads/images/3da4e43a-4046-49fc-bb1d-3429.png

Two things to try:
(1) Make the box larger still, i.e. increase /textboxsize further, OR
(2) Push the box further to the right outside the area of potential overlap by appending a bunch of spaces or tabs to the other caption:

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = "Other:                                      "
/ required = false
</checkboxes>
By vz29 - 11/3/2015

I tried the latter and that didn't work. 

Here's the script:


<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = "Other:             "
/ required = false
</checkboxes>


<checkboxes senseofsmell>
/ caption = "Please tell us about your sense of smell. You may check more than one option if necessary."
/ options = ("I have a normal sense of smell", "My sense of smell is distorted, that is, things smell peculiar.", "I experience a smell when nothing is there (phantom smell).", "My sense of smell is heightened (hypersensitivity).", "My sense of smell is diminished (partial loss).", "My sense of smell is absent (complete loss).")
/ other = "Other:             "
/ required = false

here are the two screen shots:


https://www.millisecond.com/forums/uploads/images/01877887-04ad-4ee8-9718-47fe.pnghttps://www.millisecond.com/forums/uploads/images/e438ecf5-b725-4b61-b439-d15e.png
By vz29 - 11/3/2015

also, when I made the text box bigger, it still didn't solve the issue:

<textbox raceother>
/ caption = "Other"
/ textboxsize = (50%,25%)
</textbox>

By Dave - 11/3/2015

Based on those screenshots I think you are missing the fact that the box will only become visible *once the other option is actually selected*, which it is *not* in any of those screenshots.
By vz29 - 11/4/2015

Hm... I tested the script out on another computer. Even when I do NOT click on the "other" option, the text box appears. So, the problem doesn't show up on this computer. Here's the screenshot.... It does, however, persist on my laptop, and the laptop of another lab member...

http://www.millisecond.com/forums/uploads/images/f050cb5c-fe5b-4ea8-879f-d423.png
By vz29 - 11/4/2015

I'm now back at my laptop, and confirmed the issue. Screenshot below.

Also, even though I specified to NOT require a response, if "other" is selected, you can't advance.

https://www.millisecond.com/forums/uploads/images/de96ecc3-9ae4-49a9-b06a-8935.png
By Dave - 11/4/2015

First you should make sure that all those systems are running the same, up-to-date Inquisit version. Otherwise any comparisons tend to be invalid.

Second, it remains entirely unclear from your response whether the box shows up on your system once the other option is selected. Does it or does it not?
By vz29 - 11/6/2015

"I think you are missing the fact that the box will only become visible *once the other option is actually selected*, which it is *not* in any of those screenshots."

i wasn't missing that fact ...
were you able to figure out the issue?
By Dave - 11/8/2015

No, I haven't figured out the issue -- the box shows up in every single test I've done.

I'm also not sure what the answers to my first question in my last response is, namely which Inquisit version you are using and whether you've made sure it's the same (and up to date) on all systems.

The only other thing I can suggest trying is including the "other" <textbox> element in the page's /questions attribute. That should force it to be visible from the get-go:

<survey demo>
/ screencolor = (grey)
/ pages = [1 = demographics1; ]
/ responsefontstyle = ("Verdana", 1.5%, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", 2%, false, false, false, false, 5, 0)
/ itemspacing = 10%
/ showpagenumbers = false
/ finishlabel = "Next"
</survey>

<surveypage demographics1>
/ caption = "Please answer the following demographic questions"
/ questions = [1=idnumber; 2=age; 3=sex; 4=race; 5=raceother]
</surveypage>

<textbox idnumber>
/ caption = "Please enter your participant ID number, which is marked on the plastic bag you received with your t-shirt."
/ required = true
</textbox>

<dropdown age>
/ caption = "What is your age?"
/ options = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ optionvalues = ("18", "19", "20", "21", "22", "23", "24", "25", "26", "27","28", "29",
          "30", "31", "32", "33", "34", "35", "36", "37","38", "39",
          "40", "41", "42", "43", "44", "45", "46", "47","48", "49",
          "50", "51", "52", "53", "54", "55", "56", "57","58", "59",
          "60", "61", "62", "63", "64", "65", "66", "67","68", "69",
          "70", "71", "72", "73", "74", "75", "76", "77","78", "79",
          "80", "81", "82", "83", "84", "85", "86", "87","88", "89")
/ required = false
</dropdown>

<radiobuttons sex>
/ caption = "What is your sex?"
/ options = ("Female", "Male")
/ optionvalues = ("0", "1")
/ orientation = horizontal
/ required = false
</radiobuttons>

<checkboxes race>
/ caption = "With what race/ethnicity do you identify? (Select ALL that apply)"
/ options = ("Caucasian", "Hispanic or Latino", "Asian", "Black or African American", "Native Hawaiian/Pacific Islander", "American Indian/Alaska Native", "Indian")
/ other = raceother
/ required = false
</checkboxes>

<textbox raceother>
/ caption = "Other"
/ textboxsize = (25%,5%)
/ required = false
</textbox>