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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 07 Jul 2005 04:19:21 -0000


albertel		Thu Jul  7 00:19:21 2005 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  - BUG#4194 okay can now set dates
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.106 loncom/interface/lonhelper.pm:1.107
--- loncom/interface/lonhelper.pm:1.106	Thu Jul  7 00:16:01 2005
+++ loncom/interface/lonhelper.pm	Thu Jul  7 00:19:20 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.106 2005/07/07 04:16:01 albertel Exp $
+# $Id: lonhelper.pm,v 1.107 2005/07/07 04:19:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3268,6 +3268,11 @@
                         'answer_date' => "0_answerdate",
 			'tries' => '0_maxtries',
 			'weight' => '0_weight' );
+    my %realParmName = ('open_date' => "opendate",
+                        'due_date' => "duedate",
+                        'answer_date' => "answerdate",
+			'tries' => 'maxtries',
+			'weight' => 'weight' );
     
     my $affectedResourceId = "";
     my $parm_name = $parmTypeHash{$vars->{ACTION_TYPE}};
@@ -3326,12 +3331,8 @@
     my $result = "<form name='helpform' method='POST' action='/adm/parmset#$affectedResourceId&$parm_name&$level'>\n";
     $result .= "<input type='hidden' name='action' value='settable' />\n";
     $result .= "<input type='hidden' name='dis' value='helper' />\n";
-    if ($vars->{ACTION_TYPE} eq 'tries') {
-	$result .= "<input type='hidden' name='pscat' value='maxtries' />\n";
-    } else {
-	$result .= "<input type='hidden' name='pscat' value='".
-	    HTML::Entities::encode($vars->{ACTION_TYPE},"'<>&\"") . "' />\n";
-    }
+    $result .= "<input type='hidden' name='pscat' value='".
+	$realParmName{$vars->{ACTION_TYPE}}."' />\n";
     if ($vars->{GRANULARITY} eq 'resource') {
 	$result .= "<input type='hidden' name='symb' value='".
 	    HTML::Entities::encode($symb,"'<>&\"") . "' />\n";