Using radiobuttons


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
No problem. Cheers!

GeeP
GeeP
Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)
Group: Forum Members
Posts: 81, Visits: 118
Ah! now that makes total sense and shows why I was failing! Thanks a ton Dave!!!!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
You need to (a)

<trial instructions_M>
[...]
/ branch = [surveypage.checkinstructions]
</trial>

and (b)

<block instructions_M>
/ trials = [1 = instructions_M; 2=CheckInstructions]
 </block>

GeeP
GeeP
Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)
Group: Forum Members
Posts: 81, Visits: 118
Hi Dave,

I tried working with the script but I think I am still doing something wrong! When the error message shows up, I was able to loop it back to the main instruction trial (but not the main block), but when I hit next on the instruction page, expecting to go to the two questions again, it automatically takes me to the next block! However, if the questions are correctly answered, the next block appears automatically, which seems OK. Would you kindly check my script and let me know where I am going wrong or what I need to be doing? Much thanks!


<defaults>
/ minimumversion = "4.0.1.0"
/ inputdevice = mouse
/ fontstyle = ("Garamond", 3%, false, false, false, false, 5, 0)
/ endlock = true ("Please tell the experimenter that the experiment has ended. Thank you very much for your participation! :)")
</defaults>

<expt expt1 of 1>
/ blocks = [1=instructions_M; 2=debriefing1]
/ subjects = (1 of 1)
</expt>

<block instructions_M>
/ trials = [1 = instructions_M; 2=CheckInstructions]
 </block>

<trial instructions_M>
/ stimulusframes = [1=igtinstructions, nextbutton]
/ validresponse = (nextbutton)
/ recorddata = false
</trial>

<surveypage CheckInstructions>
/ questions = [1=CheckInstructions1]
/ showpagenumbers = false
/ nextbuttonposition = (45%, 70%)
/ finishlabel = "NEXT"
/ branch = [surveypage.checkquestions]
</surveypage>

<surveypage checkquestions>
/ questions = [1=q1; 2=q2]
/ showpagenumbers = false
/ nextbuttonposition = (45%, 70%)
/ finishlabel = "NEXT"
/ branch = [if (radiobuttons.q1.response+radiobuttons.q2.response < 2) surveypage.error]
</surveypage>

<surveypage error>
/ caption = "Sorry! You did not get both answers right. Please read the instructions once again carefully."
/ showpagenumbers = false
/ nextbuttonposition = (45%, 70%)
/ finishlabel = "NEXT"
/ branch = [trial.instructions_M]
</surveypage>

<caption CheckInstructions1>
/ caption = "Before you begin, we would like to ensure that you have read the instructions carefully.
Therefore, please answer the following questions correctly in order to continue.


Please note that you will NOT be able to proceed unless you answer these questions correctly.

When you have answered these questions correctly, the task will automatically start:"
</caption>

<radiobuttons q1>
/ caption = "What is the goal of the game?"
/ options = ("To make as much money as possible.", "To count numbers.", "To choose individuals")
/ optionvalues = ("1", "0", "0")
</radiobuttons>

<radiobuttons q2>
/ caption = "What will you win if you do well in this game?"
/ options = ("Nothing.", "Top 10% of scorers will win a gift certificate of $25.", "Top 1% of scorers will win a gift certificate of $5")
/ optionvalues = ("0", "1", "0")
</radiobuttons> 

<text nextbutton>
/ items = ("NEXT")
/ position = (50%, 90%)
/ fontstyle = ("Garamond", 3%, false, false, true, false, 5, 0)
/ txcolor = blue
</text>

<text igt>
/ items = ("SEAL THE DEAL!")
/ position = (50%, 15%)
/ fontstyle = ("Garamond", 4%, true)
/ txcolor = (255, 0, 0)
/ erase = false
</text>

<text igtinstructions>
/ items = instructions
/ select = 1
/ fontstyle = ("Garamond", 3%, true)
/position = (50%, 20%)
/ size = (80%, 30%)
/ hjustify = left
/ valign = top
</text>

<item instructions>
/ 1 = "In this game, your goal is to win as much money as possible. You will start with $2000.
Your total earnings and the number of trials will be displayed on the screen. 



If you do well on the task, you could win a $25 gift certificate! 
At the end of this study, the top 10% of participants in our study who perform the best (i.e., earn the most money across the 100 trials) will win a gift certificate of $25.
Try your best to increase your earnings as much so you can to be one of the highest earning participants and win the $25 gift certificate!"
</item>

<survey debriefing1>
/ pages = [1=debriefing1]
/ responsefontstyle = ("Garamond", -16, false, false, false, false, 5, 0)
/ itemfontstyle = ("Garamond", -16, false, false, false, false, 5, 0)
/ itemspacing = 2%
/ showpagenumbers = false
</survey>

<surveypage debriefing1>
/ caption = "Please answer the following questions"
/ fontstyle = ("Garamond", -16, true, false, false, false, 5, 0)
/ questions = [1=uniqueid] 
</surveypage>

<textbox uniqueid>
/ caption = "Please enter the unique identifier you created while completing the online survey (first 4 digits of your cornell ID followed by your birthday)."
/ multiline = true
/ textboxsize = (8, 4)
/ size = (70, 50)
</textbox>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
> I guess the bigger issue I am now facing is this: when radiobuttons.q1.response+radiobuttons.q2.response is not equal to 2, the error message successfully shows up and subjects hit 'finish' and are looped back to the instructions page BUT on the instructions page, when they hit 'next', it does not go back to the 2 radiobutton questions but instead moves automatically to the next block.

The example I provided does not do this. It works correctly via the /branch from the 1st page (paragraph) to the 2nd page (questions). You need to fix your own code accordingly.

>
how can I remove the 'finish' button and instead introduce a 'next' button?

See the documentation for the <surveypage> element's /finishlabel attribute.

GeeP
GeeP
Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)
Group: Forum Members
Posts: 81, Visits: 118
Thanks Dave!

I guess the bigger issue I am now facing is this: when radiobuttons.q1.response+radiobuttons.q2.response is not equal to 2, the error message successfully shows up and subjects hit 'finish' and are looped back to the instructions page BUT on the instructions page, when they hit 'next', it does not go back to the 2 radiobutton questions but instead moves automatically to the next block. Also, in the radio buttons block, how can I remove the 'finish' button and instead introduce a 'next' button? Thanks in advance!
-G

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
You don't need a /branch to do that at all. Simply specify "nextblock" as second block in your <expt>.



GeeP
GeeP
Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)
Group: Forum Members
Posts: 81, Visits: 118
Thanks a ton Dave!

This was extremely helpful! I was able to design what I requested based off of this. My one last question (hopefully!) is how do I create a branch such that if the if (radiobuttons.q1.response+radiobuttons.q2.response = 2), then it should move on to the next block. 

When I add another 'Branch' as shown below, for example, it doesn't seem to work! :(

<surveypage checkquestions>
/ questions = [1=q1; 2=q2]
/ showpagenumbers = false
/ branch = [if (radiobuttons.q1.response+radiobuttons.q2.response < 2) surveypage.error]
/ branch = [if (radiobuttons.q1.response+radiobuttons.q2.response < 2) block.nextblock]
</surveypage>

Thank you again,
-G


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
<block myblock>
/ trials = [1=paragraph]
</block>

<surveypage paragraph>
/ questions = [1=myparagraph]
/ showpagenumbers = false
/ branch = [surveypage.questions]
</surveypage>

<surveypage questions>
/ questions = [1=q1; 2=q2]
/ showpagenumbers = false
/ branch = [if (radiobuttons.q1.response+radiobuttons.q2.response < 2) surveypage.error]
</surveypage>

<surveypage error>
/ caption = "Wrong. Try again."
/ showpagenumbers = false
/ branch = [surveypage.paragraph]
</surveypage>

<caption myparagraph>
/ caption = "Sarah's favorite toy is a red ball."
</caption>

<radiobuttons q1>
/ caption = "What is Sarah's favorite toy?"
/ options = ("A doll.", "A ball.")
/ optionvalues = ("0", "1")
</radiobuttons>

<radiobuttons q2>
/ caption = "What's its color?"
/ options = ("Red.", "Blue.")
/ optionvalues = ("1", "0")
</radiobuttons>
GeeP
GeeP
Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)Guru (8.7K reputation)
Group: Forum Members
Posts: 81, Visits: 118
Hi All,

I have a two stage problem.
1. I need to use radiobuttons for 2 questions for which I need subjects to choose the correct answer (for both questions)
2. If they get either or both questions wrong, they need to be looped back to the instructions' page.

So, basically, subjects are shown some instructions/paragraph on screen 1, with the next button. On screen 2, they are asked 2 questions (about the paragraph) with radiobuttons for which they MUST get both right, if not, they have to go back and read the paragraph/instructions again. I am thinking even an error message (in red) asking them to go back and read the instructions/paragraph should work but am stuck thinking of how to do that. Any help would be greatly appreciated!!!

Thanks a ton!
-G

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search