Forum Discussion
Setting 'Results.ScorePoints' to equal my custom score variable
Dave and Ed,
The SCORM functions are available in different scopes in Flash and html5. In a Flash course the SCORM api is in the parent of the javascript scope and in html5 it's in the same scope. You can accommodate it like this:
var isFlash = typeof SCORM_APIFound === "undefined";
var api = isFlash? parent : this;
Then you can access the SCORM or Storyline functions like this:
api.SCORM_SetScore(currentScorePercent, 100, 0)
or
api.SetScore(currentScorePercent, 100, 0) //Storyline function that does the same thing
You can also set the status with the SCORM api or Storyline's versions of it like this:
api.ResetStatus() //sets it to "incomplete"
api.SetPassed() //sets it to "passed"
api.SetReachedEnd()//sets it to "completed"
api.SetFailed()//sets it to "failed"
Related Content
- 10 months ago
- 10 months ago