7 Replies
Joe Slawski

Thanks, Christine!

I actually found Steve Flower's examples in this post most helpful: http://community.articulate.com/forums/t/12471.aspx

For anyone interested, here's what I did:

1. Create a TextEntry field in your Storyline file. For our purposes, I created one with the variable 'TextEntry' which I used to capture our User ID.

2.  Add the Quiz slides.

3. Add a Results slide and enable 'Allow User To Print Results' (found under 'Edit Results Slide > Options').

4. Publish the Storyline file.

5. Open the folder that contains the published Storyline files and double-click on the 'story_content' folder.

6. View the 'report.html in a web page editor or Notepad.

7. Find the following code:


var g_oContentResults = window.opener.g_oContentResults;
var g_listQuizzes = window.opener.g_listQuizzes;
var g_oPrintOptions = window.opener.g_oPrintOptions;


and add the following right after the last line (bolded text is for emphasis):

var player=window.opener.GetPlayer();
var learnerID=player.GetVar("TextEntry").replace(/(\r\n|\r|\n)/g, '
');
document.write("

USER ID: "+learnerID+""); 


It should now look like this (bolded text is for emphasis):




var g_oContentResults = window.opener.g_oContentResults;
var g_listQuizzes = window.opener.g_listQuizzes;
var g_oPrintOptions = window.opener.g_oPrintOptions;
var player=window.opener.GetPlayer();
var learnerID=player.GetVar("TextEntry").replace(/(\r\n|\r|\n)/g, '
');
document.write("

USER ID: "+learnerID+""); 

 As you can see (bolded text), I created a unique Javascript name learnerID and added the Storyline variable TextEntry. You can update both of these to reflect your project, but just make sure that the Javascript name is updated in both bolded places above.



The USER ID: is my label for the collected information. You can change this to whatever you want, and it's not case-sensitive.



IMPORTANT: If you publish your Storyline file again, it will overwrite this report.html file, so make sure you make a back up and copy it to the 'story_content' folder.


 

9. Save the 'report.html' (overwrite the existing copy).


10. View your published Storyline file and then click the 'Print Results' button. The information you captured now appears at the top of the 'Print Results' page.



You can experiment with the placement of the text on the 'Print Results' page. I've also added a print button to mine (due to our requirements).



I hope this helps
 


Ryan O'Shea

Hi Joe,

thanks for your help. Attached is the file I'm trying to get the variables to transfer to. The report.html file is the default one right now, if I transfer your above code and change the variables all I get is a white screen after hitting "print results"

thanks,

Ryan