At this time, I’m going to pause development of the VS SCORM 1.2 Run-Time Environment (RTE) since my implementation seems to work well enough for my purposes, and tidy it up for formal release as Rev 1.0.
As I noted in a previous post, I’ve made some significant changes to the code structure in order to move all database- and LMS-specific code to one place (the subs.php file), and to support multiple students/multiple SCOs.
These are the core components:
- The server-side API – written in PHP – consists of 4 scripts that initialize a SCO (initialize.php), read and write data elements in response to SCO requests (getValue.php and setValue.php), and finish the session (finish.php).
- The PHP API scripts communicate with the LMS server through database-specific, and LMS-specific code that’s contained in the subs.php script.
- Database login information is contained in the config.php file.
- There are 3 utility files provided in the package:
These allow you to run the code on a webserver without access to a real LMS.
|You can download the code bundle using this link.|
If you’re planning to use this yourself, you’ll have some editing and customization to do. Here’s what you’ll have to do:
- Install all the code on a web server somewhere.
- Create a database table called ‘scormvars’. How you do this will depend on what database you’re using – I used MySQL for these experiments, but that doesn’t mean that you have to do the same. The scormvars.sql file included in the code bundle contains SQL commands to set up a MySQL table. Modify it to suit your own needs.
- Edit config.php to include login information for your database.
- Edit subs.php to suit the database that you’re using – again, this was written for MySQL.
- Install your SCO and, if necessary, edit the rte.php file to point to it.
Now, when you access the index.html file, things should start happening. Here’s what it should look like when it’s running.
1. The utils/cleardb.php and utils/showdb.php files are both written for use with MySQL. If you plan to use them, you may need to translate them to suit the database that you’re using.
2. This is a technology demonstrator – not tested code – so please don’t blame me if you find bugs!