[LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm

www lon-capa-cvs-allow@mail.lon-capa.org
Fri, 30 May 2008 01:16:06 -0000


www		Thu May 29 21:16:06 2008 EDT

  Modified files:              
    /loncom/homework	default_homework.lcpm 
  Log:
  answer_date, due_date, and open_date take partid as parameter
  
  
Index: loncom/homework/default_homework.lcpm
diff -u loncom/homework/default_homework.lcpm:1.133 loncom/homework/default_homework.lcpm:1.134
--- loncom/homework/default_homework.lcpm:1.133	Thu Mar  6 09:27:43 2008
+++ loncom/homework/default_homework.lcpm	Thu May 29 21:16:04 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
 #
-# $Id: default_homework.lcpm,v 1.133 2008/03/06 14:27:43 www Exp $
+# $Id: default_homework.lcpm,v 1.134 2008/05/30 01:16:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1025,7 +1025,9 @@
 }
 
 sub open_date { 
-    my @dc = split(/\s+/,localtime(&EXT('resource.0.opendate')));
+    my ($partid)=@_;
+    unless ($partid) { $partid=0; }
+    my @dc = split(/\s+/,localtime(&EXT('resource.'.$partid.'.opendate')));
     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
     my @hm = split(/:/,$dc[3]);
     my $ampm = " am";
@@ -1036,8 +1038,10 @@
     return $dc[0].', '.$dc[1].' '.$dc[2].', '.$dc[4].' at '.$hm[0].':'.$hm[1].$ampm;
 }
 
-sub due_date { 
-    my @dc = split(/\s+/,localtime(&EXT('resource.0.duedate')));
+sub due_date {
+    my ($partid)=@_;
+    unless ($partid) { $partid=0; } 
+    my @dc = split(/\s+/,localtime(&EXT('resource.'.$partid.'.duedate')));
     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
     my @hm = split(/:/,$dc[3]);
     my $ampm = " am";
@@ -1049,7 +1053,9 @@
 }
 
 sub answer_date { 
-    my @dc = split(/\s+/,localtime(&EXT('resource.0.answerdate')));
+    my ($partid)=@_;
+    unless ($partid) { $partid=0; }
+    my @dc = split(/\s+/,localtime(&EXT('resource.'.$partid.'.answerdate')));
     return '' if ($dc[0] eq "Wed" and $dc[2] == 31 and $dc[4] == 1969);
     my @hm = split(/:/,$dc[3]);
     my $ampm = " am";