[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm
raeburn
raeburn at source.lon-capa.org
Mon Apr 3 15:53:30 EDT 2023
raeburn Mon Apr 3 19:53:30 2023 EDT
Modified files:
/loncom/interface lonparmset.pm
Log:
- Bug 4682 and bug 6853
- Parameter manager in Overview Mode: disable input form elements for
Resource alias name for conditions (mapalias) parameter.
- Parameter manager in Overview Mode and Table mode include text below
parameter name on how to set the parameter (Course Editor or RAT).
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.618 loncom/interface/lonparmset.pm:1.619
--- loncom/interface/lonparmset.pm:1.618 Mon Apr 3 15:39:10 2023
+++ loncom/interface/lonparmset.pm Mon Apr 3 19:53:30 2023
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.618 2023/04/03 15:39:10 raeburn Exp $
+# $Id: lonparmset.pm,v 1.619 2023/04/03 19:53:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1750,6 +1750,24 @@
if ($automatic) {
$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>';
}
+ my $advice;
+ if ((ref($name) eq 'HASH') && ($name->{$which} eq 'mapalias') &&
+ (ref($symbp) eq 'HASH') && ($parmlev eq 'full')) {
+ if ($symbp->{$rid} =~ m{^uploaded/}) {
+ if ($result == 14) {
+ $advice = &mt('Use Course Editor to modify this.');
+ } else {
+ $advice = &mt('Use Course Editor to set this.');
+ }
+ } else {
+ if ($result == 14) {
+ $advice = &mt('Use Resource Assembly Tool to modify this.');
+ } else {
+ $advice = &mt('Use Resource Assembly Tool to set this.');
+ }
+ }
+ $parm .= '<br /><span class="LC_fontsize_small LC_cusr_emph">'.$advice.'</span>';
+ }
$r->print('<td>'.$parm.'</td>');
my $thismarker=$which;
@@ -5028,15 +5046,26 @@
# Ready to print
#
my $parmitem = &standard_parameter_names($name);
+ my $advice;
+ if (($name eq 'mapalias') && ($middle) && (!$is_map)) {
+ if ($middle =~ m{^uploaded/}) {
+ $advice = &mt('Use Course Editor to set this.');
+ } else {
+ $advice = &mt('Use Resource Assembly Tool to set this.');
+ }
+ $advice = '<br /><span class="LC_fontsize_small LC_cusr_emph">'.$advice.'</span>';
+ }
$r->print(&tablestart($readonly,$is_map).
&Apache::loncommon::start_data_table_row().
'<td><b>'.&mt($parmitem).
- '</b></td>');
+ '</b>'.$advice.'</td>');
unless ($readonly) {
my $disabled;
if (($name eq 'availablestudent') &&
(($showval eq '') || ($userscope))) {
$disabled = ' disabled="disabled"';
+ } elsif (($name eq 'mapalias') && ($showval eq '')) {
+ $disabled = ' disabled="disabled"';
}
$r->print('<td><input type="checkbox" name="del_'.
$thiskey.'"'.$disabled.' /></td>');
@@ -5069,6 +5098,8 @@
} elsif ($thistype =~ m/^string/) {
if ($name eq 'availablestudent') {
$readonly = 1;
+ } elsif (($name eq 'mapalias') && ($showval eq '')) {
+ $readonly = 1;
}
$r->print(&string_selector($thistype,$thiskey,
$showval,$name,$readonly));
More information about the LON-CAPA-cvs
mailing list