Explore the community Forums Lectora Lectora Questions & Answers Help with simple interaction, best practices example Reply To: Help with simple interaction, best practices example

#402646 Score: 2
Profile photo of Stan Miller
Stan Miller
LUC16 Attendee
wise owl
curious george
friend finder
LUC17 Attendee
38 pts

The basic problem is that nothing was triggering your Hide Prompt action at the top of the title explorer.

In the attached version, I’ve made the following changes:

  • Put that action inside a group. While it might seem weird to have a “group” with just one action, it allows triggering the action with a “Run Action Group” action.
  • Added an On Click > Run Action Group action to each of the buttons to run the new group.

That’s all that was strictly necessary to fix the problem, but I made one other change as well: I changed the “Add to Variable” actions to “Set Equal To” actions. This is safer when you just need to know whether a button has been clicked or not, because with an “Add to Variable” action, if the learner clicks the same button a second time, your variable equals 2 and the test fails. With a “Set Equal To” action, it doesn’t matter if the learner clicks the button once or 100 times, the variable is still 1.

One other note: As you get more advanced with Lectora, you may regret naming your variables VAR_Something. You can display the value of a variable on the screen by putting VAR(VariableName) in a text box or message, and having that look like VAR(VAR_QDC) might be confusing; there’d be similar confusion in JavaScript, in which you can pull in a Lectora variable value with a line like var x = VarVariableName, and seeing VarVAR_QDC would kinda make me nuts. Maybe that’s just me, though.

This post has received 2 votes up.
  1. Hide-Prompt.zip