Reply To: Having participants select more than one option in questions

PennController for IBEX Forums Support Having participants select more than one option in questions Reply To: Having participants select more than one option in questions

#7426
ozgebakay
Participant

Hi Jeremy,

I am using the “checkbox” element, followed by a button. Is there a way to force the participants to choose at least one option before they can click on the button? With the code that I have, I display the button once they choose an option, but if they uncheck that option and have nothing checked, the botton will still be displayed and they can still click on the button and move on. Here is my code:

newScale("answer", row.answer1, row.answer2, row.answer3)
    .checkbox()
    .print()
    .vertical()
    .log()
    .wait() // to make the participants choose at least one option before displaying the button
,
newButton("Devam")
    .print()
    .wait()

My second question is about the completion code. I have a confirmation code that is successfully displayed on the screen at the end of the experiment, but I cannot have it in my results file. Based on a previous question on this in the forum, I tried this, but it did not work:

newTrial("end",
    newVar(randomnumber = Math.floor(Math.random()*1000000))
    ,
    newVar(completionCode = String("IST" + randomnumber))
    ,
    newVar(sendingResultsMessage = "...")
    ,
    newVar(completionMessage = "...: " + completionCode)
    ,
    newVar("completionMessage").global().set(getTextInput("completionMessage"))
)
.log("completionCode", completionCode)

And the sequence of this experiment is as follows, in case it helps:
Sequence("instructions", "intro", "practice1", "practice2", "practice3", "break", rshuffle("items", "fillers"), "increase", "SendResults()");

Thank you,
Özge