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

www lon-capa-cvs@mail.lon-capa.org
Mon, 06 Jun 2005 15:46:06 -0000


www		Mon Jun  6 11:46:06 2005 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  date_interval should not use datasetter
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.212 loncom/interface/lonparmset.pm:1.213
--- loncom/interface/lonparmset.pm:1.212	Mon Jun  6 11:13:46 2005
+++ loncom/interface/lonparmset.pm	Mon Jun  6 11:46:02 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.212 2005/06/06 15:13:46 www Exp $
+# $Id: lonparmset.pm,v 1.213 2005/06/06 15:46:02 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -403,7 +403,7 @@
 		$result.=$sec.' secs ';
             }
             $result=~s/\s+$//;
-        } elsif ($type=~/^date/) {
+        } elsif (&isdateparm($type)) {
             $result = localtime($value);
         } else {
             $result = $value;
@@ -434,7 +434,7 @@
     my ($type,$dis,$value,$marker,$return,$call)=@_;
     my $winvalue=$value;
     unless ($winvalue) {
-	if ($type=~/^date/) {
+	if (&isdateparm($type)) {
             $winvalue=$env{'form.recent_'.$type};
         } else {
             $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
@@ -742,6 +742,11 @@
 ##################################################
 ##################################################
 
+sub isdateparm {
+    my $type=shift;
+    return (($type=~/^date/) && (!($type eq 'date_interval')));
+}
+
 sub parmmenu {
     my ($r,$allparms,$pscat,$keyorder)=@_;
     my $tempkey;
@@ -2089,7 +2094,7 @@
 		      ':</b></td><td><input type="checkbox" name="del_'.
 		      $thiskey.'" /></td><td>');
 	    $foundkeys++;
-	    if ($thistype=~/^date/) {
+	    if (&isdateparm($thistype)) {
 		my $jskey='key_'.$pointer;
 		$pointer++;
 		$r->print(