No emailing quiz results in Storyline?

May 15, 2012

Hi all.

I realise that Storyline doesn't report Scorm results when used in an iPad, but I thought I could just email the percentage or that fact that they completed to an email address, and 'Complete' them manually in the LMS.

Unlike Quizmaker, there doesn't seem to be an option for this. Anyone found a way around this?

76 Replies
Jamie Morgan

Hi Jacinta,

I use the "Jump to URL/File" trigger. I just build a "Course Completion" button on the slide with instructions on how to receive course completion (see image below). In the trigger itself, simply type:

mailto:WhateverName@domain.com?subject=

I usually will put the course name in the subject so then I know they completed the course when I get an e-mail from them with that subject line. This won't help you with receiving a percentage score but would be a way to do completion via an iPad. This does work, I've tested it inside the Mobile Player on the iPad.

Kevin Thorn

Courtesy of Steve Flowers from an older conversation. You could use the Execute Javascript to send an email:

*******************

//create a player object

var player=GetPlayer();

var userEmail=GetVar(“emailFromStoryline”);

var userScore=GetVar(“scoreFromStoryline”);

//construct the link

var link= userEmail

    +"&subject=" + encodeURI

 ("Course Completion!")

    +"&body=" + encodeURI

 ("Congratulations! Your score for thiscourse is"+ userScore +".");

window.location.href= link;

********************

Just another idea.

Chris Fletcher

I've got it... in a very basic way:

var player = GetPlayer();

var yourData1=player.GetVar("yourVariable");

window.open('yourasporphpwebpage.com?email='+yourData1);

Then you can create a page at the other end in asp/php that reads the data from the url and writes it to your database. I already have a file that works, so I just need to adapt it to work for this. You can add other variables by creating variables and calling them from your storyline variables, then putting '&anotherVariable' +yourData2 and so on after yourData1 in the window.open  command.

Peter Brown

I think I'm right in saying that the iPad Mobile App player isn't as comprehensive/competent in the Javascript that it will run as the Flash story output (please correct me if I'm wrong here). But the code that you've supplied, Chris, does it run on iPad mobile player happily?

If so, does it work OK, I wonder, it the story and the asp page are on different servers - do any pesky pop-ups or cross-domain warnings appear? 

Kevin Thorn

Hi John,

Welcome to the forums!

One way to achieve what you're looking to do is really quite simple. As you mentioned, insert a button to your Results screen.

That's the easy part. The question I have for you is what is on the external HTML page? If it's just static text and/or information, just add a trigger to the button you added on the Results screen with: "Jump to URL/File > [nameofpage.html] > when user clicks > 'this' button. There are two ways to point to that HTML page - 1) Relative, or 2) Absolute.

  • If it's Relative, you'll need to add that HTML file after you publish you project and insert the file in the root directory where your story.html file lives. 
  • If i'ts Absolute, include the entire http:// path to your button's trigger. This of course would mean the page you're wanting to direct users to is already a published page on a web server.

The next question if I understand  your question you are wanting to pass the results from your Quiz out of your project and then display those results on your own custom HTML page. This is also possible, but it involves javascript and some CSS styling. Where the javascript would pull your quiz variable results into the HTML page and the CSS would style it in a format that's readable.

Hope this helps.

Kyle Young

Hello. I am wanting to do something similar to the first post: Send an email to a specific address when the user passes or fails. The email will communicate the users name, the course name and the results . Ideally Id like this to be automatic.

I tried using the send email but it was just  blank. I can see that you can use the Jump to URL/File and some code has been provided above but I am not a developer so am not sure how i could create this. Any help would be great.

John Basco

Kevin Thorn said:

Hi John,

Welcome to the forums!

One way to achieve what you're looking to do is really quite simple. As you mentioned, insert a button to your Results screen.

That's the easy part. The question I have for you is what is on the external HTML page? If it's just static text and/or information, just add a trigger to the button you added on the Results screen with: "Jump to URL/File > [nameofpage.html] > when user clicks > 'this' button. There are two ways to point to that HTML page - 1) Relative, or 2) Absolute.

  • If it's Relative, you'll need to add that HTML file after you publish you project and insert the file in the root directory where your story.html file lives. 
  • If i'ts Absolute, include the entire http:// path to your button's trigger. This of course would mean the page you're wanting to direct users to is already a published page on a web server.

The next question if I understand  your question you are wanting to pass the results from your Quiz out of your project and then display those results on your own custom HTML page. This is also possible, but it involves javascript and some CSS styling. Where the javascript would pull your quiz variable results into the HTML page and the CSS would style it in a format that's readable.

Hope this helps.

Thank you very much for your reply. Yes I want Relative, However I don't know about javascript. I will be very happy if you or somebody can give me an example on how to make it work.

Rohan  K

Chris Fletcher said:

I've got it... in a very basic way:

var player = GetPlayer();

var yourData1=player.GetVar("yourVariable");

window.open('yourasporphpwebpage.com?email='+yourData1);

Then you can create a page at the other end in asp/php that reads the data from the url and writes it to your database. I already have a file that works, so I just need to adapt it to work for this. You can add other variables by creating variables and calling them from your storyline variables, then putting '&anotherVariable' +yourData2 and so on after yourData1 in the window.open  command.


Hey Chris,

Did you manage to try this out? Did it work?

I wonder if instead of window.open we can call a javascript function which uses jQuery to make an ajax call to the PHP script?

1. It'll eliminate a popup window (less popups are always good)

2. It'll (somewhat) hide the URL of the php script from the user

What do you think?

Chris Fletcher

Hey Omar,  this is what I've done, and it seems to have worked for me:

create variable called result

Add a text field for user to enter email address.

Create variable for the text field value called emailAddress

Create trigger to change result to same value as Results.ScorePoints

Create a button that says "submit"

Create a trigger to execute the following javascript

var player = GetPlayer();

var course="Storyline test course"

var email=player.GetVar("emailAddress");

var score=player.GetVar("result");

window.open('http://yourAsporPHPFile.asp?email='+email+'&course='+course+'&score='+score, '_top');

So I guess if you replaced Result.ScorePoints with Result.ScorePercent, it would work.
Jacinta Penn

I'm so glad this post has helped other people.  i gave up on this idea because I didn't think the javascript would work on an iPad.  Turns out my LMS can track Storyline courses on iPad when published in HTML5 so I'm sweet anyway.  (I had panicked because of the support stuff saying any LMS needing a secure login wouldn't work for iPad)

But for future clients who don't want an LMS this thread will be invaluable.

Admin Rehoba

Hi,

Just to clarify something: the code you posted there:

var player = GetPlayer();

var course="Storyline test course"

var email=player.GetVar("emailAddress");

var score=player.GetVar("result");

window.open('http://yourAsporPHPFile.asp?email='+email+'&course='+course+'&score='+score, '_top');

doesn't seem to work in the Flash output. However, it works ok in the HTML5 output.

Is that what is expected ?

Thanks

Kelly Keck

I've tried to email results, using the following code:

var score = player.GetVar("Results.ScorePoints");
var email="kelly@mycompany.com";
var subject="Course Name Results";
var body_start="I've completed the Course Name 101 course with a score of ";
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start+score;
win=window.open(mailto_link,'emailWin');

And yet nothing happens when I click Submit in the published version. Not sure what I'm missing... (Admittedly, I'm not that familiar with Javascript.)

Chris Fletcher

It appears you are correct, it doesn't work with Flash, only with the HTML5 version.

Kelly, this is the same issue you are having. I've tested your code, and it works fine with the HTML5 version. but nothing happens in the Flash one. So I guess if you have new enough browsers to run the HTML 5 version, it wont be a problem, but otherwise, it's a case of back to the drawing board...

Chris

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