Editing the report.html file isn't something we support, but there have been a few discussions on the forums that might help you accomplish this. You might want to take at these posts, here and here, if you haven't already.
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).
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"
7 Replies
Hi Joe,
Editing the report.html file isn't something we support, but there have been a few discussions on the forums that might help you accomplish this. You might want to take at these posts, here and here, if you haven't already.
Let us know how it turns out!
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(); USER ID: "+learnerID+"");
USER ID: "+learnerID+"");
var learnerID=player.GetVar("TextEntry").replace(/(\r\n|\r|\n)/g, '
');
document.write("
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("
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
Awesome, Joe! Thanks very much for sharing this information.
I hope you have a great day!
I'm also trying to do this, but am getting confused as to where/how I create the javascript name.
thanks,
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
Hi Joe,
see attached
Ryan
I've updated the report.html and attached it to this message. Try this one with the original Storyline file you posted above.
This discussion is closed. You can start a new discussion or contact Articulate Support.