Hey everybody. let me say that I'm a javascript newbie. I'm an asp and php kind of person. I have the below code that is giving me a syntax error. My novice eye says it's ok, obviously not.
It's supposed to work like so...if the url is the referenced url than cmi.score.scaled >= and if that's the case than the other two conditions. Ok, does this make sense?
else
{
if(document.location.href='../../../Module_5/M5_01_scenario/m5_01_scenario.html');
{
(name=="cmi.score.scaled" && value >= .50);
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
else
{
if(document.location.href='../../../Module_5/M5_02_scenario/m5_02_scenario.html');
{
(name=="cmi.score.scaled" && value >= .50);
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
else
{
if(name=="cmi.score.scaled" && value >= .75);
{
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
{
var result = api.SetValue(name, value);
if (result.toString() != "true")
{
throw(ErrorHandler("LMSSetValue("+name+","+value+") failed.",227));
}
else
{
print_info("LMSSetValue("+name+","+value+") succeeded.","APIWrapper.js",232);
}
}
return;
}
It's supposed to work like so...if the url is the referenced url than cmi.score.scaled >= and if that's the case than the other two conditions. Ok, does this make sense?
else
{
if(document.location.href='../../../Module_5/M5_01_scenario/m5_01_scenario.html');
{
(name=="cmi.score.scaled" && value >= .50);
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
else
{
if(document.location.href='../../../Module_5/M5_02_scenario/m5_02_scenario.html');
{
(name=="cmi.score.scaled" && value >= .50);
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
else
{
if(name=="cmi.score.scaled" && value >= .75);
{
LMSSetValue("cmi.completion_status","completed");
LMSSetValue("cmi.progress_measure",1);
}
{
var result = api.SetValue(name, value);
if (result.toString() != "true")
{
throw(ErrorHandler("LMSSetValue("+name+","+value+") failed.",227));
}
else
{
print_info("LMSSetValue("+name+","+value+") succeeded.","APIWrapper.js",232);
}
}
return;
}