Diff for /loncom/interface/lonparmset.pm between versions 1.588 and 1.589

version 1.588, 2019/01/06 15:27:48 version 1.589, 2019/02/18 13:25:49
Line 1071  sub plink { Line 1071  sub plink {
     my ($type,$dis,$value,$marker,$return,$call,$recursive,$extra)=@_;      my ($type,$dis,$value,$marker,$return,$call,$recursive,$extra)=@_;
     my $winvalue=$value;      my $winvalue=$value;
     unless ($winvalue) {      unless ($winvalue) {
         if (&isdateparm($type)) {          if ((&isdateparm($type) || (&is_specialstring($type))) {
             $winvalue=$env{'form.recent_'.$type};              $winvalue=$env{'form.recent_'.$type};
         } else {          } else {
             $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};              $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
Line 1108  sub page_js { Line 1108  sub page_js {
     $pjump_def      $pjump_def
   
     function psub() {      function psub() {
           var specstring = /^string_/i;
         if (document.parmform.pres_marker.value!='') {          if (document.parmform.pres_marker.value!='') {
             document.parmform.action+='#'+document.parmform.pres_marker.value;              document.parmform.action+='#'+document.parmform.pres_marker.value;
             var typedef=new Array();              var typedef=new Array();
             typedef=document.parmform.pres_type.value.split('_');              typedef=document.parmform.pres_type.value.split('_');
             if (document.parmform.pres_type.value!='') {              if (document.parmform.pres_type.value!='') {
                 if (typedef[0]=='date') {                  if ((typedef[0]=='date') || 
                       (specstring.test(document.parmform.pres_type.value) && (typedef[1]!='yesno')))  {
                     eval('document.parmform.recent_'+                      eval('document.parmform.recent_'+
                         document.parmform.pres_type.value+                          document.parmform.pres_type.value+
                         '.value=document.parmform.pres_value.value;');                          '.value=document.parmform.pres_value.value;');
Line 2062  sub isdateparm { Line 2064  sub isdateparm {
     return (($type=~/^date/) && (!($type eq 'date_interval')));      return (($type=~/^date/) && (!($type eq 'date_interval')));
 }  }
   
   # Determine if parameter type is specialized string type (i.e.,
   # not just string or string_yesno.  
   
   sub is_specialstring {
       my $type=shift;
       return (($type=~/^string_/) && ((!$type ne 'string_yesno')));
   }
   
 # Prints the HTML and Javascript to select parameters, with various shortcuts.  # Prints the HTML and Javascript to select parameters, with various shortcuts.
 #  #
 # @param {Apache2::RequestRec} $r - the Apache request  # @param {Apache2::RequestRec} $r - the Apache request
Line 3268  sub assessparms { Line 3278  sub assessparms {
     &startpage($r,$pssymb,$crstype);      &startpage($r,$pssymb,$crstype);
   
     foreach my $item ('tolerance','date_default','date_start','date_end',      foreach my $item ('tolerance','date_default','date_start','date_end',
             'date_interval','int','float','string') {              'date_interval','int','float','string','string_lenient',
               'string_examcode','string_deeplink','string_discussvote',
               'string_useslots','string_problemstatus','string_ip',
               'string_questiontype') {
         $r->print('<input type="hidden" value="'.          $r->print('<input type="hidden" value="'.
             &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').              &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').
             '" name="recent_'.$item.'" />');              '" name="recent_'.$item.'" />');

Removed from v.1.588  
changed lines
  Added in v.1.589


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>