Skip to content
Browse files

Fixed problem with cmi.interactions.id elements' duplicated ids.

  • Loading branch information...
1 parent d022bf6 commit 1a3dad348475361d5baff140d8b5079ca33591bc csantossaenz committed Jun 1, 2007
Showing with 24 additions and 4 deletions.
  1. +24 −4 mod/scorm/datamodels/scorm_13.js.php
View
28 mod/scorm/datamodels/scorm_13.js.php
@@ -556,10 +556,30 @@ function SetValue (element,value) {
parentmodel = 'cmi.interactions';
if (subelement.substr(0,parentmodel.length) == parentmodel) {
if ((elementmodel==parentmodel+'.n.id') && (errorCode=="0")) {
- if (eval(element) == value) {
- errorCode = "351";
- diagnostic = "Write Once Violation";
- }
+ elementIndexesSubindex = element.split('.');
+ elementFirstind = elementIndexesSubindex [2];
+ len = elementFirstind.length;
+
+ len--;
+ if (len == 1){
+
+ ind = elementFirstind.substring(1);
+ }
+ else{
+ ind = elementFirstind.substring(1,len);
+ }
+
+ i=0;
+ while (i<parseInt(ind)){
+ elem = 'cmi.interactions.N'+ind+'.id';
+ if (eval(elem)==value){
+ errorCode = "351";
+ diagnostic = "Write Once Violation";
+ }
+ else{
+ i++;
+ }
+ }
}
if (elementmodel=='cmi.interactions.n.objectives.n.id') {

0 comments on commit 1a3dad3

Please sign in to comment.
Something went wrong with that request. Please try again.