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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 24 Jan 2006 22:20:21 -0000


albertel		Tue Jan 24 17:20:21 2006 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  - don't set the min to zero when resorting from a previously set value Bug#4613 
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.129 loncom/interface/lonhelper.pm:1.130
--- loncom/interface/lonhelper.pm:1.129	Tue Jan 17 13:39:50 2006
+++ loncom/interface/lonhelper.pm	Tue Jan 24 17:20:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.129 2006/01/17 18:39:50 albertel Exp $
+# $Id: lonhelper.pm,v 1.130 2006/01/24 22:20:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1561,6 +1561,8 @@
     my $date;
 
     my $time=time;
+    $date = localtime($time);
+    $date->min(0);
     my ($anytime,$onclick);
 
     if (defined($self->{DEFAULT_VALUE})) {
@@ -1568,14 +1570,18 @@
         die('Error in default value code for variable ' . 
             $self->{'variable'} . ', Perl said: ' . $@) if $@;
         $time = &$valueFunc($helper, $self);
-	if (lc($time) eq 'anytime') { $time=time; $anytime=1; }
+	if (lc($time) eq 'anytime') {
+	    $anytime=1;
+	} else {
+	    $date = localtime($time);
+	}
+    } else {
+
     }
     if ($anytime) {
 	$onclick = "onclick=\"javascript:updateCheck(this.form,'${var}anytime',false)\"";
     }
     # Default date: The current hour.
-    $date = localtime($time);
-    $date->min(0);
 
     if (defined $self->{ERROR_MSG}) {
         $result .= '<font color="#FF0000">' . $self->{ERROR_MSG} . '</font><br /><br />';