--- loncom/interface/lonparmset.pm 2023/04/03 15:39:10 1.618
+++ loncom/interface/lonparmset.pm 2023/12/22 13:38:02 1.621
@@ -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.621 2023/12/22 13:38:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1750,6 +1750,24 @@ sub print_row {
if ($automatic) {
$parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'';
}
+ 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 .= '
'.$advice.'';
+ }
$r->print('
'.$parm.' | ');
my $thismarker=$which;
@@ -1831,7 +1849,7 @@ sub print_row {
$extra = 'ltid_'.$domltistr;
}
}
- my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom);
+ my %courselti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider');
if (keys(%courselti)) {
foreach my $item (sort { $a <=> $b } keys(%courselti)) {
if (($item =~ /^\d+$/) && (ref($courselti{$item}) eq 'HASH')) {
@@ -2464,6 +2482,7 @@ sub lookUpTableParameter {
'lenient' => 'grading',
'retrypartial' => 'tries',
'discussvote' => 'misc',
+ 'texdisplay' => 'misc',
'examcode' => 'high_level_randomization',
);
}
@@ -3693,7 +3712,7 @@ sub assessparms {
'date_interval','int','float','string','string_lenient',
'string_examcode','string_deeplink','string_discussvote',
'string_useslots','string_problemstatus','string_ip',
- 'string_questiontype') {
+ 'string_questiontype','string_tex') {
$r->print('').
'" name="recent_'.$item.'" />');
@@ -4454,6 +4473,8 @@ sub storedata {
if ($thiskey =~ /\.retrypartial$/) {
$name = 'retrypartial';
}
+ } elsif ($typeof eq 'string_tex') {
+ $name = 'texdisplay';
}
} elsif ($cmd eq 'datepointer') {
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key});
@@ -5028,15 +5049,26 @@ sub listdata {
# 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 = '
'.$advice.'';
+ }
$r->print(&tablestart($readonly,$is_map).
&Apache::loncommon::start_data_table_row().
''.&mt($parmitem).
- ' | ');
+ ''.$advice.'');
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(' | ');
@@ -5069,6 +5101,8 @@ sub listdata {
} 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));
@@ -5314,7 +5348,8 @@ sub string_deeplink_selector {
}
my %courselti =
&Apache::lonnet::get_course_lti($env{'course.'.$env{'request.course.id'}.'.num'},
- $env{'course.'.$env{'request.course.id'}.'.domain'});
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ 'provider');
foreach my $item (keys(%courselti)) {
if (ref($courselti{$item}) eq 'HASH') {
$crslti{$item} = $courselti{$item}{'name'};
@@ -5514,6 +5549,9 @@ my %strings =
['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']],
'string_deeplink'
=> [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']],
+ 'string_tex'
+ => [['tth', 'tth (TeX to HTML)'],
+ ['mathjax', 'MathJax']],
);
@@ -5535,6 +5573,7 @@ my %stringtypes = (
examcode => 'string_examcode',
acc => 'string_ip',
deeplink => 'string_deeplink',
+ texdisplay => 'string_tex',
);
# Returns the possible values and titles for a given string type, or undef if there are none.
@@ -5595,6 +5634,7 @@ sub string_selector {
($thistype eq 'string_discussvote') ||
($thistype eq 'string_ip') ||
($thistype eq 'string_deeplink') ||
+ ($thistype eq 'string_tex') ||
($name eq 'retrypartial')) {
my ($got_chostname,$chostname,$cmajor,$cminor);
foreach my $possibilities (@{ $strings{$thistype} }) {