Explore the community Forums Lectora Lectora Questions & Answers Retain toggle selected

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #283366 Score: 0
    Profile photo of switalba Switalski
    switalba Switalski
    Member
    beginner
    intermediate
    advanced
    contributor
    profile
    picture perfect
    Group Member
    curious george
    wise owl
    friend finder
    2 pts
    @switalba

    I have made a toggle button on 4 objects. The learner can choose between 1-4 of them before continuing. However, when I return to the page the objects they selected are back to normal.

    What is the action that is needed to ensure the ones selected retain?

    thanks

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

    You would need a variable to save which objects were visible when the user leaves the page:

    Create a variable, e.g. “obj_visible”.

    Add two actions to each of your objects:

    On: Show
    Action: Modify variable
    Target: obj_visible
    Type: Add to variable
    Value: a (for the first object, “b” for the second etc.)

    On: Hide
    Action: Modify variable
    Target: obj_visible
    Type: Subtract from variable
    Value: a (for the first object, “b” for the second etc.)

    Add 4 actions on page level:

    On: Show
    Action: Show
    Target: Object 1

    Condition:
    If “obj_visible” Contains “a”

    Else:
    Action: HIde
    Target: Object 1

    Repeat this action for each object and change the targets to Object 2, 3, 4 and the Condition to “b”, “c”, “d”

    Tim

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

You must be logged in to reply to this topic.