Hi all,
I'll try and provide a full working demo soon, but just thought I'd give a few more elements here, it should already help a lot.
Before I get into it, just a small disclaimer - I hope you understand :-)
PLEASE NOTE THAT THIS IS A GUIDANCE NOTE, NOT FULLY TESTED CODE. YOUR DEV TEAM MAY WANT TO MAKE AMENDS TO SUIT YOUR ENVIRONMENT.
What you need is listed below:
1. On result slide: add a trigger that fires either on time line starts or whatever is most relevant to your setup. The trigger should execute a JavaScript code which would look a lot like the below:
function sendToServer (var) {
$.ajax({
url: '//www.yourserver.com/path_to_php/file.php',
type: 'POST',
data: {"param1":var},
dataType: 'script',
success: function(response) {
// do something...
Expand
Hi all,
I'll try and provide a full working demo soon, but just thought I'd give a few more elements here, it should already help a lot.
Before I get into it, just a small disclaimer - I hope you understand :-)
PLEASE NOTE THAT THIS IS A GUIDANCE NOTE, NOT FULLY TESTED CODE. YOUR DEV TEAM MAY WANT TO MAKE AMENDS TO SUIT YOUR ENVIRONMENT.
What you need is listed below:
1. On result slide: add a trigger that fires either on time line starts or whatever is most relevant to your setup. The trigger should execute a JavaScript code which would look a lot like the below:
function sendToServer (var) {
$.ajax({
url: '//www.yourserver.com/path_to_php/file.php',
type: 'POST',
data: {"param1":var},
dataType: 'script',
success: function(response) {
// do something...
Expand
Hi all,
I'll try and provide a full working demo soon, but just thought I'd give a few more elements here, it should already help a lot.
Before I get into it, just a small disclaimer - I hope you understand :-)
PLEASE NOTE THAT THIS IS A GUIDANCE NOTE, NOT FULLY TESTED CODE. YOUR DEV TEAM MAY WANT TO MAKE AMENDS TO SUIT YOUR ENVIRONMENT.
What you need is listed below:
1. On result slide: add a trigger that fires either on time line starts or whatever is most relevant to your setup. The trigger should execute a JavaScript code which would look a lot like the below:
function sendToServer (var) {
$.ajax({
url: '//www.yourserver.com/path_to_php/file.php',
type: 'POST',
data: {"param1":var},
dataType: 'script',
success: function(response) {
// do something like create a success alert
// or depending on your scenario, do nothing here
}
});
}
var player = GetPlayer();
var1 = player.GetVar("variable_used_in_course");
sendToServer (var1);
This code creates a function called sendToServer that makes the call to the server, and then grabs the value of a parameter you are using in your course (maybe the user's score - this is very well documented in this forum) and executes the function. This code should of course be tailored to your own scenario: for example, you may need more than 1 variable, you could also use cookies, etc. I kept it simple here. Also note that there may be some small syntax errors but this is more to give an idea than a working piece of code
2. On the server side, you should have a php file, that handles the request being sent by the course.
This file should sit at the URL you specified in the JS code (in my example:
www.yourserver.com/path_to_php/file.php) and essentially will do something like this:
3. Finally, the JS code relies on jQuery, so you need to reference the standard jQuery library somewhere. I find the easiest is to do that by adding a line of code to the story.html file, once the project has been published in articulate (locate the file, edit it with and editor, and add the code below) :
Hope that helps,and will try to generate a full working demo in the next few days if I have time.
Cheers