Here are a couple options:
Option 1 - Quick way to commit SCORM-compliant data to Moodle if the SCO is already loaded in Moodle: mod_scorm_insert_scorm_tracks web service. Here's info. from the Moodle Tracker: Detail on mod_scorm_insert_tracks
- The SCORM course/content must already be loaded to Moodle so it has a SCO ID in the Moodle DB - data passed is related to a specific SCO ID.
Option 2: If needing to build a SCORM-compliant course/content experience from scratch:
- High level, the content/course experience is typically developed as a SCORM-compliant content package and programmed to communicate SCORM-compliant course progress data to the LMS via the SCORM API. The SCORM API is provided by the LMS (Moodle in this case) and is in javascript.
- Your course/content needs to include standard SCORM files like imsmanifest.xml and must be loaded as a SCORM package to Moodle. Once it is loaded to Moodle, you'll have a course ID/SCO ID/etc. that you can use when passing data for it.
- The data sent from the content experience/course must conform to the SCORM data model for whatever version of SCORM you choose to use (e.g. 1.2, 2004, etc.)
- The content/course must include code to correctly locate and use the SCORM API JS object(s) that is used to pass/receive data.
- The SCORM JS objects are provided by the page in the LMS used to play back the course/content (sometimes called "the player" or "player window"). In Moodle, this is handled by mod/scorm/player.php.
- The player.php file in Moodle loads the SCORM JS API when the page is rendered, making it available to the course. The course file then calls the objects/functions/etc. that pass the data.
- The exact API object your content will use to send/receive data depends on the SCORM data model version you are using. Content/courses can pass data that is compliant with any version of SCORM, but must use the API object for that version in order to ensure the data is handled correctly.
- In Moodle, the objects are available in mod/scorm/datamodels/ - there are also PHP files in there which get/set data and are called by player.php depending on the version of SCORM used by your content.
- Here's additional detail on the runtime API: SCORM runtime detail
Alternately, there are course authoring tools like Storyline, Captivate, Elucidat, Lectora, etc. which package content to automatically communicate SCORM data. These are great for many types of content.
Good luck with it!