Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a problem with cmi.interactions.n.objectives.n.id duplicated ids

  • Loading branch information...
commit 3b2c6f99b624ebdc198acded829d215ec1302f6b 1 parent 0afbd23
csantossaenz authored
Showing with 45 additions and 0 deletions.
  1. +45 −0 mod/scorm/datamodels/scorm_13.js.php
View
45 mod/scorm/datamodels/scorm_13.js.php
@@ -561,6 +561,51 @@ function SetValue (element,value) {
diagnostic = "Write Once Violation";
}
}
+
+ if (elementmodel=='cmi.interactions.n.objectives.n.id') {
+
+ elementIndexesSubindexes = element.split('.');
+ elementFirstindex = elementIndexesSubindexes [2];
+ longit = elementFirstindex.length;
+
+ longit--;
+ if (longit == 1){
+
+ ind = elementFirstindex.substring(1);
+ }
+ else{
+ ind = elementFirstindex.substring(1,longit);
+ }
+
+ elementSubindex = elementIndexesSubindexes [4];
+ longit2 = elementSubindex.length;
+
+ longit2--;
+ if (longit2 == 1){
+
+ subind = elementSubindex.substring(1);
+
+ }
+ else{
+
+ subind = elementSubindex.substring(1,longit2);
+ }
+
+ i=0;
+ while (i<parseInt(subind)){
+ elem = 'cmi.interactions.N'+ind+'.objectives.N'+i+'.id';
+ if (eval(elem)==value){
+ errorCode = "351";
+ diagnostic = "Write Once Violation";
+ }
+ i++;
+ }
+
+
+
+
+ }
+
if (elementmodel=='cmi.interactions.n.learner_response') {
if (typeof eval(subelement+'.type') == "undefined") {
errorCode="408";
Please sign in to comment.
Something went wrong with that request. Please try again.