How to reference a clicked survey response for value calculations...


Author
Message
mcfubb
mcfubb
Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)Partner Member (810 reputation)
Group: Forum Members
Posts: 3, Visits: 1

Hey,


I have a survey on which participants respond either by clicking radiobuttons or values from a dropdown menu.


I want to add to certain values I have coded depending on the response for each survey item. I can't seem to figure out how to reference the values that are clicked, whether radiobutton or dropdown, such that Inquisit understands what values I want to correspond to each response.


Please see a sample of the script below, which shows the values I want to update, and the radiobutton and surveypage (including the values I'm trying to update at the ontrialend/ part):



<values>


/networkdiversity=0


/numberofpeople=0


</values>



<radiobuttons marital>


/caption = "Marital Status"


/options = ("Currently married & living together, or living with someone in marital-like relationship", 


"Never married & never lived with someone in a marital-like relationship",


"Separated", "Divorced or formerly lived with someone in a marital-like relationship", "Widowed")


</radiobuttons>



<surveypage page1>


/caption = "1. Which of the following best describes your marital status?"


/questions = [1=marital]


/showpagenumbers = false


/showquestionnumbers = false


/ ontrialend = [if(radiobuttons.marital.response == "Currently married & living together, or living with someone in marital-like relationship")


values.networkdiversity = values.networkdiversity + 1;


if(radiobuttons.marital.response = "Currently married & living together, or living with someone in marital-like relationship")


values.numberofpeople = values.numberofpeople + 1]


</surveypage>




Could someone please let me know how to do this correctly?


Thanks.


-Daniel


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Reading This Topic

Explore
Messages
Mentions
Search