I imagine the computer doesn't know where to find the printCertificate.html file, as it relates to the location from which the course is running. You might try uploading the certificate page to a web server then using a WebObject. People tend to have better luck with this approach
The other responses are accurate. The html file location isn't specified or isn't found in the location specified. Additionally, this code is written to put the name and date in the url and not the actual certificate. I assume you are trying to print a certificate with the name and date in it? Do you have a .story file you can share so we can see what you are working with and trying to accomplish?
After a search on the html file name you mentioned, I'm assuming you were attempting to use the template from the "New Freebie! Storyline Print Certificate template" discussion here.
I've recently been playing around with using JavaScript to generate printable notes in a pop-up HTML window, so I thought I'd apply it to your problem.
I couldn't get your shared file to open as I'm still using Storyline 2, but see the attached file and code shared below to see how it works.
Note: This will produce only a solid black border around your "certificate" instead of the more stylized one from the freebie, but should do the work fine.
var player = GetPlayer();
// COURSE NAME FROM PLAYER var courseName = player.GetVar("courseName");
// LEARNER NAME FROM LMS (SCORM 1.2 version) //Your LMS may nest funny. In which case you might need to break out with: //var lmsAPI = parent; var myName = lmsAPI.GetStudentName();
// Same as above but for SCORM 2004 //var myName = lmsAPI.SCORM2004_GetStudentName();
// Name comes in as an array - will use features of array to separate var array = myName.split(',');
// variables for JavaScript var firstName = array[1]; var lastName = array[0]; var fullName = firstName + ' ' + lastName;
// DATE TODAY FROM COMPUTER var SystemDate = new Date();
// set Javascript variables from above var dateDay = SystemDate.getDate(); var dateMonth = SystemDate.getMonth(); var dateYear = SystemDate.getFullYear();
// format dates to appear as written dateMonth = dateMonth + 1; // if you want 2 digit year, uncomment next line // dateYear = dateYear.toString().substr(2,2);
//Javascript to write out the HTML in the new window newdocument.writeln(html_open); newdocument.writeln(table); newdocument.writeln('</BODY></HTML>');
7 Replies
I imagine the computer doesn't know where to find the printCertificate.html file, as it relates to the location from which the course is running. You might try uploading the certificate page to a web server then using a WebObject. People tend to have better luck with this approach
I see some lines not ended with a semicolon. You might fix that and try again.
Also, you might to play around with adding a forward slash (/) and/or any folder locations before your URL to see if it helps locate your HTML file.
HI Brian,
Thank you for your comments.
When I click a print button, it opens a new window with this path:
https://training.spca.bc.ca/pluginfile.php/209/mod_scorm/content/5/printCertificate.html?print=Tamila&10/9/2019
Does it confirm what you are saying? It can't recognize where to print from?
I feel it should be an easy fix but I struggle to understand this tech language.
If I send a published slide, would you please have a look at it?
Please kindly let me know
Thank you,
Tamila
Thank you Scott.
I tried semicolon but no luck. I am afraid I am not technically strong to understand this language
The other responses are accurate. The html file location isn't specified or isn't found in the location specified. Additionally, this code is written to put the name and date in the url and not the actual certificate. I assume you are trying to print a certificate with the name and date in it?
Do you have a .story file you can share so we can see what you are working with and trying to accomplish?
Hi Owen,
Thank you so much for giving a hand here.
Kindly find a story file attached
Hi Jolie,
After a search on the html file name you mentioned, I'm assuming you were attempting to use the template from the "New Freebie! Storyline Print Certificate template" discussion here.
I've recently been playing around with using JavaScript to generate printable notes in a pop-up HTML window, so I thought I'd apply it to your problem.
I couldn't get your shared file to open as I'm still using Storyline 2, but see the attached file and code shared below to see how it works.
Note: This will produce only a solid black border around your "certificate" instead of the more stylized one from the freebie, but should do the work fine.
This discussion is closed. You can start a new discussion or contact Articulate Support.