checkboxes correct responses and data


Author
Message
jm560@sussex.ac.uk
jm560@sussex.ac.uk
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)
Group: Forum Members
Posts: 25, Visits: 208
Hi,

I'm having trouble using checkboxes. I want to display a list of options from which participants can select up to six - but only two are correct. It works correctly until I add 'correctresponse' which makes the question stay red and doesn't allow me to answer the question. Script below - 

<survey memorytest>
/ pages = [1 = p1]
</survey>

<surveypage p1>
/ questions = [1 = q1]
/ showquestionnumbers = false
</surveypage>

<checkboxes q1>
/ caption = "Please choose a maximum of six options you saw previously in the experiment:"
/ options = ("Cadbury", "Twix", "Wrong", "Wrong", "Wrong", "Wrong", "Wrong", "Wrong")
/ range = (1,6)
/ order = random
/ correctresponse = ("Cadbury", "Twix")
</checkboxes>

What is the issue here? Also is there a way of including number or correct answers in my summary data - I don't care which ones they got right (cadbury or twix), only how many.

Thanks,
Jenny


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: 12K, Visits: 98K
jm560@sussex.ac.uk - Monday, September 17, 2018
Hi,

I'm having trouble using checkboxes. I want to display a list of options from which participants can select up to six - but only two are correct. It works correctly until I add 'correctresponse' which makes the question stay red and doesn't allow me to answer the question. Script below - 

<survey memorytest>
/ pages = [1 = p1]
</survey>

<surveypage p1>
/ questions = [1 = q1]
/ showquestionnumbers = false
</surveypage>

<checkboxes q1>
/ caption = "Please choose a maximum of six options you saw previously in the experiment:"
/ options = ("Cadbury", "Twix", "Wrong", "Wrong", "Wrong", "Wrong", "Wrong", "Wrong")
/ range = (1,6)
/ order = random
/ correctresponse = ("Cadbury", "Twix")
</checkboxes>

What is the issue here? Also is there a way of including number or correct answers in my summary data - I don't care which ones they got right (cadbury or twix), only how many.

Thanks,
Jenny


You cannot use /correctresponse for that. Instead, you'll need to use some /ontrialend logic on the <surveypage> hosting the checkbox question to evaluate the response (check for correctness of the selected options, count the number of correctly selected options). One useful thing to do in addition is to use /optionvalues, you could encode the correct options as "1" and all the wrong ones as "0", which will make the counting easier. Finally, you'll want to store the information of interest in <values> and log those to your summary data file as needed. Something like this:

<survey memorytest>
/ pages = [1 = p1]
</survey>

<surveypage p1>
/ ontrialend = [
    values.nchecked = checkboxes.q1.checked.1 + checkboxes.q1.checked.2 + checkboxes.q1.checked.3 + checkboxes.q1.checked.4 + checkboxes.q1.checked.5 + checkboxes.q1.checked.6 + checkboxes.q1.checked.7 + checkboxes.q1.checked.8;
]
/ ontrialend = [
    values.ncorrect = length(checkboxes.q1.response) - length(replaceall(checkboxes.q1.response, "1", ""));
]
/ questions = [1 = q1]
/ showquestionnumbers = false
</surveypage>

<checkboxes q1>
/ caption = "Please choose a maximum of six options you saw previously in the experiment:"
/ options = ("Cadbury", "Twix", "X1", "X2", "X3", "X4", "X5", "X6")
/ optionvalues = ("1", "1", "0", "0", "0", "0", "0", "0")
/ range = (1,6)
/ order = random
</checkboxes>

<values>
/ ncorrect = 0
/ nchecked = 0
</values>

<summarydata>
/ columns = (script.startdate, script.starttime, script.subjectid, script.groupid
    values.nchecked, values.ncorrect)
</summarydata>



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search