[LON-CAPA-cvs] cvs: rat /client code.html

www lon-capa-cvs@mail.lon-capa.org
Sat, 25 May 2002 20:32:10 -0000


www		Sat May 25 16:32:10 2002 EDT

  Modified files:              
    /rat/client	code.html 
  Log:
  Bug 463 - now only inserts "Start" and "Finish" if not present and not
  "graphdef"
  
  
Index: rat/client/code.html
diff -u rat/client/code.html:1.57 rat/client/code.html:1.58
--- rat/client/code.html:1.57	Fri May 24 14:08:39 2002
+++ rat/client/code.html	Sat May 25 16:32:10 2002
@@ -4,7 +4,7 @@
 The LearningOnline Network
 Resource Assembly Tool
 //
-// $Id: code.html,v 1.57 2002/05/24 18:08:39 www Exp $
+// $Id: code.html,v 1.58 2002/05/25 20:32:10 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -2035,11 +2035,7 @@
 
    objcont[0]='';
    objlinks[0]='';
-   if (((typeof(objcont[1])=="undefined")&&(typeof(objcont[2])=="undefined")) ||
-       ((objcont[1]=='')&&(objcont[2]==''))) { 
-      objcont[1]='Start::false:start:res'
-      objcont[2]='Finish::false:finish:res';
-   }
+
    graphdef='no';
 
 }
@@ -2587,6 +2583,26 @@
      for (k=1;k<=maxrow;k++) {
         if (typeof(rowcont[k])=="undefined") { rowcont[k]=''; }
      }
+  } else {
+   var hasstart=0;
+   var hasfinish=0;
+   for (k=0;k<objcont.length;k++) {
+       if (typeof(objcont[k])!="undefined") {
+          var objfunctype=(objcont[k].split(':'))[3];
+          if (objfunctype=='start') { hasstart=1; }
+          if (objfunctype=='finish') { hasfinish=1; }
+       }       
+   }
+   if (!hasstart) {
+      if ((typeof(objcont[1])=="undefined") || (objcont[1]=='')) {
+         objcont[1]='Start::false:start:res';
+      }
+   } 
+   if (!hasfinish) {
+      if ((typeof(objcont[2])=="undefined") || (objcont[2]=='')) {
+         objcont[2]='Finish::false:finish:res';
+      }
+   }
   }
 }