[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 09 Sep 2002 16:40:01 -0000


www		Mon Sep  9 12:40:01 2002 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  If indeed like the comment says this is supposed to look at part 0, it
  needs to call "allpossiblekeys" in metadata.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.48 loncom/interface/lonnavmaps.pm:1.49
--- loncom/interface/lonnavmaps.pm:1.48	Thu Sep  5 15:47:29 2002
+++ loncom/interface/lonnavmaps.pm	Mon Sep  9 12:40:01 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.48 2002/09/05 19:47:29 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.49 2002/09/09 16:40:01 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -195,12 +195,18 @@
     my %opendate=();
     my %answerdate=();
     # need to always check part 0's open/due/answer status
-    foreach (sort(split(/\,/,&Apache::lonnet::metadata($hash{'src_'.$rid},'keys')))) {
+    foreach (sort(split(/\,/,&Apache::lonnet::metadata($hash{'src_'.$rid},'allpossiblekeys')))) {
         if ($_=~/^parameter\_(.*)\_opendate$/) {
 	    my $part=$1;
             $duedate{$part}=&parmval($part.'.duedate',$symb);
             $opendate{$part}=&parmval($part.'.opendate',$symb);
             $answerdate{$part}=&parmval($part.'.answerdate',$symb);
+            if (&parmval($part.'.opendate.type',$symb) eq 'date_interval') {
+		$opendate{$part}=$duedate{$part}-$opendate{$part};
+            }
+            if (&parmval($part,'.answerdate.type',$symb) eq 'date_interval') {
+                $answerdate{$part}=$duedate{$part}+$answerdate{$part};
+            }
         }
     }
     my $now=time;