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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…