Explore the community Forums Lectora Lectora Questions & Answers auto-select radio buttons?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #425414 Score: 0
    Profile photo of Adam Cain
    Adam Cain
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    Group Member
    curious george
    contributor
    17 pts
    @cainam

    Is there a way to either automatically select (or deselect) circles in a radio button group?

    Scenario:  I have one set of radio buttons show a 2nd set of radio buttons.  Is there a way to automatically have an option on that 2nd set of radio buttons selected based on the first radio button group selection?  (or to change / empty the radio button selection on the 2nd set based on a selection/re-selection of the 1st radio button group?

    #425417 Score: 1
    Profile photo of Brian Robertson
    Brian Robertson
    Member
    beginner
    intermediate
    LUC16 Attendee
    curious george
    wise owl
    contributor
    6 pts
    @brobertson4402

    Each radio button has an associated variable.  Use an action to modify the appropriate variable in the 2nd set of buttons when a button is selected from the first set.  Setting a radio button variable to ‘on’ (without quotes) selects it.  Setting a radio button variable to ‘off’ (without quotes0 deselects it.  You’ll need to add additional actions to handle all the possible scenarios of selecting a button in the first set and selecting/deselecting the appropriate buttons in the second set.   Also actions in the first set of buttons that deselect the other buttons in the first set when one is selected.

    Test questions using radio buttons do this automatically.  You will need to do it manually if you are adding radio buttons to a page that are not part of a test question.

    Hope this helps.

    This post has received 1 vote up.
    #425420 Score: 0
    Profile photo of Adam Cain
    Adam Cain
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    Group Member
    curious george
    contributor
    17 pts
    @cainam

    Thanks for the suggestions Brian.  Seems like variables don’t exist for each radio button, but for the button group as a whole, and setting the radio button group variable value to ‘off’, or to one of the radio button specific values doesn’t work…

    Is this what you mean by needing to do it manually if not using a test question with radio buttons?  (I didn’t use a test question for the radio button groups, instead, clicked on the Test & Survey tab, then Radio Button Group).

    thanks again!

    #425429 Score: 2
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    309 pts
    @timk

    The variable of a radio button group contains the value of the selected button. You can set the groups variable to the value of the button you want selected.

    You need a second action to Run javascript:

    Update_rg447();

    Replace rg447 with the HTML name of the group.

    This post has received 2 votes up.
    #425432 Score: 0
    Profile photo of Adam Cain
    Adam Cain
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    Group Member
    curious george
    contributor
    17 pts
    @cainam

    Brilliant!  worked like a charm Tim – thanks!

    #425508 Score: 2
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    53 pts
    @wheels

    The right, but apparently not obvious, way to do this is to use a “Change Contents” action on the Radio Group object.

    That way you don’t have to worry about doing any JavaScript or the html names changing from title to title.

    This updates the variable and the radio group selection. This can also be done on question objects, but again, it’s not always so obvious, if you have any ideas on how we can make this more easily discoverable please let me know!

    Thanks, always great to see so many ways to accomplish things in Lectora.

    – Joe

    This post has received 2 votes up.
    #425512 Score: 0
    Profile photo of Adam Cain
    Adam Cain
    Member
    beginner
    intermediate
    profile
    picture perfect
    wise owl
    friend finder
    Group Member
    curious george
    contributor
    17 pts
    @cainam

    Fantastic Joe – thanks, that worked too!  I did briefly started down the path of ‘change contents’ when I was trying to figure this out, and I think I rejected my notion that it was the path to a solution when I saw the value of ‘set text’ as the action, and maybe that turned me off?

    I really just assumed it had to be in the realm of ‘change variable’ as I was working on it.  ;  )

    #425514 Score: 2
    Profile photo of Joe Wieloch
    Joe Wieloch
    Moderator
    beginner
    intermediate
    friend finder
    contributor
    LUC16 Attendee
    verified member
    wise owl
    LUC17 Attendee
    advanced
    picture perfect
    53 pts
    @wheels

    That is great feedback, I can see how “set text” would be misleading. We really should give you the options (possible answers) for whatever object you have selected if it’s a question or form or form element.

    Because these input objects are associated with variables it makes sense that the variable can be set, we should probably trigger an update of the input object when an associated variable is modified.

    Thanks for helping us get a better handle on how we can make this work better!

    – Joe

    This post has received 2 votes up.
    #425518 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    309 pts
    @timk

    Thanks Joe, great to know. Although I’ve been working with Lectora for many years, I’ve never used it for anything else but for changing the contents of textfields. Maybe renaming the action would help … e.g. just “Change”. It would be even less obvious in the first place but it leaves more room for thinking about what might be changeable. Or “Change Contents / Selection”.

    This post has received 1 vote up.
    #425520 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    199 pts
    @Klaatu

    Since you’re sort of on the action editor topic, take a look at what the now defunct ToolBook authoring program used to offer 10 years ago! Why can’t Lectora get up to this speed or better?

     

    #425554 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    You are retired Darrel ! Forget about Toolbook 😉

    #425560 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    199 pts
    @Klaatu

    Almost retired. LOL. July 31st….

    #425643 Score: 0
    Profile photo of CarlFink
    CarlFink
    Member
    beginner
    intermediate
    contributor
    LUC16 Attendee
    wise owl
    curious george
    advanced
    22 pts
    @CarlFink

    I miss ToolBook. I still haven’t found a scripting system I like as much as OpenScript.

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

You must be logged in to reply to this topic.