Null output when printing result

Hi there

I use an authoring tool called storyline 3 which supports JavaScript. The storyline file starts with the following code in the back end…

Execute JS – when timelines starts on this slide

var objToday = new Date(),
weekday = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
dayOfWeek = weekday[objToday.getDay()],
domEnder = function() { var a = objToday; if (/1/.test(parseInt((a + "").charAt(0)))) return "th"; a = parseInt((a + "").charAt(1)); return 1 == a ? "st" : 2 == a ? "nd" : 3 == a ? "rd" : "th" }(),
dayOfMonth = today + ( objToday.getDate() < 10) ? '0' + objToday.getDate() + domEnder : objToday.getDate() + domEnder,
months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'),
curMonth = months[objToday.getMonth()],
curYear = objToday.getFullYear(),
curHour = objToday.getHours() > 12 ? objToday.getHours() - 12 : (objToday.getHours() < 10 ? "0" + objToday.getHours() : objToday.getHours()),
curMinute = objToday.getMinutes() < 10 ? "0" + objToday.getMinutes() : objToday.getMinutes(),
curSeconds = objToday.getSeconds() < 10 ? "0" + objToday.getSeconds() : objToday.getSeconds(),
curMeridiem = objToday.getHours() > 12 ? "PM" : "AM";
var today = curHour + ":" + curMinute + "." + curSeconds + curMeridiem + " " + dayOfWeek + " " + dayOfMonth + " of " + curMonth + ", " + curYear;
document.getElementsByTagName('h1')[0].textContent = today;

However, when I print out the result, I get a null result. What am I doing wrong?

https://360.articulate.com/review/content/57978459-8b6f-4c75-8959-4e609709b792/review

If you run the link above,
Click Next
Rate the next three question 1-5 then hit next
Click Print/Save

You’ll be presented with a printable document. At the top I have a null result.

1st trigger - Execute JavaScript when user clicks on the next button

var objToday = new Date(),
weekday = new Array(‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’),
dayOfWeek = weekday[objToday.getDay()],
domEnder = function() { var a = objToday; if (/1/.test(parseInt((a + “”).charAt(0)))) return “th”; a = parseInt((a + “”).charAt(1)); return 1 == a ? “st” : 2 == a ? “nd” : 3 == a ? “rd” : “th” }(),
dayOfMonth = today + ( objToday.getDate() < 10) ? ‘0’ + objToday.getDate() + domEnder : objToday.getDate() + domEnder,
months = new Array(‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘December’),
curMonth = months[objToday.getMonth()],
curYear = objToday.getFullYear(),
curHour = objToday.getHours() > 12 ? objToday.getHours() - 12 : (objToday.getHours() < 10 ? “0” + objToday.getHours() : objToday.getHours()),
curMinute = objToday.getMinutes() < 10 ? “0” + objToday.getMinutes() : objToday.getMinutes(),
curSeconds = objToday.getSeconds() < 10 ? “0” + objToday.getSeconds() : objToday.getSeconds(),
curMeridiem = objToday.getHours() > 12 ? “PM” : “AM”;
var today = curHour + “:” + curMinute + “.” + curSeconds + curMeridiem + " " + dayOfWeek + " " + dayOfMonth + " of " + curMonth + ", " + curYear;
document.getElementsByTagName(‘h1’)[0].textContent = today;

YOU ANSWER THE QUESTIONS.

The JavaScript attached to the Print/Save button

var myWindow = window.open("",“Print”,“width=810,height=610,scrollbars=1,resizable=1”);
var player=GetPlayer();
var headline=player.GetVar(“Development - Communication, Oral and Written”);
var date=player.GetVar(“SystemDate”);
var usernotes=player.GetVar(“notes”);
var exercisenotes1=player.GetVar(“DevCommsDef”);
var exercisenotes2=player.GetVar(“DevCommsExp”);
var exercisenotes3=player.GetVar(“DevCommsEmp”);
var exercisenotes4=player.GetVar(“DevCommsClass”);
var exercisenotes5=player.GetVar(“DevCommsSport”);
var exercisenotes6=player.GetVar(“DevCommsVol”);
var exercisenotes7=player.GetVar(“DevCommsNote”);
var contents = “”
contents += “

Print Recommendation
”;
contents+="
"+headline+"
";
contents+="
"+date+"
";
contents+=“
Definition
”;
contents+="
"+exercisenotes1+"
";
contents+=“
Explanation
”;
contents+="
"+exercisenotes2+"
";
contents+=“
Employment
”;

And as you see from the results, I can get the value of DevCommsDef etc, barring the first line.

What have I done wrong?

It’s designed to capture the date from the computer your using at the time.