[svn r13609] Added limit on SetValue() of objectives (cannot set higher than current length of interactions array) - Fixes FS#2037

skala
Yannick Warnier 18 years ago
parent 570d745395
commit 3463bf2207
  1. 8
      main/newscorm/scorm_api.php

@ -511,6 +511,13 @@ function LMSSetValue(param, val) {
if(myres = param.match(/cmi.objectives.(\d+).(id|score|status)(.*)/)) if(myres = param.match(/cmi.objectives.(\d+).(id|score|status)(.*)/))
{ {
obj_id = myres[1]; obj_id = myres[1];
if(obj_id > item_objectives.length)
{
G_LastError = G_InvalidArgumentError;
return_value = false;
}
else
{
req_type = myres[2]; req_type = myres[2];
if(obj_id == null || obj_id == '') if(obj_id == null || obj_id == '')
{ {
@ -559,6 +566,7 @@ function LMSSetValue(param, val) {
} }
} }
} }
}
}else{ }else{
G_lastError = G_NotImplementedError; G_lastError = G_NotImplementedError;
G_lastErrorString = 'Not implemented yet'; G_lastErrorString = 'Not implemented yet';

Loading…
Cancel
Save