Create a Course Certificate in StoryLine! (with Java and HTML)

I noticed in Stephanie Harnett's most excellent post on user notes that can be printed or emailed that much of the java for the printing function was really just filling the print window with content by using html. I thought to myself, why not use this same method for creating a course certificate. So I did just that following the steps below:

1) Design a rough draft in PowerPoint (so I could see what elements I would want on the page and determine or create any graphics I would need.

2) Create graphics and publish them to the web. You will need to reference them using a full URL.

3) Create an HTML based certificate using your favorite html editor. Tables work really well. I discovered this on my 3rd try to get this right. (More on that later.)

4) In StoryLine, create a trigger to execute JavaScript

5) Use the JavaScript to create your print window contents by adding the lines of your html together (see screenr)

Publish and test.

Below is a copy of the certificate created by StoryLine. The blue text represents variables pulled form the course:

68 Replies
Steve Flowers

Hey James - 

The opening single quotes on each of the lines is the wrong character. It's OK for the apostrophe in "driver's" but causes the script to fail. I ran a search and replace on these. Another issue is on the line:

contents+=' <div id="signaturename">

It was missing a closing single quote. Fix these and it should work. Still needs the CSS file for styling but it'll open and print.

James Finder

Thanks Steve. So i just remove the ' infront of each line and it should
work?

James Finder
Founder, PLExD LLC
p: 8504455336
s: http://getplexd.com
e: james@getplexd.com

This Email is covered by the Electronic Communication Privacy Act, 18 U.S.C
2510-2521 and may be legally privileged. The information contained in this
Email is intended only for the use of the individual or entity named above.
If the reader of this message is not the intended recipient, or the
employee or agent responsible to deliver it to the intended recipient, you
are hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error please immediately notify us and destroy the
original message.

stacey kramer

Thank you so much for this post!!

I am trying to figure out a solution to print a custom certificate. I created a certificate in Dreamweaver and then wrote out the Javascript per this thread but the "Execute Javascript" trigger is not launching anything. Would anyone have the time to take a look at my code and let me know what is wrong? I am not an experienced coder but I am trying to figure this out.

Thank you for you time!!!

Matt Lynch

I have followed the steps above, and I can get it all to work when publishing to cd.

The problem is when I export to web or LMS and host it on an LMS, the images do not appear when printing. I have tried to put them in a web object and link them - no good.

They currently have the full address linking them, but it doesn't show.

Does anyone have any idea why this is and how I can fix it?

my code for the image link is: 

contents+='<td width="30%"><center><img src="http://elitefireonline.com.au/certificate/Signature.png"></center></td>';

Steve Flowers

Hey Matt - 

This image link doesn't show anything for me - it's blank.

http://elitefireonline.com.au/certificate/Signature.png

If you're using a modern browser to run the output, right-click the certificate page and choose inspect. This will bring up a developer panel. Click the console link. Do any red lines appear here?

One of the potential causes of failed loads is mixing http and https. If your LMS launches the window as HTTPS (very likely) and the contents of the page are attempting to load from HTTP, the browser could be shutting that down to protect the user.

Steve Flowers

Hey Matt -

One way to run relative links is using a Web Object to "carry on" files. Pretty easy:

  1. Create a folder and drop in all of your files. You can add anything to this folder including images, audio, PDF's... Any digital file.
  2. Add an index.html file to the folder. This can be completely blank. Just needs to be there for the Web Object to load.
  3. Create a slide in your story file and add the web object. This can be a slide that is never reached. You could also add it as a layer that's never displayed on one of your slides. The purpose of adding this is so that it's carried into your Story file and exported when published.
  4. Publish your storyline output. You can publish to LMS, Web, or CD. Doesn't matter, the published files are going to be relatively consistent.
  5. Explore the published folder. Navigate to the story_content/WebObjects folder. You'll see at least one Web object folder with a unique ID in that folder. If you see more than one, open each folder until you find the one that contains your "baggage files".
  6. Copy the string to of unique characters from the folder that contains your files. 

This will become your relative reference. Example:

story_content/WebObjects/5uVWX7D/heading.png