Cannot retrieve previously saved data from LMS - SCORM 2004

梦想与她 提交于 2019-12-18 09:36:41

问题


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:

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.


回答1:


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.



来源:https://stackoverflow.com/questions/46008375/cannot-retrieve-previously-saved-data-from-lms-scorm-2004

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!