PennController for IBEX › Forums › Support › Checkbox/unselecting an option
- This topic has 4 replies, 2 voices, and was last updated 4 years, 2 months ago by
daniela.
-
AuthorPosts
-
June 16, 2020 at 9:48 am #5649
daniela
ParticipantHi 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,
DanielaJune 16, 2020 at 10:48 am #5652Jeremy
KeymasterHi 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
June 22, 2020 at 8:15 am #5694daniela
ParticipantHi 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,
DanielaJune 22, 2020 at 2:10 pm #5699Jeremy
KeymasterHi 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
June 23, 2020 at 3:59 am #5703daniela
ParticipantGreat, thanks again!
-
AuthorPosts
- You must be logged in to reply to this topic.