--- loncom/interface/lonparmset.pm 2019/01/06 15:27:48 1.588 +++ loncom/interface/lonparmset.pm 2019/02/18 13:25:49 1.589 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.588 2019/01/06 15:27:48 raeburn Exp $ +# $Id: lonparmset.pm,v 1.589 2019/02/18 13:25:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1071,7 +1071,7 @@ sub plink { my ($type,$dis,$value,$marker,$return,$call,$recursive,$extra)=@_; my $winvalue=$value; unless ($winvalue) { - if (&isdateparm($type)) { + if ((&isdateparm($type) || (&is_specialstring($type))) { $winvalue=$env{'form.recent_'.$type}; } else { $winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]}; @@ -1108,12 +1108,14 @@ sub page_js { $pjump_def function psub() { + var specstring = /^string_/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') { + if ((typedef[0]=='date') || + (specstring.test(document.parmform.pres_type.value) && (typedef[1]!='yesno'))) { eval('document.parmform.recent_'+ document.parmform.pres_type.value+ '.value=document.parmform.pres_value.value;'); @@ -2062,6 +2064,14 @@ sub isdateparm { 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. # # @param {Apache2::RequestRec} $r - the Apache request @@ -3268,7 +3278,10 @@ sub assessparms { &startpage($r,$pssymb,$crstype); 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(''). '" name="recent_'.$item.'" />');