Example files: Generating a certificate from Storyline
May 09, 2012
This example demonstrates how you can take user input and generate a certificate for printing. Any Storyline variable or score can be used to generate the output. The file and file add-ins are both simple and straight forward. This will only work in the Flash based output. This will not work in the iOS output or HTML5.
To replicate this on your end:
1) Modify the story file to your liking.
2) Extract the add-in zip file above (certificate.html and certificateBG.gif)
3) Copy these two files into your published output directory. You'll need to do this each time you publish.
This is a really basic example. You really can do quite a bit with this including adding a print button, extra fields, collecting values from the LMS like the user's first and last name.
** I noticed a bug when playing with this file setup. I initially thought I would be able to include the certificate files as resources to avoid copy / paste surgery after publish. Unfortunately, Storyline mangled the HTML file on publish. Will be submitting this as a bug.
236 Replies
Hi,
Thanks for your guidance to print a certificate.
It's working fine when I tried on my local system.
But, when attempting to do this from the LMS using Firefox/Chrome it is displaying an error.(Please refer 3rd image)
For your reference am attaching the screnshots.
Please give a solution on how to solve this.
Certificate Files pasted
Published file from Local System
MOODLE Output
Regards,
Palani Velu
Further question...
I'm 99% sure I can get the certificate to work as advertised.
My HTML days are far, far behind me. Is there a way to embed a link into the certificate that will email the entire certificate page to a pre-populated address?
Hi Steve:
I was able to replicate what you did but, I've been playing around the code in "certificate.html" in the add-in files.and have been trying to add the learner's final score and the systemDate into the code. I cannot seem to pull that data into the code.Can you help with what that looks like?
Thanks
I'm running into the same problem. I used the files that Steve posted (not the dropbox ones) and I was able to open the file, publish the file, move the supplied folder contents to the published folders. I have published the default file to web, lms, and CD to test it and I can see the certificate.html file in story.html but I do not see it story.swf. I am unable to see the variable learner in either situation.
Please help super heroes!
Hi All,
CENTERING LEARNER'S NAME
I'm new to CSS/JavaScript...
With absolute positioning, I can center fixed-length information but I cannot seem to center the +learnerName+ because it is variable length. Is there a way to center the learner's name? (It doesn't have to be absolute positioning. That's just what the sample file seems to use.)
Thanks in advance for any code help on this!!!!
p.s. I did put in the requisite 3 hours of work before bothering y'all with this.
Hi,
I've been trying to get this to work - at the moment just using Steve template and not attempting any changes yet. The text is displayed and my name but not the picture. I just see a black box with a red cross in the top left corner - so am assuming that the picture is being stopped somewhere. Is there a way around this?
Thanks,
Kim
Hi,
Please ignore the last post. I think I've got it.
Thanks.
Thanks for the update Kim
Hi everyone. I've been able to get Steve's original solution to work, with one exception: the certificate background image is showing, but none of the text is. No title, no body text, no variables (first/last name, date). I've attached my html file here in case someone can help.
Thanks!
Patrick
Thanks for this. This works well. You have to change 'learner' to 'textentry' or 'textentry1..etc,.'
Just wondering if there's a quick code to add a current date to the certificate?
Hi Maria,
Did you see this Articulate support page on Java Script Best Practices? It includes some content plus a link to a (very good) Brian Batt Screenr on how to insert the current date. I've used it in the past and it's worked for me.
Hi,
Thank you Rebecaa. I decided not to use the date this time but I see how this could work. I'll try it on my next project. Had you successfully added a date to a certificate? Here's my example. It would be nice to add a signature and date to it.
I was able to add the date to the certificate and posted the HTML code to this thread back in November (page 3 of thread).
Tom
Thank you, Tom! Your script works very well.
I can't see where anyone has answered the question asked by quite a few people about how to add the score to the certificate. I've got these entries in the html but i can't get it to work:
.score {
position:absolute;
left:520px;
top:500px;
width:320px;
font-family:Arial, Helvetica, sans-serif;
font-size:40px;
color:#cc00ff;
z-index:2;
var learnerScore=player.GetVar("Results1.scorePercent").toString();
document.write("
I'd be grateful if anyone can help as I'm going round in circles with this.
Hi Carolyn,
Unfortunately, you can't access the results variables directly through GetVar. You'll need to add a trigger on your results slide to copy the score into another variable then reference that variable through JavaScript.
Steve
Thanks Steve. I'll give it a go.
Hi Steve
I've had a go a what you suggest, but I'm struggling a bit. The score is still not displaying on the certificate so I'm obviously doing someing wrong. I've taken the following steps:
I set up a new variable called Score and assigned it a numeric value
I then set up a new trigger which 'adjusted' the variable 'Score' equal to the variable Results1.ScorePercent when the user clicks the object "Create My Certificate".
Then in the html I have:
.score {
position:absolute;
left:520px; top:500px; width:320px; font-family:Arial, Helvetica, sans-serif; font-size:40px; color:#cc00ff; z-index:2;}
var learnerScore=player.GetVar("Score").toString();
document.write("
Can you point out where I'm going wrong.
Thanks for your help.
All sorted, thanks for your help.
Totally missed this thread and went about this in a slightly different fashion. Instead of calling up an html page that runs the calls to storyline for the variables. I used java to create the html page from within storyline.
See my solution here: Link to Thread
I used a table in my example because the background image was not printing in I.E. but I might give it a go again using Steve's most excellent html.
Way late to the party...but how do I set the font size for inputing the learner name into the certificate. I've got my own certificate generated, but I can't figure out how to control the font size.
I used a style guide in the html. Something like this....
< style type="text/css">
h2 { font-family:"Segoe Script"; font-size:20px; color:#333333}
Then you can use h2 as an html tag before the learner name. Like this:
< h2>'+LearnerName+'</h2>
Thanks to everyone in this thread for the collaboration. I was able to implement this method and it works wonderfully - in Firefox and Chrome. But in IE, the "Print Certificate" button I added to my results slide is unresponsive. Nothing happens when it's clicked. In Chrome and FF, clicking it launches a new broswer window with the certificate.
Since the training is playing in Moodle as a flash module, there's no browser error to help me troubleshoot the problem. Has anyone else had problems with this method working in IE? Any help or guidance is greatly appreciated!
Thanks.
Hi,
I followed the steps in the post, but when the certificate is supposed to pull up, I get an error. My module eventually is zipped and uploaded into an LMS where it is hosted. Will the steps in the post still work for that? Also, is the "published output directory" different from the output folder that is created when I publish my articulate module?
Thank you,
Tria
Hi Tria,
The zipped module uploaded to your LMS shouldn't be the cause of any problems. That's how I have mine working as well (using Moodle) and it works just fine.
Not sure how others have done this, but I simply uploaded the 2 files (the .html and the certificate image) into a folder inside the same host where my Moodle installation lives. For example, my files live at http://www.mydomainname.com/certificate/certificate.html and http://www.mydomainname.com/certificate/certificate.jpg. /certificate is my "published output directory".
So here's how my javascript reads:
var newWin=window.open("http://www.mydomainname.com/certificate/certificate.html", "http://www.mydomainname.com/certificate/certificate.jpg","status=0,scrollbars=0,width=950,height=605");
Hope this helps!