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!
I am very interested in how your project has turned out so far. I have downloaded it and will try to get you feedback as I evaluate the code.
Pingback: Pragmatic eLearning » VS SCORM 1.2 RTE Rev 1.0 Available
this works great, but there is an error in the subs.php file. The function readElement in there is expecting only one var, but the call in getValue.php is sending two, causing no value to be retrieved from the db. I’ve changed readElement in subs.php to reflect this:
Now, on to more testing. Thanks for building this. I was dreading building an API from scratch.
actually…it was just that one call that was trying to pass two vars. The other readElement calls were fine, so I just removed the $SCOInstanceID from the call in getValue.php.
With those two modifications, all seems to be working well enough for me to begin integrating it with our LMS.
Thanks for spotting the error! I’ll post a revised version of the RTE code.
Thanks for spotting the error in getValue.php. I’ve posted a revised version of the code.
As for changing the return value of LMSInitialize(), section 188.8.131.52 of the SCORM 1.2 RTE specification (page 3-8) states that LMSInitialize should return a string – either:
So changing it to return a reference might have unexpected results.
thanks for letting me know of the SCORM specs. It worked either way, but I changed it back to “true” to be safe.
Thanks again for the great work. It saved me a bunch of time.
Pingback: Desarrollando un LMS(con soporte de SCORM)
I found a problem with the LMSGetValue();LMSSetValue(); functions
In ie7 there is a issue with Wininet.dll only supports 2 concurrent connections. This is by design:
Some code has to be done to solve this issue….!!!
I’m afraid that I’m not a Windows programmer, so I’m not quite sure what you mean. Could you provide an example of what happens?
Without knowing more about the problem, it’s difficult to offer any concrete advice. But, I did some quick research and came across this link – http://stackoverflow.com/questions/6049644/watin-hangs-on-aboutblank-for-multiple-concurrent-ie8-instances – which suggests that it’s a problem with the design of IE:
Sorry I can’t be of more help at this time.