group conditional for all buttons clicked?

susanmacnab
susanmacnab Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 45 ☆ Superstar ☆

This may seem pretty basic but is there a conditional that will trigger once all buttons in a button group have been clicked on?

I tried just checking each button's state but the most recent click appears as "selected" so we never really have all buttons in "visited" state.

I keep reverting back to the old technique of tracking my clicks in a variable because I can't get it to work any other way.

Answers

  • beeps
    beeps Community Member Posts: 40 ✶ Headliner ✶

    You can do this with variables.

    Create a variable (for example, MyVar) and put an action on each button that adds to the variable. Then include an action will run the action you want triggered after the variable conditions have been met. For example:

    Button 1

    • On mouseclick >modify MyVar >add to variable a
    • On mouseclick >DO TRIGGER ACTION *if* MyVar contains A, MyVar contains B

    Button 2

    • On mouseclick >modify MyVar >add to variable b
    • On mouseclick >DO TRIGGER ACTION if MyVar contains A, MyVar contains B

    You can keep adding to the variable until every button you want users to click has been clicked. I hope this helps ☺️

  • susanmacnab
    susanmacnab Community Member, Lectora® Accessibility Group (LAUG) Member, eLearning Brothers® Partner Posts: 45 ☆ Superstar ☆
    edited February 1, 2023

    Thank you @beeps for your suggestion.

    I am aware of the variable method and have been using it for years.

    When Lectora 21 came out with improved button states and grouping, I assumed that there would be a built-in feature that could trigger an action once all buttons in a group have been clicked on. Unfortunately it doesn't seem to exist.

    The variable method works perfectly, of course, but it's something that all new users have to learn on their own. If there was a conditional for "all buttons in group x have been clicked on" or even if each button had a "visited or selected" conditional it could cut out a few steps for us developers.