version 1.522.2.28, 2021/01/18 23:11:15
|
version 1.522.2.31, 2024/07/03 04:06:27
|
Line 321 use Apache::lonnavmaps;
|
Line 321 use Apache::lonnavmaps;
|
use Apache::longroup; |
use Apache::longroup; |
use Apache::lonrss; |
use Apache::lonrss; |
use HTML::Entities; |
use HTML::Entities; |
|
use Text::Wrap(); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
Line 1499 sub parmboxes {
|
Line 1500 sub parmboxes {
|
&whatIsMyCategory($tempparameter, \%categoryList); |
&whatIsMyCategory($tempparameter, \%categoryList); |
} |
} |
#part to print the parm-list |
#part to print the parm-list |
|
$Text::Wrap::columns=60; |
|
$Text::Wrap::separator='<br />'; |
$r->print('<div class="LC_columnSection">'."\n"); |
$r->print('<div class="LC_columnSection">'."\n"); |
|
|
#Print parameters |
#Print parameters |
Line 1516 sub parmboxes {
|
Line 1519 sub parmboxes {
|
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print(' checked="checked"'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? |
: $tempkey) |
Text::Wrap::wrap('',' 'x4,$$allparms{$tempkey}) |
|
: $tempkey) |
.'</label></span><br />'."\n"); |
.'</label></span><br />'."\n"); |
} |
} |
$r->print("</div>\n"); |
$r->print("</div>\n"); |
Line 1743 sub displaymenu {
|
Line 1747 sub displaymenu {
|
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp,$parmlev)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $tree=[]; |
my $tree=[]; |
Line 1791 sub mapmenu {
|
Line 1795 sub mapmenu {
|
} |
} |
} |
} |
# Show it ... |
# Show it ... |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',' id="mapmenu"')); |
my $rowattr = ' id="mapmenu"'; |
|
if ($parmlev eq 'general') { |
|
$rowattr .= ' style="display:none"'; |
|
} |
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'),'','',$rowattr)); |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
if ((ref($tree) eq 'ARRAY') && (ref($treeinfo) eq 'HASH')) { |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" />'; |
my $whitespace = |
my $whitespace = |
Line 2306 sub assessparms {
|
Line 2314 sub assessparms {
|
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my $chome = $env{'course.'.$env{'request.course.id'}.'.home'}; |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my $totalstored = 0; |
my $totalstored = 0; |
|
my $totalskippeduser = 0; |
my $now = time; |
my $now = time; |
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
my ($needsrelease,$needsnewer,$name); |
my ($needsrelease,$needsnewer,$name); |
Line 2314 sub assessparms {
|
Line 2323 sub assessparms {
|
} |
} |
if ($markers[$i] =~ /\&(6|5|4)$/) { |
if ($markers[$i] =~ /\&(6|5|4)$/) { |
next if ($noeditgrp); |
next if ($noeditgrp); |
|
} elsif ($markers[$i] =~ /\&(3|2|1)$/) { |
|
if ($uname eq '') { |
|
$totalskippeduser ++; |
|
next; |
|
} |
} |
} |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
my (@ok_slots,@fail_slots,@del_slots); |
my (@ok_slots,@fail_slots,@del_slots); |
Line 2391 sub assessparms {
|
Line 2405 sub assessparms {
|
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
if ($totalstored) { |
if ($totalstored) { |
$message.='<p class="LC_warning">' |
$message.='<p class="LC_warning">' |
|
.&mt('Changes for [quant,_1,parameter] saved.',$totalstored) |
|
.'<br />' |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.&mt('Changes can take up to 10 minutes before being active for all students.') |
.&Apache::loncommon::help_open_topic('Caching') |
.&Apache::loncommon::help_open_topic('Caching') |
.'</p>'; |
.'</p>'; |
|
} else { |
|
$message.='<p class="LC_info">'.&mt('No parameter changes saved.').'</p>'; |
|
} |
|
if ($totalskippeduser) { |
|
$message .= '<p class="LC_warning">'; |
|
if ($uhome eq 'no_host') { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the username or ID was invalid.', |
|
$totalskippeduser); |
|
} elsif ($env{'form.userroles'} eq 'any') { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user does not have a course role.', |
|
$totalskippeduser); |
|
} else { |
|
$message .= &mt('Changes for [quant,_1,user-specific parameter] not saved because the user is not a student.', |
|
$totalskippeduser); |
|
} |
|
$message .= '</p>'; |
} |
} |
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
Line 2445 ENDPARMSELSCRIPT
|
Line 2477 ENDPARMSELSCRIPT
|
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
Line 2740 ENDTABLEHEADFOUR
|
Line 2772 ENDTABLEHEADFOUR
|
|
|
#-------------------------------------------- for each map, gather information |
#-------------------------------------------- for each map, gather information |
my $mapid; |
my $mapid; |
foreach $mapid (sort {$maplist{$a} cmp $maplist{$b}} keys %maplist) { |
foreach $mapid (sort { $a <=> $b } keys(%maplist)) { |
my $maptitle = $maplist{$mapid}; |
my $maptitle = $maplist{$mapid}; |
|
|
#----------------------- loop through ids and get all parameter types for map |
#----------------------- loop through ids and get all parameter types for map |
Line 3290 sub listdata {
|
Line 3322 sub listdata {
|
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
} elsif ($middle) { |
} elsif ($middle) { |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
|
next if (($url =~ /\.(page|sequence)$/) && ($parmlev eq 'full') && ($caller eq 'newoverview')); |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
} |
} |
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
Line 3385 sub listdata {
|
Line 3418 sub listdata {
|
sub date_interval_selector { |
sub date_interval_selector { |
my ($thiskey, $showval, $readonly) = @_; |
my ($thiskey, $showval, $readonly) = @_; |
my $result; |
my $result; |
|
my $currval = $showval; |
foreach my $which (['days', 86400, 31], |
foreach my $which (['days', 86400, 31], |
['hours', 3600, 23], |
['hours', 3600, 23], |
['minutes', 60, 59], |
['minutes', 60, 59], |
['seconds', 1, 59]) { |
['seconds', 1, 59]) { |
my ($name, $factor, $max) = @{ $which }; |
my ($name, $factor, $max) = @{ $which }; |
my $amount = int($showval/$factor); |
my $amount = int($showval/$factor); |
$showval %= $factor; |
$showval %= $factor; |
my %select = ((map {$_ => $_} (0..$max)), |
my %select = ((map {$_ => $_} (0..$max)), |
'select_form_order' => [0..$max]); |
'select_form_order' => [0..$max]); |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
if ($currval eq '') { |
\%select,'',$readonly); |
unshift(@{$select{'select_form_order'}},''); |
$result .= ' '.&mt($name); |
$select{''} = ''; |
|
$amount = ''; |
|
} |
|
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
|
\%select,'',$readonly); |
|
$result .= ' '.&mt($name); |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
Line 3408 sub date_interval_selector {
|
Line 3447 sub date_interval_selector {
|
sub get_date_interval_from_form { |
sub get_date_interval_from_form { |
my ($key) = @_; |
my ($key) = @_; |
my $seconds = 0; |
my $seconds = 0; |
|
my $numnotnull = 0; |
foreach my $which (['days', 86400], |
foreach my $which (['days', 86400], |
['hours', 3600], |
['hours', 3600], |
['minutes', 60], |
['minutes', 60], |
['seconds', 1]) { |
['seconds', 1]) { |
my ($name, $factor) = @{ $which }; |
my ($name, $factor) = @{ $which }; |
if (defined($env{'form.'.$name.'_'.$key})) { |
if (defined($env{'form.'.$name.'_'.$key})) { |
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
unless ($env{'form.'.$name.'_'.$key} eq '') { |
} |
$numnotnull ++; |
|
$seconds += $env{'form.'.$name.'_'.$key} * $factor; |
|
} |
|
} |
} |
} |
|
return if (!$numnotnull); |
return $seconds; |
return $seconds; |
} |
} |
|
|
Line 3698 ENDOVER
|
Line 3742 ENDOVER
|
$r->print('<div>'); |
$r->print('<div>'); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
$r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel')); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
$r->print(&Apache::lonhtmlcommon::row_closure()); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp,$parmlev); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles,\%symbp); |
|
} |
|
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::row_closure(1)); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
$r->print('</div></div>'); |
$r->print('</div></div>'); |