How to Get the Student’s Name and More in Flash AS2 from the LMS in a SCORM2004 Articulate Published Course

In my previous post, I talked about How to Get Slides Viewed in a SCORM2004 Published Course in Articulate and How to Get Last Slide Viewed in a SCORM2004 Published Course in Articulate. Besides this information, there is other information that you can get.

As was previously mentioned, we called SCORM2004_GetDataChunk (which calls cmi.suspend_data) to get the slides already viewed and to get the last slide viewed (which, by the way, auto-update every slide).

import flash.external.ExternalInterface;
var getData:Object;
getData= ExternalInterface.call("parent.SCORM2004_GetDataChunk");

If we replace “SCORM2004_GetDataChunk”, we can call other functions (see below). While I haven’t tested all of them, some of them may be of use to you. Not only can get GET these figures, most of them, we can also set. For coding, simply see the SCORM2004Functions.js file in the LMS folder.

  • SCORM2004_GetStudentName() which calls cmi.learner_name.
  • SCORM2004_GetStudentID() which calls cmi.learner_id.
  • SCORM2004_GetBookmark() which calls cmi.location.
  • SCORM2004_GetAudioPlayPreference() which calls cmi.learner_preference.audio_level.
  • SCORM2004_GetAudioVolumePreference() which calls cmi.learner_preference.audio_level.
  • SCORM2004_GetLanguagePreference() which calls cmi.learner_preference.language
  • SCORM2004_GetSpeedPreference() which calls cmi.learner_preference.delivery_speed
  • SCORM2004_GetTextPreference() which calls cmi.learner_preference.audio_captioning
  • SCORM2004_GetPreviouslyAccumulatedTime() which calls cmi.total_time
  • SCORM2004_GetMaxTimeAllowed() which calls cmi.max_time_allowed
  • SCORM2004_DisplayMessageOnTimeout() which calls cmi.time_limit_action
  • SCORM2004_GetPassingScore() which calls cmi.scaled_passing_score
  • SCORM2004_GetScore() which calls cmi.score.raw
  • SCORM2004_GetEntryMode() which calls cmi.entry
  • SCORM2004_GetLessonMode() which calls cmi.mode
  • SCORM2004_GetTakingForCredit()  which calls cmi.credit
  • SCORM2004_GetStatus() which calls cmi.success_status

How to Get Last Slide Viewed in Flash AS2 in a SCORM2004 Published Course in Articulate

In my previous post, I talked about How to Get Slides Viewed in a SCORM2004 Published Course in Articulate. This tutorial talks about how to get the last slide viewed.

import flash.external.ExternalInterface;
var getData:Object;
var lastVewData:String;
var lastVewData2:Array;
var arrVisited:Array;
var sVisited:String;
getData= ExternalInterface.call("parent.SCORM2004_GetDataChunk");
var getData2 :String;
getData2 = String(getData); // outputs string: "viewed=1,2|lastviewedslide=2|0#2##,3,11,1,1,1#0##-1"
lastVewData = getScore2.split("=")[2];
lastVewData2 = lastVewData.split("|",1); // reduces string into an array (lastVewData2[0]) of "2"

So, now I have the last slide viewed for a course published to SCORM2004 in Articulate.

How to Get Slides Viewed in Flash AS2 in a SCORM2004 Published Course in Articulate

So for one of my courses, I could not use the Restricted view because the course branched and I also wanted to allow some controlled branching at any time in case the user selected the wrong branch. Because of this later request, the Restricted Mode in Player Properties was problematic. So, I manually locked each slide using a global variable. However, it only worked if the person completed the course in one sitting. So if they were to break it into two sittings, I needed to retrieve the cmi.suspend_data from the LMS that contained the slides viewed. So with some help at the Articulate forums, I was able to figure it out.

import flash.external.ExternalInterface;
var getData:Object;
var susData:String;
var vewData:Array;
var arrVisited:Array;
var sVisited:String;
getData= ExternalInterface.call("parent.SCORM2004_GetDataChunk");
var getData2 :String;
getData2 = String(getData); // outputs string: "viewed=1,2|lastviewedslide=2|0#2##,3,11,1,1,1#0##-1"
susData = getScore2.split("=")[1];
vewData = susData.split("|",1);
arrVisited = vewData[0].split(","); // reduces string into an array of "1,2"

So, now I have an array (arrVisited) of all the slides viewed for a course published to SCORM2004 in Articulate.