--- loncom/interface/lonparmset.pm 2022/07/07 03:37:01 1.616 +++ loncom/interface/lonparmset.pm 2023/05/22 21:10:55 1.620 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.616 2022/07/07 03:37:01 raeburn Exp $ +# $Id: lonparmset.pm,v 1.620 2023/05/22 21:10:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -329,6 +329,7 @@ use Apache::lonnavmaps; use Apache::longroup; use Apache::lonrss; use HTML::Entities; +use Text::Wrap(); use LONCAPA qw(:DEFAULT :match); @@ -1749,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; @@ -1830,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')) { @@ -2552,6 +2571,8 @@ sub parmboxes { &whatIsMyCategory($tempparameter, \%categoryList); } #part to print the parm-list + $Text::Wrap::columns=60; + $Text::Wrap::separator='
'; foreach my $key (sort { $category_order{$a} <=> $category_order{$b} } keys(%categoryList)) { next if (@{$categoryList{$key}} == 0); next if ($key eq ''); @@ -2565,8 +2586,9 @@ sub parmboxes { if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { $r->print( ' checked="checked"'); } - $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} - : $tempkey) + $r->print(' />'.($$allparms{$tempkey}=~/\S/ ? + Text::Wrap::wrap('',' 'x4,$$allparms{$tempkey}) + : $tempkey) .'
'."\n"); } $r->print(''); @@ -5024,15 +5046,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(''); @@ -5065,6 +5098,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)); @@ -5310,7 +5345,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'};