Displaying variables inline text

Apologies if this has been covered and please point me to a resource as Google isn't helping :-)

I was just handed Lectora 16 with the task of creating a template for coworkers. I've been around in the e-learining world for a while, but have either used Authorware (yes I am old) or strictly Flash (its what a client spec'd).

The template is for others to use so I am trying to make it reusable.

Anyway, I am trying to display custom variables in text blocks and having odd results.

I am setting the variables on each page, but on the first pass they aren't displaying on the correct page.

Hard to explain so I attached the sample file with comments on each page to explain.

Discussion (2)

That seems weird. Logic to me says if the variable is changed/set prior to the display in-line on the page it should use the current value.

It seems that inline variables are replaced first, before actions on the page are run to modify the variables. That would explain why it's using the variable value, set on a previous page. This has probably been made to ensure that the reference (VAR(your_variable)) is not visible to the users. The inline reference is not kept in sync with the variable, it is only replaced once on page show. Inline variables seem to have been designed for variables that don't change while on the page, e.g. VAR(CurrentPageName). This would explain why the header of your popup shows the initial value of the variable (inserted on page show even if it's invisible) but doesn't change on click of one of the buttons.

If you want to change text on click, you'll have to use a Change Contents action. A good way to do that (I believe) is the way you've integrated for the popup text, by running the Change Contents action when the popup is shown. If you wanted to change the content before the popup is shown, you can put the Change Contents actions and the action to show the popup into a group (on title level) and "Run action group" with an action on each of your buttons. You can add a short delay to the Show action to make sure the contents have been changed before the popup is visible.

Tim

Discussions have been disabled for this post