--- loncom/interface/lonparmset.pm 2017/07/15 04:58:17 1.581
+++ loncom/interface/lonparmset.pm 2019/02/18 13:46:05 1.590
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.581 2017/07/15 04:58:17 raeburn Exp $
+# $Id: lonparmset.pm,v 1.590 2019/02/18 13:46:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1065,12 +1065,13 @@ sub valout {
# @param {string} $marker - identifier for the parameter, "resource id&part_parameter name&level", will be passed as pres_marker when the user submits a change.
# @param {string} $return - prefix for the name of the form and field names that will be used to submit the form ('parmform.pres')
# @param {string} $call - javascript function to call to submit the form ('psub')
-# @param {boolean} $recursive - true if link is for a map/folder where parameter is currently set to be recursive.
+# @param {boolean} $recursive - true if link is for a map/folder where parameter is currently set to be recursive.
+# @param {string} $extra - optional additional information to send as tenth arg in call to javascript pjump function.
sub plink {
- my ($type,$dis,$value,$marker,$return,$call,$recursive)=@_;
+ 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]};
@@ -1082,13 +1083,13 @@ sub plink {
my $valout = &valout($value,$type,$parmname,1);
my $unencmarker = $marker;
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call,
- \$hour, \$min, \$sec) {
+ \$hour, \$min, \$sec, \$extra) {
$$item = &HTML::Entities::encode($$item,'"<>&');
$$item =~ s/\'/\\\'/g;
}
return '
');
+ }
if ($parmlev eq 'full') {
my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}.
'.'.$$name{$which},$$symbp{$rid});
@@ -1558,6 +1740,9 @@ sub print_row {
}
$r->print('');
$r->print("\n");
+ if (($numlinks) && (ref($reclinks))) {
+ $$reclinks = $numlinks;
+ }
}
# Prints a cell for table mode.
@@ -1577,10 +1762,11 @@ sub print_row {
# @param {hash reference} $display - parameter key -> full title for the parameter
# @param {boolean} $noeditgrp - true if no edit is allowed for group level parameters
# @param {boolean} $readonly -true if editing not allowed.
-# @param {boolean} $ismaplevel - true if level is for a map.
+# @param {boolean} $ismaplevel - true if level is for a map.
+# @param {strring} $extra - extra informatio to pass to plink.
sub print_td {
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,
- $noeditgrp,$readonly,$ismaplevel)=@_;
+ $noeditgrp,$readonly,$ismaplevel,$extra)=@_;
my ($ineffect,$recursive,$currval,$currtype,$currlevel);
$ineffect = 0;
$currval = $$outpar[$which];
@@ -1634,7 +1820,8 @@ sub print_td {
} else {
$r->print(&plink($currtype,
$$display{$value},$currval,
- $mprefix.$currlevel,'parmform.pres','psub',$recursive));
+ $mprefix.$currlevel,'parmform.pres','psub',$recursive,
+ $extra));
}
$r->print(''."\n");
}
@@ -1649,7 +1836,7 @@ sub print_td {
# @param {array reference} $usersgroups - list of groups the user belongs to, if any
# @param {integer} $result - level
# @param {hash reference} $courseopt - course parameters hash (result of lonnet::get_courseresdata, dump of course's resourcedata.db)
-# @returns {Array} - array (parameter value for the other group, HTML for the cell, HTML with the value, name of the other group)
+# @returns {Array} - array (parameter value for the other group, HTML for the cell, HTML with the value, name of the other group, true if recursive)
sub check_other_groups {
my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
my $courseid = $env{'request.course.id'};
@@ -1663,15 +1850,22 @@ sub check_other_groups {
&parm_control_group($courseid,$usersgroups,$symbparm,$mapparm,
$recurseparm,$what,$courseopt);
my $bgcolor = $defbg;
- my $grp_parm;
+ my ($grp_parm,$grp_is_rec);
if (($coursereply) && ($cgroup ne $resultgroup)) {
+ my ($parmname) = ($what =~ /\.([^.]+)$/);
if ($result > 3) {
$bgcolor = '#AAFFAA';
}
- $grp_parm = &valout($coursereply,$resulttype,$what);
+ $grp_parm = &valout($coursereply,$resulttype,$parmname);
$output = '