Wednesday, July 26, 2017

E-Learning Challenge 174

Here is my attempt at the E-Learning Challenge #174

https://s3-us-west-2.amazonaws.com/hci-elearningchallenges/randomWord4+-+Storyline+output/story_html5.html

I’ve been following the Articulate e-Learning challenges for several years and decided it was finally time to jump into the water. The theme for last week's challenge was to use Javascript in SL to create random words. I developed this as something simple to showcase, but also to be usable in an introductory course for Healthcare Informatics. This will serve as a reinforcement of medical prefixes and suffixes.

Here is a link to the online version 
Here is a link to the original SL3 file

I added a JS trigger to a button on the Storyline slide. In the code below you will see that I created an array of medical suffixes and prefixes. The first fifteen words are suffixes and the rest of the words are prefixes. The program randomizes the words. Then on line 4 below, it retrieves the index value of the random word. This index value will tell us if the value of wordNumber is 0-14 (a suffix) or 15 and higher (a prefix). The conditional checking for which slide layer to display (correct or incorrect) is added to a button trigger event on the main slide.
  1. var player = GetPlayer();
  2. var words = ["algia","cyte","gen","graphy","ism","natal","oid","osis","penia","phobia","pnea","stasis",
    "uria","oma","ectomy","ab","circum","dia","dys","epi","extra","hemi","iso",
    "neo","pan","pre","retro","sub"]; 
  3. var wordChoice = words[Math.floor(Math.random() * words.length)]; 
  4. var wordNumber=words.indexOf(wordChoice); player.SetVar("randomWord",wordChoice); 
  5. player.SetVar("arrayNumber",wordNumber);


Credit:

1 comment:

  1. This is great Ron! Now I need to follow your steps! Thanks for taking the lead!

    ReplyDelete