Checkbox/unselecting an option

PennController for IBEX Forums Support Checkbox/unselecting an option

This topic contains 4 replies, has 2 voices, and was last updated by Avatar daniela 2 weeks ago.

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

    Hi Jeremy,

    we’d like to present participants with multiple text options on a single screen from which they can select/indicate which were relevant to the experiment. We started off using a scale that only had one option (and they were instructed to indicate which were relevant), but the radio button cannot be unselected once selected when there is only one presented (as far as we can tell). We’d like participants to be able to unselect in case they made a mistake/reconsider. Our less-than elegant solution is just to provide a scale with 2 options, yes or no. However this isn’t a very clean solution, and ideally we’d have something tidier like a checkbox. We’re generating this presented list using a .csv file, and so incorporating “newHtml” isn’t possible as far as I’m aware.

    The question is then whether there’s something like a checkbox element, or a way to have a single radio button unselected by clicking on it again? Similar to what the .unselect() command does, but only for a single radio button when multiple are presented (rather than unselecting everything).

    Best,
    Daniela

    #5652
    Jeremy
    Jeremy
    Keymaster

    Hi Daniela,

    There is no built-in support in PennController for this sort of thing, I should probably work on adding it somewhere

    One solution would be to run a function after you’ve printed your Scale elements that will take care of toggling selection, like this

    newFunction( () => {
        $(".PennController-Scale input[type='radio']").click(function(){
            $(this).attr("toggle", $(this).attr("toggle") != "true" );
            if ($(this).attr("toggle")=="false") $(this).removeAttr("checked");
        })
    }).call()

    Jeremy

    #5694
    Avatar
    daniela
    Participant

    Hi Jeremy,

    thanks for your answer. We decided to go with a 2-option scale (yes/no), but now have the following problem: there are multiple selections participants need to make on the same screen, and so to avoid cluttering the screen with multiple ‘yes/no’ options, we have a label at the top of the page indicated left = yes, right = no. However, the newest PennController update seems to not give the option of not presenting the labels.

    Basically, the following does not automatically print the scale numbers in the previous PC 1.7 (which is what we want):

    newScale("rating", 7)
    .print()
    .wait()

    But in PC 1.8 it does print them. Is there then a way in PC 1.8 to remove the scale labels?

    Best,
    Daniela

    #5699
    Jeremy
    Jeremy
    Keymaster

    Hi Daniela,

    Yes, this is a known bug which will be fixed in PennController 1.9. In the meantime, you can systematically hide the labels of any Scale element named rating by writing this in a file called global_z.css in your project’s aesthetics folder:

    .PennController-rating .option label {
        display: none;
    }

    Jeremy

    #5703
    Avatar
    daniela
    Participant

    Great, thanks again!

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

You must be logged in to reply to this topic.