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

raeburn raeburn at source.lon-capa.org
Sat Mar 2 10:40:15 EST 2019


raeburn		Sat Mar  2 15:40:15 2019 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  - Fix js error when saving string parameter in pop-up due to rev. 1.589 change,
  - Recent value for string parameter not sent to pjump() for string_yesno type     
    unless yes or no.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.590 loncom/interface/lonparmset.pm:1.591
--- loncom/interface/lonparmset.pm:1.590	Mon Feb 18 13:46:05 2019
+++ loncom/interface/lonparmset.pm	Sat Mar  2 15:40:14 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.590 2019/02/18 13:46:05 raeburn Exp $
+# $Id: lonparmset.pm,v 1.591 2019/03/02 15:40:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1073,6 +1073,10 @@
     unless ($winvalue) {
         if ((&isdateparm($type) || (&is_specialstring($type))) {
             $winvalue=$env{'form.recent_'.$type};
+        } elsif ($type eq 'string_yesno') {
+            if ($env{'form.recent_string'} =~ /^(yes|no)$/i) {
+                $winvalue=$env{'form.recent_string'};
+            }
         } else {
             $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
         }
@@ -1108,14 +1112,14 @@
     $pjump_def
 
     function psub() {
-        var specstring = /^string_/i;
+        var specstring = /^string_!(yesno|any)/i;
         if (document.parmform.pres_marker.value!='') {
             document.parmform.action+='#'+document.parmform.pres_marker.value;
             var typedef=new Array();
             typedef=document.parmform.pres_type.value.split('_');
             if (document.parmform.pres_type.value!='') {
                 if ((typedef[0]=='date') || 
-                    (specstring.test(document.parmform.pres_type.value) && (typedef[1]!='yesno')))  {
+                    (specstring.test(document.parmform.pres_type.value)))  {
                     eval('document.parmform.recent_'+
                         document.parmform.pres_type.value+
                         '.value=document.parmform.pres_value.value;');




More information about the LON-CAPA-cvs mailing list