Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 3b2c6f99b624ebdc198acded829d215ec1302f6b 1 parent 0afbd23
authored May 31, 2007

Showing 1 changed file with 45 additions and 0 deletions. Show diff stats Hide diff stats

  1. 45  mod/scorm/datamodels/scorm_13.js.php
45  mod/scorm/datamodels/scorm_13.js.php
@@ -561,6 +561,51 @@ function SetValue (element,value) {
561 561
                                                          diagnostic = "Write Once Violation";
562 562
                                                      }
563 563
                                                  }
  564
+                                                 
  565
+                                                 if (elementmodel=='cmi.interactions.n.objectives.n.id') {
  566
+ 
  567
+                                                    elementIndexesSubindexes = element.split('.');
  568
+                                                    elementFirstindex = elementIndexesSubindexes [2];
  569
+	                                                longit = elementFirstindex.length;
  570
+	
  571
+	                                                longit--;
  572
+	                                                if (longit == 1){
  573
+	 
  574
+	                                                    ind = elementFirstindex.substring(1);
  575
+	                                                }
  576
+                                                    else{
  577
+	                                                    ind = elementFirstindex.substring(1,longit);
  578
+	                                                }
  579
+	
  580
+	                                                elementSubindex = elementIndexesSubindexes [4];
  581
+	                                                longit2 = elementSubindex.length;
  582
+	 
  583
+	                                                longit2--;
  584
+	                                                if (longit2 == 1){
  585
+	     
  586
+		                                               subind = elementSubindex.substring(1);
  587
+		
  588
+		                                            }
  589
+		                                            else{
  590
+    
  591
+	                                                   subind = elementSubindex.substring(1,longit2);
  592
+	                                                }
  593
+	
  594
+	                                                i=0;
  595
+	                                                while (i<parseInt(subind)){
  596
+		                                                elem = 'cmi.interactions.N'+ind+'.objectives.N'+i+'.id';
  597
+		                                                if (eval(elem)==value){
  598
+		                                                    errorCode = "351";
  599
+                                                            diagnostic = "Write Once Violation";
  600
+		                                                }
  601
+	                                                    i++;
  602
+	                                                }
  603
+                      
  604
+  
  605
+												
  606
+
  607
+												}
  608
+                                                 
564 609
                                                 if (elementmodel=='cmi.interactions.n.learner_response') {
565 610
                                                     if (typeof eval(subelement+'.type') == "undefined") {
566 611
                                                         errorCode="408";

0 notes on commit 3b2c6f9

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