Forum Discussion
Example files: Generating a certificate from Storyline
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.
- DaveFulleCommunity Member
HI Asif,
In the HTML file (open with Notepad or something) change learner name get VAR from "learner" to "TextEntry?" (you'll need to match the text entry box in the Storyline project to the one in the HTML file so I can't give you that exact TextEntry name) and also change the file name of the graphic from "certificateBG.gif" to "CertificateBG.gif" to match what the HTML file was calling.
Hope that helps!
- asifrajaCommunity Member
Dave Fulle said:
HI Asif,
In the HTML file (open with Notepad or something) change learner name get VAR from "learner" to "TextEntry?" (you'll need to match the text entry box in the Storyline project to the one in the HTML file so I can't give you that exact TextEntry name) and also change the file name of the graphic from "certificateBG.gif" to "CertificateBG.gif" to match what the HTML file was calling.
Hope that helps!
cheers Dave. will give this a go. - NancyWoinoskiSuper Hero
Well, I finally figured out why my variables were not passing to the certificate.html. I was trying to pass a numeric variable with a score as well as the text variable containing the learner's name.
To get this to work, I had to add a .toString(); to the numeric one as follows:
var scoreTotal=player.GetVar("userScore").toString();
- JohnBascoCommunity Member
Hi Everybody
How should I call the following data into Certificate.html
Quiz Name or Module name
Score?
Can somebody help me please?
- GerryWasilukCommunity Member
Hey, Steve! Got a couple of questions on this.
Have a potential client possibly interested in this for a course that will be run through a LMS, either as AICC or SCORM 1.2. On the generated certificate, the date of completion needs to be on it. Using something like the JavaScript date/time function in the Quizmaker report.html, this is easy to pull out for showing the current.
However, what if the user comes back 6 months later to reprint the certificate? We need the original completion date put in the certificate when it is generated then and not the current data and time.
On the certificate, we also need to print out a date 3 years from the completion date--as that is when the completion expires. I'm assuming that can be done with some JavaScript?
This is for product training certification for external people using the company's products so having the right dates is crucial.
I'm thinking with variables, resume, and some creative JavaScript this might be all possible?
- SteveFlowersCommunity Member
Hey, Gerry - Should be totally possible. You'll want to add some slide logic that commits the date of completion and doesn't let them overwrite that completion until another fresh attempt / new enrollment. I'll play with it a bit later today but everything you describe should be easy to pull off
Steve
- GerryWasilukCommunity Member
Thanks, Steve! Let me know what you find out. I'm more of a JavaScript bumbler than anything and need all the help and direction I can get there.
Just curious--how do you work around Storyline not having a date/time variable?
- SteveFlowersCommunity Member
JavaScript takes care of that As long as you're not using the AMP, should be workable. Works in HTML5 and the Flash / Desktop version.
- GerryWasilukCommunity Member
Hey, Steve! Just wondering if you ever had a chance to play around around with the issue I raised.
No rush and not bugging you too much I hope ). Just grateful for your help so far (and always).
- CurtisKynerdCommunity Member
I have tried to make this work in my LMS to no avail. I get a message that says this file cannot be found. I have been experiencing other network or LMS issues lately and wonder if the two are related. Could there be issues related to IE security settings, or version differences in Java that might be affecting things? Attached is my version of the Certificate. I am grateful for any direction or advice. Thanks.