Hi, does anybody know the javascript commands (activated by a trigger) needed to print out the content a scrolling panel (e.g. Scroll 1 ) in the attached screenshot (or even if this is feasible to do in the first place using Articulate Storyline)?
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.
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.
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.
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.
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
Thanks Sam for sharing here - and just an FYI that the link you shared seems to be gated with a login. If you're able to share the login here, that may help others who run across this thread and want to take a look at what you set up.
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.
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
Thanks for sharing your javascript in this forum. I have been successful in replicating your file with the script.
Now I am trying to have 3 variables (text input fields) appear in a table (1 row, 3 columns). I have the html to create the table but don't know how/where to include the variables. I have included the variable names in between <td> and </td> tags as placeholders.
Here is the what I have so far:
var player = GetPlayer(); var well = player.GetVar("W1"); var better = player.GetVar("B1"); var how = player.GetVar("H1");
var mywindow = window.open('', 'Printing', 'height=400,width=600'); mywindow.document.write('<html><head><title>Activity 1</title>'); mywindow.document.write('</head><body >'); mywindow.document.write('<h1>Activity 1</h1>'); mywindow.document.write('<h2>Purpose</h2>'); mywindow.document.write('<p>The purpose of this exercise is to</p>');
mywindow.document.write('<tr>'); mywindow.document.write('<th>What I did well</th>'); mywindow.document.write('<th>What I can improve on</th> '); mywindow.document.write('<th>How I am going to improve</th>'); mywindow.document.write('</tr>')
mywindow.document.write('<tr>'); mywindow.document.write('<td>var well</td>'); //var well is placeholder mywindow.document.write('<td>var better</td>'); //var better is placeholder mywindow.document.write('<td>var how</td>'); //var how is placeholder mywindow.document.write('</tr>');
mywindow.document.write('</table>');
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10 mywindow.print(); mywindow.close();
I am fairly new to ID work and admittedly know almost nothing about JavaScript. I am trying to allow users to print a scrolling text box containing notes from throughout the course. I have tried the code Sam provided above and did not have any luck with that - could totally be my error. I also was not able to access his link, which maybe just isn't active anymore since that was from a while ago. Are there any other suggestions or other places to look for help? Thanks so much.
Thank you very much Sam. Your explanation and the written example were very helpful as an inspiration.
However there is small problem with the printing of the model answers as they are not the input variables (I usually use a text box). How did you define the model answers in your Storyline?
26 Replies
Hi Julian,
Did you figure out how to do this? This is exactly what I am looking to do. Althought, I just have text in the scrolling text box.
Thank you,
Julie
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.
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
Thanks Julie for posting this in both threads to update people!
I'm having a similar problem, but cannot find a fix. I want to print the content from a scrolling panel.
window.print(); alone doesn't work.
I also tried the following to no aval:
window.print();
var name = player.GetVar("Variable2");
Would appreciate any advice
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.
I am having the same issue with the JavaScript not working I am using window.print(); as indicated in the Trigger elements but nothing is occurring.
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.
I have tried it in the LMS and it shows a blank page instead of the actual content on that slide.
Hi Helena,
You may want to post the Javascript code from your entire file here so that those in the community could assist.
Here is the file.
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.
Thanks Sam for sharing here - and just an FYI that the link you shared seems to be gated with a login. If you're able to share the login here, that may help others who run across this thread and want to take a look at what you set up.
I don't have a login for EduDesign but I did find he guest login.
http://samaree.com.au/moodle/mod/resource/view.php?id=58
hey Ashley, users can login as guest to access the resource- I've added that info to my post.
Thanks Sam for updating that and including a guest log in.
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.
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();
I saw that earlier and it was not what I was looking for, but thank you for trying. I was able to come up with a different solution for our project.
This post was removed by the author
Hi Melanie,
Would you be willing to share your solution? I'd like users to be able to print the contents of a scrolling panel in Storyline 360.
Thanks!
Anna
Hi Sam
Thanks for sharing your javascript in this forum. I have been successful in replicating your file with the script.
Now I am trying to have 3 variables (text input fields) appear in a table (1 row, 3 columns). I have the html to create the table but don't know how/where to include the variables. I have included the variable names in between <td> and </td> tags as placeholders.
Here is the what I have so far:
var player = GetPlayer();
var well = player.GetVar("W1");
var better = player.GetVar("B1");
var how = player.GetVar("H1");
var mywindow = window.open('', 'Printing', 'height=400,width=600');
mywindow.document.write('<html><head><title>Activity 1</title>');
mywindow.document.write('</head><body >');
mywindow.document.write('<h1>Activity 1</h1>');
mywindow.document.write('<h2>Purpose</h2>');
mywindow.document.write('<p>The purpose of this exercise is to</p>');
mywindow.document.write('<table style="width:100%">');
mywindow.document.write('<tr>');
mywindow.document.write('<th>What I did well</th>');
mywindow.document.write('<th>What I can improve on</th> ');
mywindow.document.write('<th>How I am going to improve</th>');
mywindow.document.write('</tr>')
mywindow.document.write('<tr>');
mywindow.document.write('<td>var well</td>'); //var well is placeholder
mywindow.document.write('<td>var better</td>'); //var better is placeholder
mywindow.document.write('<td>var how</td>'); //var how is placeholder
mywindow.document.write('</tr>');
mywindow.document.write('</table>');
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10
mywindow.print();
mywindow.close();
I will attach the SL file.
I am fairly new to ID work and admittedly know almost nothing about JavaScript. I am trying to allow users to print a scrolling text box containing notes from throughout the course. I have tried the code Sam provided above and did not have any luck with that - could totally be my error. I also was not able to access his link, which maybe just isn't active anymore since that was from a while ago. Are there any other suggestions or other places to look for help? Thanks so much.
Thank you very much Sam. Your explanation and the written example were very helpful as an inspiration.
However there is small problem with the printing of the model answers as they are not the input variables (I usually use a text box). How did you define the model answers in your Storyline?
Thank you Sam, a modified version of that script worked great for me. Now to figure out how to apply styles to it :)