Shared action to track State Number

Intro

In this post you can find a Captivate tutorial, illustrating 4 use cases where the state number was tracked and used to find a solution.

This post will explain the setup of one Shared action to track the state number, when a multistate object is clicked to advance to the next state. To explain I will use the first two (physics) use cases. The first one has 3 identical multistate objects, with 3 states, and two possible correct answers:

The second one has 4 identical multistate objects with 4 states, multiple correct answers are possible:

You can find one of the correct answers in those screenshots. The workflow will be described step-by-step.

Workflow 

Events

Both use cases have:

  1. Success event of the multistate objects which are used as buttons. These events will be used to advance to the next state and to fill a variable with the tracking number. The index start with 1, which means that the Normal state is state 1. Being this the only goal of all the multistate objects in both use cases, the use of a shared action is recommended over duplicated and edited advanced actions. The shared action will be labeled StateNumberAct.
  2. The Success event of the Submit button. The action triggered by this even will have two goals: first to check the answer, second to show the Next button if the answer is correct. For a wrong answer the learner can have another attempt at changing the states and submitting the new situation. Those actions are advanced actions, labeled SubmitAct_3 and SubmitAct_4. They are similar but not identical.
  3. The Success event of the Next button when it appears which is the Default 'Go to Next Slide'.
  4. The On Enter event of the slides which is a Reset action for the slide. These advanced actions are similar but not identical, and they are labeled EnterThreeStates and EnterFourStates. 

Variables

Each multistate object needs an associated variable to store the tracking number. Since that number will be used only on the same slide, the variables can be reused. They will be reset with the On Enter actions. The four variables are labeled v_1, v_2, v_3 and v_4 (only needed for the second use case). If you are a fan of my blog, you may remember that I have those variables in a shared action in my general library to be used as external library. See Creation of Variables.

For the shared action StateNumber Act an extra variable v_states is used to store the number of states in the multistate object. The value of this variable will be defined by the On Enter action of the slide.

StateNumberAct (shared action)

This action will be triggered by the Success event of each multistate object used as button:

It is a two-decision action. The value of the tracking variable (used as parameter 2) is defined by incrementing, while the command 'Go to Next State' is done on the multistate object. The second conditional decision checks if the maximum number of states is reached (stored in v_states) and resets the tracking variable to 1 in that case. The first parameter is the multistate object used as button, which is a compulsory parameter contrary to the variable which is a candidate parameter, needs to be indicated to be a parameter.

Sequence of States

The state numbers will be used to check for a correct answer in combination with mathematical operators. For that reason there is no arbitrary choice:

Use case with 3 states

It has two correct answers, left side of the equation sign needs always to be 'Force'. I choose this to be state 3.

To the right side of the equation sign it can be 'Area x Pressure' or 'Pressure x Area'. Those are in state 1 and 2, sequence less important. Reason: check for correctness will calculate the sum of the tracking variables to the right of the equation sign, which needs to be 3. That lead to a very simple condition. Try to figure it out, or wait for the next blog post.

Use case with 4 states

This is bit more complicated. Similar to the 3 state case, we can calculate the sum of the state numbers to the left and the right. This leads to a sequence of state numbers as shown in the screenshot at the start. In all cases that sum will result in '5', because it will be either '2+3' or '1+4', in all correct answers symbolized in this list:

  • 2+3 = 1+4
  • 3+2 = 1+4
  • 2+3 = 4+1
  • 3+2 = 4+1
  • 1+4 = 2+3
  • 4+1 = 2+3
  • 1+4 = 3+2
  • 4+1 = 2+3

However there is a 'booby trap' here! Because the condition based on the sum will also result in correct when the states on the left and the right side are identical. Example: 2+3 = 2+3 which is not a correct answer. More is needed than the simple sum condition. Any idea? Find the solution in the next blog post.