19 Replies
Ashley Terwilliger

Hi Julian, and welcome to Heroes! 

Although we don't support the coding of Javascript, I wanted to point you to this article of best practices and some examples to get you going. There are also a number of community members who are well versed in Javascript and they may chime in here and be able to help you out. 

Julie Holland

Ashley and Julian,

Thanks for the replies!  I decided to go a different route.  I’m working with our IT department to create a hidden folder on our network that only has “Read” access.  I’m going to create a slide at the end of each path in my branching scenario that has a triggered button or hotspot (see image below) which will launch the user out to a file.  I’m creating my feedback documents in Word and then going to .pdf them so the user can Save or Print them.

I wish there was an easier way to Print (and email) content that is located on slides in Storyline.  I hope they add this type of functionality to future Storyline updates.

Thank you,

Julie

Ashley Terwilliger

Hi Sam,

This thread is a bit older, so I'm not certain if folks are still subscribed but you may want to begin by reviewing the Javascript trigger elements here and then sharing a bit more of your file so that folks in the community could take a look as it's not something we can offer support for. 

Ashley Terwilliger

Hi Helena,

Are you testing the published output in the intended environment? I know that's a common hiccup, as the Javascript won't work when you're viewing the content locally. If you're not ready to place within your web server or LMS you could look at using one of the options here or SCORM Cloud. 

Sam Ozay

Hi all, my colleague helped me with an amazing javascript that allows you to print scrolling panels. The scenario in my slides is as follows: Students are presented with a question and a text field to enter their response. The next slide shows them a model answer and their response from the previous slide, WHICH THEY CAN PRINT. And it doesn't matter how long the texts are- it will print all. The javascript is as follows: (please note the 2nd and 3rd line- i.e. text1 and variable1- these must be changed accordingly. Good luck. 

var player = GetPlayer();
var modelAnswer = player.GetVar("text1");
var yourAnswer = player.GetVar("variable1");

var mywindow = window.open('', 'Printing', 'height=400,width=600');
mywindow.document.write('<html><head><title>Printing</title>');
mywindow.document.write('</head><body >');
mywindow.document.write('<h2>Here is the Model Answer</h2>');
mywindow.document.write(modelAnswer);
mywindow.document.write('<h2>Here is Your Answer</h2>');
mywindow.document.write(yourAnswer);
mywindow.document.write('</body></html>');

mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10

mywindow.print();
mywindow.close();

Here's an working example: http://samaree.com.au/moodle/mod/resource/view.php?id=58

Please login as guest to access the above resource.

Melanie Connolly

Was anyone able to find a (fairly) simple way to do this? I have a bunch of charts with user input variables combined into a scrolling panel on a final slide, but using print.window only prints the portion of the scrolling panel seen. I would like to have a print option for an instructor to look at and grade a student's entire process over the several previous slides, but I can't get everything within the scroll panel to print.

sam oz

If you just read the threads, I posted a solution ages ago. But here it is again especially for you:

The javascript is as follows: (please note the 2nd and 3rd line- i.e. text1 and variable1- these must be changed accordingly. Good luck. 

var player = GetPlayer();
var modelAnswer = player.GetVar("text1");
var yourAnswer = player.GetVar("variable1");

var mywindow = window.open('', 'Printing', 'height=400,width=600');
mywindow.document.write('<html><head><title>Printing</title>');
mywindow.document.write('</head><body >');
mywindow.document.write('<h2>Here is the Model Answer</h2>');
mywindow.document.write(modelAnswer);
mywindow.document.write('<h2>Here is Your Answer</h2>');
mywindow.document.write(yourAnswer);
mywindow.document.write('</body></html>');

mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10

mywindow.print();
mywindow.close();