--- loncom/interface/lonparmset.pm 2016/10/25 18:54:48 1.522.2.19 +++ loncom/interface/lonparmset.pm 2021/01/18 23:11:15 1.522.2.28 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.522.2.19 2016/10/25 18:54:48 raeburn Exp $ +# $Id: lonparmset.pm,v 1.522.2.28 2021/01/18 23:11:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,7 +36,8 @@ lonparmset - Handler to set parameters f =head1 SYNOPSIS -lonparmset provides an interface to setting course parameters. +lonparmset provides an interface to setting content parameters in a +course. =head1 DESCRIPTION @@ -129,7 +130,7 @@ javascript function 'pjump'. =item print_td() -=item print_usergroups() +=item check_other_groups() =item parm_control_group() @@ -1024,7 +1025,7 @@ sub print_row { if (@{$usersgroups} > 1) { my ($coursereply,$grp_parm,$controlgrp); ($coursereply,$othergrp,$grp_parm,$controlgrp) = - &print_usergroups($r,$$part{$which}.'.'.$$name{$which}, + &check_other_groups($$part{$which}.'.'.$$name{$which}, $rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt); if ($coursereply && $result > 3) { if (defined($controlgrp)) { @@ -1037,7 +1038,7 @@ sub print_row { } } - &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); @@ -1051,9 +1052,9 @@ sub print_row { } if ($cgroup) { - &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly)); - &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly)); - &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly)); + &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); + &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); + &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); } if ($uname) { @@ -1091,10 +1092,14 @@ sub print_td { } else { if ($which == 11 || $which == 12) { $nolink = 1; - } elsif ($mprefix =~ /availablestudent\&$/) { - if ($which > 3) { + } elsif (($env{'request.course.sec'} ne '') && ($which > 9)) { + $nolink = 1; + } elsif ($which == 4 || $which == 5 || $which == 6) { + if ($noeditgrp) { $nolink = 1; } + } elsif ($mprefix =~ /availablestudent\&$/) { + $nolink = 1; } elsif ($mprefix =~ /examcode\&$/) { unless ($which == 2) { $nolink = 1; @@ -1111,8 +1116,8 @@ sub print_td { $r->print(''."\n"); } -sub print_usergroups { - my ($r,$what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_; +sub check_other_groups { + my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_; my $courseid = $env{'request.course.id'}; my $output; my $symb = &symbcache($rid); @@ -1127,7 +1132,6 @@ sub print_usergroups { if (($coursereply) && ($cgroup ne $resultgroup)) { if ($result > 3) { $bgcolor = '#AAFFAA'; - $grp_parm = &valout($coursereply,$resulttype); } $grp_parm = &valout($coursereply,$resulttype); $output = ''; @@ -1279,8 +1283,7 @@ sub isdateparm { # from which you can select all desired parameters. # sub parmmenu { - my ($r,$allparms,$pscat,$keyorder)=@_; - my $tempkey; + my ($r)=@_; $r->print(< // print('
'); - &shortCuts($r,$allparms,$pscat,$keyorder); + &shortCuts($r); $r->print('
'); } # return a hash @@ -1424,7 +1427,7 @@ sub lookUpTableParameter { 'retrypartial' => 'tries', 'discussvote' => 'misc', 'examcode' => 'high_level_randomization', - ); + ); } sub whatIsMyCategory { @@ -1506,6 +1509,7 @@ sub parmboxes { .&mt($categories{$key}) .''."\n"); foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { + next if ($tempkey eq ''); $r->print('' .'  '. + ''; my $sections=''; my %sectionhash = &Apache::loncommon::get_sections(); my $groups; - my %grouphash = &Apache::longroup::coursegroups(); + my %grouphash; + if (($pssymb) || &Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { + %grouphash = &Apache::longroup::coursegroups(); + } elsif ($env{'request.course.groups'} ne '') { + map { $grouphash{$_} = 1; } split(/:/,$env{'request.course.groups'}); + } my $g_s_header=''; my $g_s_footer=''; - if (%sectionhash) { + my $currsec = $env{'request.course.sec'}; + if ($currsec) { + $sections=&mt('Section:').' '.$currsec; + if (%grouphash) { + $sections .= ';'.(' ' x2); + } + } elsif (%sectionhash && $currsec eq '') { $sections=&mt('Section:').'