In Need of Button Tips/Tricks

jcristol
jcristol Community Member Posts: 11
I'm creating training where the user is going to have to select an image and when they do they will be taken to that section in the training. When they are done with that section they will be returned to the main page and it is here I want the button (or the image--whatever I decide) to be set as disabled. I tried doing it by modifying the variable but I must be doing something wrong. Each time I go back to the main page that button appears (aka, not disabled). How can I make it stick? Same goes for if I want a certain image to appear well after they've left the main page but come back to it.

I'm lost. Please help!

Comments

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    1. Create a variable called "visitedChapters", default it to 0.



    2. In each chapter, add an action on the first page: [Modify variable "visitedChapter" - ADD - "a" (one letter)]

    Use a separate letter for each chapter (I hope you have less than 26 chapters :)



    3. On the landing page with all the buttons, add the following set of actions:

    -- Hide Button1 IF visitedChapters contains "a"

    -- Hide Button2 IF visitedChapters contains "b"

    -- Hide Button3 IF visitedChapters contains "c"

    -- Hide Button4 IF visitedChapters contains "d"

    and so on.



    Of course, instead of hiding an image or a button, you can do anything else, e.g. show a "visited!" overlay on top of it, or change its state to Disabled, etc. But the principle remains the same - you use a single variable and letters to track visited chapters and then fire actions based on what letters have been added to the tracker variable.
  • jcristol
    jcristol Community Member Posts: 11
    Thank you so much for your help. The directions were very clear and I got it to work. I can't thank you enough! :o
  • rgs55
    rgs55 Community Member Posts: 38
    And just a little side note to Sergey's explanation, in the unlikely event you have more than 26 chapters (and hopefully no one builds a course with 26 chapters!!), you can use a delimiter to separate your identifiers. I got into the habit of using an underscore to separate my values. Then I look for a_ or b_. This also gives me the flexibility of using numbers vs. letters without Lectora seeing them as numbers.
  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    I've actually seen a course with more than 900 pages. Can't remember how many chapters it had though. Using delimiters is a great idea. Here's my previous setup modified to use Roz's idea:
    1. Create a variable called “visitedChapters”, default it to 0.

    2. In each chapter, add an action on the first page: [Modify variable “visitedChapter” – ADD – “_a_”]. One underscore, one letter, one underscore again. Or two letters, or even three. Anything, really, as long as it begins and ends with an underscore.

    3. On the landing page with all the buttons, add the following set of actions:
    — Hide Button1 IF visitedChapters contains “_a_”
    — Hide Button2 IF visitedChapters contains “_b_”
    — Hide Button3 IF visitedChapters contains “_c_”
    ...
    — Hide Button27 IF visitedChapters contains “_aa_”
    -- Hide Button190 IF visitedChapters contains "_intro_"
    and so on.

    Of course, instead of hiding an image or a button, you can do anything else, e.g. show a “visited!” overlay on top of it, or change its state to Disabled, etc. But the principle remains the same – you use a single variable and underscore-separated letters to track visited chapters and then fire actions based on what letters have been added to the tracker variable.
    NB! Since Lectora stores retained variables in SCORM format, and SCORM 1.2 only allows for 4Kb of text (that's just 4096 characters for ALL variables and ALL their content, including question variables that will contain learner answers!), use the above system sparingly.