Storyline Simulation Scenario with Variables and Javascript

One of the rare projects at my current employer that allow me to use some thought, theory, education, skill, talent, and creativity. I’ve been increasingly beating Articulate Storyline into submission tricking it into looking like something a grownup would use with smoke & mirrors made of a combination of images from Photoshop and Illustrator. Using triggers in Storyline is an inefficient process to say the least but, eventually, after spending several times the hours it would take in Flash or straight JavaScript, you get something that no longer looks like a child’s toy.

A physician must respond to a patient’s wife who states her husband shouldn’t be discharged. A JavaScript random number generator determines whether the wife’s fears are valid. There are two initial branches, one of which leads to four more. At each stage, the random number generator checks to see if the patient strokes.

  • True = patient strokes
  • False = patient is (still) fine

I’ll let you guess how many crumpled pieces of paper died before this final version.

Start is the initial choice/branch. Does the doctor “ask” and listen to the wife’s concerns or say, “nope” and assure her the husband is just fine and can go home? The moral of the story is healthcare workers should listen to loved ones because they know the patient’s behavior and appearance better than anyone. They will observe or sense subtle, immeasurable indicators others can’t. It is possible the patient is fine and the wife is an anxious-ridden worrier but it is possible she’s picked up on signs the patient suffered a stroke. That all but undetectable stroke is beyond the doctor’s control and the learner/doctor is only severely penalized if the stroke occurs after some relatively stupid choices like:

  1. Learner/doctor initially tells the patient to go home
  2. They return 24 hours later when the wife continues to insist her husband should stay in the hospital.
  3. Learner/doctor still ignores the wife’s concerns.

In that case, even if the patient is fine (“You’re pretty damn lucky”), the learner is penalized for being a crummy doctor. Otherwise, if the patient strokes after being blown off twice, the learner is told, “You pretty much killed him yourself.”

The learner starts with zero points and there are 19 possible outcomes. The pink numbers are possible final scores ranging from -30 to +30. Blue-ish numbers are points added to the cumulative score as the game progresses.

  • n1=false are scores if the learner didn’t initially blow off the wife.
  • n1=true are scores if the learner initially blew off the wife but “asked” and listened when they returned.

Other possible consequences include a formal complaint against the physician.

Why so many triggers? Remember when I mentioned so many triggers? I didn’t want to make nineteen separate “Results” pages so I divided possible outcomes/responses into paragraphs placed on separate layers. Depending on the combination of variables/triggers, the different paragraphs appear. It may even have been easier to create the nineteen layers but I wanted to exercise my algorithm/programming muscles. The end result for the course and user is the same.

If it were written in straight JavaScript instead of using “triggers,” I could have used some relatively elegant “and” and “or” operators which would have made me happy.

I’d also be really happy if I could create my own functions/triggers and put all of them and all of the JavaScript code in one place. Like, you know, in Flash.


About jotascript

Aiming to please. Seeking to impress.
This entry was posted in elearning, JavaScript, myProjects and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s