Your Code
//initialize a global variable to track whether the learner has clicked print or not
var printed = false;
//call this function when the print button is pressed
function onPrintClick ()
{
//print the document
printed = true;
SetValue ( "cmi.success_status", "" );
}
//use this function anytime a learner quits the SCO
function onExit()
{
//check to see if they printed the document
if( !printed )
{
SetValue ( "cmi.success_status", "" );
}
}
Code Example
//initialize a global variable to track whether the learner has clicked print or not
var printed = false;
//call this function when the print button is pressed
function onPrintClick ()
{
//print the document
printed = true;
SetValue ( "cmi.success_status", "passed" );
}
//use this function anytime a learner quits the SCO
function onExit()
{
//check to see if they printed the document
if( !printed )
{
SetValue ( "cmi.success_status", "failed" );
}
}