Permalink
Browse files

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

  • Loading branch information...
1 parent 0afbd23 commit 3b2c6f99b624ebdc198acded829d215ec1302f6b csantossaenz committed May 31, 2007
Showing with 45 additions and 0 deletions.
  1. +45 −0 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";

0 comments on commit 3b2c6f9

Please sign in to comment.