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.
- MelissaMorri679Community Member
Thank you Owen. I'm not a scripting person either.
I sent Steve an email yesterday and I am waiting to hear back.
- MelissaMorri679Community Member
Even when I publish to the Web, I can't get the information to pull in.
Can someone take a look at my file and let me know what I am doing wrong?
Thanks
Melissa
- YoniHCommunity Member
Keith Kemsley said:
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.
@Keith Kemsley
position: absolute;
left: 0px;text-align:center;width:100%;This works to make my text centered regardless of the text length.Good luck. - MihaiHorgaCommunity Member
Thank you Steve for the solution to generate a certificate for printing.
Does this solution work with a story published for CD? In other words, can a user which has only the CD published version, with no browser an no Internet connection print his/her certificate?
Also, it would be good for the user to be able to save the certificate as a pdf file for later (re)printing. Is there any way to generate and save a pdf certificate from a CD published version?
Thanks,
Mihai
- MihaiHorgaCommunity Member
Howie Pearson said:
Steve Flowers said:
Hi Cynthia -
Traditionally, you'd need a server side application to generate a PDF. But there's a way to do that with JavaScript. If I get some time this week I'll post an example.
Did you find a way of doing this Steve?
Hi Steve, a solution to generate a pdf certificate by a learner using the CD published version of a story, with no access to internet or browser, would be much appreciated! - SteveFlowersCommunity Member
Hey Mihai -
Unfortunately, the PDF generator through JavaScript was pretty inconsistent between browsers. So I gave up on that angle. The Certificate should still appear when running from a CD. But saving to PDF could be tricky if the user doesn't have a PDF setup as a print target.
If browsers were a little less inconsistent, would be much easier to help folks out
- ArturoAguileraCommunity Member
Hello,
In one word HELP!! I am trying to use Steve's file. I follow the instructions and when I open the file on Chrome and click the button, nothing happends. I have tried Firefox and Internet Explorer and nothing happen. When I tried the HTML 5, it opens the we page, but not the body. Here's what I need to do: the learner will enter information during the course, at the end, they should click a button that says "Get my Job Aid" this will open a new HTML pages with the information that they have entered. From there, the can print, or save it.
What am I doing wrong? Please HELP!
Thank you,
Arturo
- SteveFlowersCommunity Member
Hey Arturo -
You might be running into the Flash Player Security feature. This prevents JavaScript from executing locally (any communication between the Flash player and browser is locked down). A few ways to get around this:
- Publish to CD for local testing. Running the player exe file will bypass the Flash Security feature.
- Publish to web and upload to a server or LMS
- Add your publish folder to the Flash Security Settings Manager whitelist (this can be complicated for Chrome)
- Chrisanna-HibbiCommunity Member
When I clicked the "See it in action" link, the page with the text entry is blank (does not show "enter name here"), and when I printed the certificate, it did not show my name. Is this part of the bug you referenced in your post? I love the idea and would like to make it work for my own modules, as right now, the users are printing out the certificate, but getting an output version of the player with the certificate inside... so it doesn't look like an actual certificate. :(
Thanks!!