Save Javascript Array to DB - Patch or new Module?

This forum post has been removed

Number of replies: 6
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Save Javascript Array to DB - Patch or new Module?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

One way to do this would be to turn your HTML + JS + CSS into a 'SCORM package'. If you do that, then your JavaScript can communicate with Moodle (or any other SCORM-compliant LMS) and store things like that array you want to store.

If you Google "SCORM tutorial" then that seems to find some things.

Average of ratings: Useful (1)
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Save Javascript Array to DB - Patch or new Module?

by Ray Morris -

The adlnet page you linked to has some samples.  Using their API javascript,  you could set and get suspend data like this:

doSetValue("cmi.suspend_data", yourdata);
yourdata = doGetValue("cmi.suspend_data");

Before getting and setting values, you have to do some setup work to initilaize the API connection.  See their samples for code you can copy-paste, then hopefully once you have it working you can look at it an understand a little bit about what it's doing.

 

Average of ratings: Useful (1)
In reply to Ray Morris

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.