user
@viktor
The Print Certificate button does not trigger a download
I've followed the instructions but yet the PDF will not be downloaded when clicking the "PRINT CERTIFICATE" button.
reply
Reply
user
@viktor
Please test the course out yourself here:
https://edunder.com/Demo/COMMISSIONING%20test/story.html

The "PRINT CERTIFICATE" button is present when you pass the test. I've titled the correct answers.

Thank you for looking into it!
reply
Reply
user
@support
What is the JavaScript trigger code that you're using to download the certificate?
reply
Reply
user
@support
Actually, before you even send the code, note that you have a typo somewhere in the JavaScript triggers.

This line has an extra opening bracket and it breaks all JavaScript in the project:
let player = (GetPlayer();

It should be:
let player = GetPlayer();

The way Storyline works, if you have an error in any JavaScript trigger, the rest of the JS triggers will not work either. So the issue above could be the reason the document is not downloading or there could be more problems after this one is fixed.

reply
Reply
user
@viktor
Thanks, that did the trick! The certificate still reads %Name% and %Date% instead of my input. I'm trying to collect %Name% from the courses landing page and %Date% i expected to work automatically. Are you able to crack a solution for this as well?

Updated export:
https://edunder.com/Demo/COMMISSIONING%20test2/story.html

Also, when I click the "PRINT CERTIFICATE" button, is there a way to customize a loading scene instead of opening a seperate tab with the Cluelabs credentials?

Much obliged,
Viktor
reply
Reply
user
@support
The certificate still reads %Name% and %Date% instead of my input.
- I would double check that your variable names in Storyline are in the same case as in the document template ("name" vs. "Name") otherwise you are referencing completely different strings.

%Date% i expected to work automatically.
- Storyline does not have a system variable for date, so there's no reason why it would work automatically.
You can use JavaScript to get the current date. Here's a guide to JavaScript date object: https://www.w3schools.com/jsref/jsref_obj_date.asp
For example, for the simplest implementation, you would do something like this:
let player = GetPlayer();
let today = new Date();
player.SetVar('Date', today);

Is there a way to customize a loading scene instead of opening a seperate tab with the Cluelabs credentials?
- There is not.
reply
Reply
user
@viktor
Alright, thanks for all your help! I utilized a JS library instead for look and feel purposes and managed to get it to work. But I'll be using ClueLabs for reading data for sure – great feature!
reply
Reply