How to create a result/certificate pintable with name in Storyline2

Mar 13, 2017

Is there an easy printable with name certificate available in Storyline2 somewhere out there? 

Hope that someone can help.  Thanks

3 Replies
Dave Cox

Hi Marla,

Yes, you can do this, I had to do the same for a recent project. Take a look at my comments in this thread to see how to print an html certificate.

To include a name on the certificate, you need to capture the user's name some how in your course and save it to a variable. For example, from a text box.

With the user's name in the variable, it is an easy matter to grab it from javascript, although the syntax is slightly different. Here is the javascript that I would use.

var player = window.opener.GetPlayer();
var userName = player.GetVar('myUserName');

The above javascript assumes that the variable name you used in Storyline what "myUserName". You should change it to match the actual variable name that you used.

Another issue that I noticed was that it is common for the Storyline text box to return a character return, or a line feed which should be remove before you try to add it to your certificate. To do that, you can use this line instead of the one above:

var userName = player.GetVar('myUserName').replace(/(\r\n|\r|\n)/g);

The replace function above is a regExp that will remove the linefeed and character return characters.

I hope that this helps.

This discussion is closed. You can start a new discussion or contact Articulate Support.