How to Get Lectora Game Templates to Send Score Results to Your LMS

The Game Templates at eLearning Brothers have tons of fun and exciting interactions to add to your Lectora projects. These are great as stand-alone tests, but with just a little customization, you can use them to pass a score to your LMS, set up customized results, or set branching content within Lectora.

To give the Flash score to Lectora’s AICC_Score variable, both the Lectora and Flash files need to be modified to ‘talk’ to each other. The Lectora page needs to have a new variable declared on the page, and Flash needs to have the correct “ExternalInterface.call” setup in ActionScript.

Let’s start with a Lectora variable, in this case I called it “Tempscore” and I’ll use it to capture the Flash score. I set up a text box (temp2) and ran an action (setUp) to change the contents of the text box with the value of the variable “Tempscore.”

This is important since just creating the variable in the Lectora Variable Tool will not make it “visible” on that page. The text box can have white-on-white text, or be covered by the Flash file; anything is fine to hide it from the viewer.

I also made an action to run a group; we’ll call this action in the Flash later, so it’s in a group (setScore) to keep it from running on the show of page. By clicking the small arrow in the lower right of the actions box, we see the action number (action12999).

Note: I rename the action with a number, so it’s easy to match without having to open the action description again.

The “complete” group contains an action to set the AICC_Score variable to our “Tempscore” variable.

We could as easily set a test score, or in the case for our other action in the group, go to a “congratulations” page if the score is equal to or greater than 80. Another action can be set to take the user to a “sorry” page and have them take the quiz again if they do not pass.

Now for the Flash. For Game Templates like the GameShow template, the “Actions: Frame 1” ActionScript needs to be modified as shown below:

function sendScoreToSCORM(scormScore)

{

ExternalInterface.call(“VarTempscore.set”,scormScore);

ExternalInterface.call(“action12999”);

}

This sets the “Tempscore” variable to the final Flash quiz score, and runs the action in Lectora (action12999) that runs the group to set the AICC_Score and go to completed/failed.

It should be noted that the ActionScript variable name to be set can vary in different interactions; in this case it’s the “scormScore” in ExternalInterface.call(“VarTempscore.set”, scormScore);. This can usually be found on the last “Actions : Frame #” of the interaction.

With this basic concept, the ability to set up actions or results in Lectora based on the score in Flash is unlimited; let your imagination go!

Note: By the way you can do this trick with our HTML5 Games or by using our Lectora Game Templates built natively in Lectora.

————————————————————————————————————————————

Some eLearning Games can take days, or even, weeks to develop. Save development time with our eLearning Game Templates. Click the button below to learn more.

eLearning Game Templates