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
@Steve, I pulled down your story file and the attachments but can't seem to get this to work for me.
The certificate launches ok, but not of the text you have defined with the document. write command display.
So All I am seeing is the background and nothing else.
I've tried it on all my browsers IE, Firefox, Chrome and Safari and none of them display the text. I even uploaded it to the web just to see if it was some kind of security thing when running locally but that did not make a difference.
Interesting... Can you post your files somewhere I can get to them? Would love to take a look.
Actually Steve, it is the one you posted. It does not work for me. I have not made any changes to it. Can you double check to see if the one you posted works for you.
Neither of these actually work on an LMS - I've tried accessing the course on our LMS in IE and Firefox. I did not modify the pages that were in your documents - just put the pages into an existing course with a quiz - put these after the quiz and put Steve's files in the output. You can type your name but in the first example from Steve, the background never displays and the name is not drawn in. In the second example from Jefferey, again you can type your name, the name is never brought in, but the slide does have a background - but doesn't print.
Interesting. I've uploaded the files with one minor change (the graphic didn't show up on a 'NIX server due to a case issue):
http://www.xpconcept.com/certificate/story.html
It pulled the values for me OK. Can you take a look with your browsers to see if this one works?
Also, anyone that's having trouble with an LMS displaying the dynamic content - can you try this SCO? I'd like to get to the bottom of why this might not work. Fun puzzles are fun
I did get the original to work - the reference wasn't calling the correct text field for some reason. Now I changed the background image and can view it, but can't get it to print.
here's what I get:
Wacky. What do you see when you hit CTRL-P with the certificate window focused? Is it printing without the background? I'm getting it to print from Chrome, IE7, and Firefox.
well now I can get your new one to print (and obviously I see the name "test") but I couldn't get the original to print the background and I can't get my background that I put in to print. So now I'm grabbing your new version to see what the deal is.
There may be differences in the way the original (first version) works. If it fills the DIV from CSS as a background attribute, it won't print that unless you specifically configure the browser to print backgrounds.
So I did get everything to work now. I had to go into your HTML file, change learner name get VAR from "learner" to "TextEntry7" and also change the file name of the graphic from "certificateBG.gif" to "CertificateBG.gif" to match what the HTML file was calling. After doing that, the name was called in properly, the background displayed, and everything printed!
Cool! Hand editing is touchy Everything needs to line up.
thanks Steve, just so im clear you cant print certificates if stroyline beig accesses on a local machine.
Hi, Asif -
You can but you'll need to ensure the Flash security sandbox is allowed for your local working directory/directories.
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
If your local directory isn't specifically added, the Flash player won't allow interactions between the Flash movie and the browser.
Steve
where or what is the publish output directory?
ok i'm a bit dense but can some one explain step 3 to me.
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.
steve please ignore my previous request or anyone for that matter.
what im struggling on is to get their name and result data displaying. any help will be appeciated as i dont have much hair left.
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.
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();
Hi Everybody
How should I call the following data into Certificate.html
Quiz Name or Module name
Score?
Can somebody help me please?
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?
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
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?