Where to put a Javascript call that saves course marks

Feb 06, 2015

Hi,

I am helping a client. I wrote JavaScript to save course information from an Articulate Course another lady created. The course contains a form where the user types in their name and basic contact information. On the Results slide, I have set some variables to hold the ScorePercent value, PassFail, and ScorePoints which we are saving to a database. My script works when I make a mini-version of the course and call the JavaScript on a button click on the Results page. However, I notice in the clients version of the course, the JavaScript is being called on the Next Button click of the slide before the Results Slide. I have it set up on the Results Slide to call the JavaScript when the last variable has been set. My code isn't working and I put in some alerts, and I can see the variables set to hold ScorePercent, PassFail, and ScorePoints are not being filled before the JavaScript is called. I guess my question is, is there a correct place and way to call JavaScript from the Results slide that will result in this information being captured? 

3 Replies
Russ Sawchuk

Hi Melanie,

I have the same set-up where I capture the same data in a SL game and send it to a MySQL database table. My JavaScript code is the last one on the Results Slide. The JS is executed when the user clicks on the Exit Game button ( which I have added).

It has been working great for over two years now. Recently I have added some additional information to the PHP code that sends the data to the database table. I now capture date and time the game was completed as well as the IP of the people doing the game.

Let me know if you need more details.

Russ

This discussion is closed. You can start a new discussion or contact Articulate Support.