Forum Discussion
Scorm 1.2 LMS communication and feedback using javascript and lmsAPI
An update to this challenge... I've managed to achieve most of what I want, fetching student data from scorm and submitting comments to cmi.comments, where they belong - using javascript-snippets like the following (please see attached story for full demo)...
JS snippet to get studentname from lms
var player = GetPlayer();
var lmsStudentName = lmsAPI.GetStudentName();
player.SetVar("lmsStudentName", lmsStudentName);
JS to write comments to lms
var player = GetPlayer();
var lmsComments = player.GetVar("TextEntry");
lmsAPI.WriteComment(lmsComments);
There are many more interesting lmsAPI functions, including .GetStudentID, GetStatus, SetScore - dig into the LMSAPI.js that storyline creates to find more...
I'm testing in scorm cloud and reload scorm player, with flash disabled, as I need this to work in HTML5 on tablets.
Largely it works - but - if I click the "fetch variables from lms" button, and thus executes the javascript that gets my studentname etc from scorm, the "submit comments" button stops working?
If I just click the js test popup buttons, there is no problem... So - I suspect, that something regarding GetPlayer og lmsAPI is not utilized or cleaned up correctly?
Any good ideas are greatly appreciated!
Bjarne
Thank You for sharing this file.