Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
828 views
in Technique[技术] by (71.8m points)

javascript - Cannot retrieve previously saved data from LMS - SCORM 2004

I'm trying to retrieve previously saved data from Moodle LMS but seems like something is not working. This is what I'm doing:

I load the SCORM (v2004) package into Moodle and perform some actions (like save navigation data or set completion status):

// Completion status always "unknown" at first time so I try to change it to incomplete:
API_1484_11.SetValue('cmi.completion_status', 'incomplete'); // "true"
...
API_1484_11.SetValue('cmi.location', '{"page":2}'); // "true"

Then later on commit these changes:

API_1484_11.Commit(''); // true

Request/Response:

Request

Response

When I leave and reenter the activity and try to retrieve this data again the API returns an empty string or the default initial value.

// I've already initialized the API at this point.
API_1484_11.GetValue('cmi.completion_status'); // "unknown"
...
API_1484_11.GetValue('cmi.location'); // ""

Am I missing something?

Do I need to call any other method to retrieve data from the server or something like that?

Or maybe I misunderstood the purpose of those methods?

I would appreciate any help on this topic. Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Commit is important. Make sure you are setting cmi.exit to "suspend". SCORM 2004 in moodle isn't probably full featured unless someone finished it. Last I heard the Dev working on it gave up. So you may be dealing with a SCORM 1.2 implementation. I'm on a mobile device so I hope that gives you enough hints to troubleshoot. Good luck.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...