Having participants select more than one option in questions

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

This topic contains 4 replies, has 2 voices, and was last updated by Avatar ozgebakay 1 day, 4 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7346
    Avatar
    ozgebakay
    Participant

    Hi,

    I need my participants to be able to select more than one option in answering the questions. Is there a way to do it in the current version of PCIbex? I read some entries about Scale here, but I am not sure if or how we can use it for that.

    Thanks a lot,
    Özge Bakay

    #7347
    Jeremy
    Jeremy
    Keymaster

    Hi,

    There is a not-yet-documented command on Scale elements called checkbox which turns the options into checkoxes that can all independently be on/off. By default each option will appear as a label next to a checkbox, but you can use CSS rules to customize the rendering. For example, if you want to only keep the text labels and have a dotted frame appear around the selected options, you can add this to global_main.css:

    .PennController-Scale .option {
        margin: 1em;
    }
    .PennController-Scale .option input[type="checkbox"] {
        display: none;
    }
    .PennController-Scale .option input[type="checkbox"] + label {
        border: medium dotted transparent;
        padding: 0.25em;
    }
    .PennController-Scale .option input[type="checkbox"]:checked + label {
        border-color: black;
    }

    Example trial for reference:

    newTrial(
        newScale("answer", "hello", "world")
            .checkbox()
            .print()
        ,
        newButton("Hello world")
            .print()
            .wait()
    )

    Jeremy

    #7348
    Avatar
    ozgebakay
    Participant

    Thank you very much, Jeremy!

    I tried your example trial, it works! But I have two follow-up questions: I want to have a question before the list of options. Here is what I tried, but it did not work: Should the question be inside newScale? If so, how?

    newTrial("scale",
        newController("FlashSentence", {s : "Which one?"})
        ,
        
        newScale("answer", "Option1", "Option2", "Option3")
            .checkbox()
            .print()
        ,
        newButton("Next")
            .print()
            .wait()
    )

    My second question is: is there a way to list the options top to bottom rather than one next to the other on a single line?

    Thanks a lot,
    Özge

    #7349
    Jeremy
    Jeremy
    Keymaster

    If all you want to do is print a line of text, you should probably consider using a Text element (as in newText("Which one?").print())

    If you haven’t read the PCIbex tutorial yet, I invite you to do so, it’ll give you a general idea of how to do this kind of things: https://doc.pcibex.net/basic-tutorial/

    You can use the vertical command to display the options top-to-bottom: https://doc.pcibex.net/scale/#scale-vertical

    Jeremy

    #7426
    Avatar
    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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.