Browse the docs

Troubleshooting

The simulation isn't updating my Storyline variables

What to check when a simulation's results are not landing in your Articulate Storyline course variables.

On this page

Symptom

A simulation embedded in an Articulate Storyline course runs, but the course variables it should write (pass/fail, score, feedback, completion, or your own custom variables) keep their default values, so triggers that depend on them never fire.

Nothing on screen reports the problem. The learner can reach "Simulation complete." in the simulation while the course variables stay unchanged.

Cause

The simulation writes different variables at different moments:

  • Custom variables are written during the conversation, each time the character's response changes one.
  • The completion variable is written when the simulation ends.
  • Pass/fail, score and feedback are written only after the simulation ends and its evaluation finishes, and only when evaluation is turned on.

So if you are waiting on pass/fail, score, feedback or completion and the simulation never ends, those variables are never written. A simulation ends when the character decides one of its end conditions is met, or when the max turns limit is reached. A voice session also ends when the learner ends the call.

Every write also depends on the course side. The simulation sends each value to the slide that contains it, and the JavaScript trigger from the Publish stage writes the value into the Storyline variable with that name. If that trigger has not run on the slide, nothing is written.

Fix

Work through these in order.

The simulation never ends

Open the simulation and go to Design, then Simulation, and find Simulation Ending. Make sure the end conditions describe something the learner can actually reach, and turn on Enable max turns so the simulation ends after a set number of turns even if no end condition is met. In voice mode the turn limit applies only when Also enforce this turn limit in voice mode is also on.

If the browser console shows [devlin.ai] sendResultsToLMS: No sim results received yet. Make sure the sim has completed before calling this., this is the same cause: the simulation had not finished when the course asked for its results.

The JavaScript trigger is missing from the slide

In the simulation's Publish stage, open the Storyline 360 section and copy the code under Step 3: Add a JavaScript Trigger. In Storyline, on the same slide as the Web Object, add an Execute JavaScript trigger that runs when the timeline starts and paste the code. Without this trigger the simulation still sends its values, but nothing in the course receives them.

The variable names do not match

The simulation writes to Storyline variables by name. Under Step 2: Create Matching Variables in Storyline in the same section, the table lists every variable the simulation can write, with its type and default value. Create each one you need in Storyline with exactly that name.

If you rename a variable in Design, then Variables, update the Storyline variable to match.

The variable is not defined in the simulation

Only variables the simulation defines are written. Custom variables are set up in Design, then Variables, each with a description of when it should change. A variable that exists in Storyline but is not listed in the simulation is never written.

A True/False custom variable set to one-way (can only change to true, or can only change to false) is never changed back once it flips.

Evaluation is off, or the simulation is feedback-only

Pass/fail, score and feedback are written only when Enable evaluation is on in Design, then Evaluation. They appear in the variable table only in that case.

In feedback-only mode the pass/fail and score variables are never written. Branch your course on Sim_EvalComplete instead (or whatever you renamed it to).

If the evaluation itself fails, Sim_EvalComplete is set to the text failed instead of true, and pass/fail, score and feedback are not written.

The variable types do not line up

The simulation sends true and false as true/false values, numeric values as numbers, and everything else as text. Create each Storyline variable with the type shown in the variable table: the score is a Number, pass/fail is True/False, and feedback is Text.

Confirm it worked

  1. In the simulation's Test stage, run the simulation to its end. The Variables table under the preview shows each value as the simulation writes it. If a value never changes here, the problem is in the simulation's setup, not in Storyline.
  2. In Storyline, add a text box to the slide containing a variable reference such as %Sim_Score%, using your own variable's name. Storyline replaces it with the variable's current value while the course runs.
  3. Run the course and complete the simulation. The values on the slide should change, and the triggers that depend on them should fire.