--- loncom/interface/lonparmset.pm 2010/06/06 02:40:30 1.496
+++ loncom/interface/lonparmset.pm 2018/12/01 15:34:55 1.522.2.26
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.496 2010/06/06 02:40:30 raeburn Exp $
+# $Id: lonparmset.pm,v 1.522.2.26 2018/12/01 15:34:55 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
@@ -46,8 +47,6 @@ This module sets coursewide and assessme
=over
-=pod
-
=item parmval()
Figure out a cascading parameter.
@@ -131,39 +130,55 @@ javascript function 'pjump'.
=item print_td()
-=item print_usergroups()
+=item check_other_groups()
=item parm_control_group()
=item extractResourceInformation() :
-Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.
+ extractResourceInformation extracts lots of information about all of the the course's resources into a variety of hashes.
+
+Input: See list below
-Input: See list below:
+=over 4
-=item * B : An array that will contain all of the ids in the course.
+=item * B : Current username
-=item * B : hash, id->type, where "type" contains the extension of the file, thus, I.
+=item * B : Domain of current user.
+
+=item * B : Course
+
+=back
-=item * B : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
+Outputs: See list below
-=item * B : hash, name of parameter->display value (what is the display value?)
+=over 4
-=item * B : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+=item * B (out) : An array that will contain all of the ids in the course.
-=item * B : hash, full key to part->display value (what's display value?)
+=item * B(out) : hash, id->type, where "type" contains the extension of the file, thus, I.
-=item * B : hash, ???
+=item * B (out) : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id
-=item * B : ???
+=item * B (out) : hash, name of parameter->display value (what is the display value?)
-=item * B : hash, ???
+=item * B (out) : hash, part identification->text representation of part, where the text representation is "[Part $part]"
+
+=item * B (out) : hash, ???
=item * B : ??
=item * B : hash, id->full sym?
+=item * B
+
+=item * B
+
+=item * B
+=item * B
+
+=back
=item isdateparm()
@@ -196,12 +211,14 @@ Input: See list below:
Show assessment data and parameters. This is a large routine that should
be simplified and shortened... someday.
-Inputs: $r
-
+Inputs: $r - the Apache request object.
+
Returns: nothing
Variables used (guessed by Jeremy):
+=over
+
=item * B: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type.
=item * B: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts?
@@ -214,6 +231,8 @@ Variables used (guessed by Jeremy):
When storing information, store as part 0
When requesting information, request from full part
+=back
+
=item tablestart()
=item tableend()
@@ -280,7 +299,6 @@ Set portfolio metadata
Main handler. Calls &assessparms subroutine.
-
=back
=cut
@@ -302,6 +320,7 @@ use Apache::lonlocal;
use Apache::lonnavmaps;
use Apache::longroup;
use Apache::lonrss;
+use HTML::Entities;
use LONCAPA qw(:DEFAULT :match);
@@ -631,7 +650,7 @@ sub storeparm_by_symb {
}
sub log_parmset {
- return &Apache::lonnet::instructor_log('parameterlog',@_);
+ return &Apache::lonnet::write_log('course','parameterlog',@_);
}
sub storeparm_by_symb_inner {
@@ -738,11 +757,14 @@ sub valout {
my $result = '';
# Values of zero are valid.
if (! $value && $value ne '0') {
- if ($editable) {
- $result = '* ';
- } else {
- $result=' ';
- }
+ if ($editable) {
+ $result =
+ ' ';
+ } else {
+ $result=' ';
+ }
} else {
if ($type eq 'date_interval') {
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);
@@ -783,6 +805,7 @@ sub valout {
&date_sanity_info($value);
} else {
$result = $value;
+ $result=~s/\,/\, /gs;
$result = &HTML::Entities::encode($result,'"<>&');
}
}
@@ -824,16 +847,10 @@ sub page_js {
return(<
// "pclose()",
- 'onload' => "showHide_courseContent(); group_or_section('cgroup')",
- );
+ my %loaditems = (
+ 'onload' => "group_or_section('cgroup')",
+ );
+ if (!$psymb) {
+ $loaditems{'onload'} = "showHide_courseContent(); group_or_section('cgroup'); resize_scrollbox('mapmenuscroll','1','1');";
+ }
if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
&& (!$env{'form.dis'})) || ($env{'form.symb'})) {
@@ -884,27 +925,38 @@ sub startpage {
text=>"Table Mode",
help => 'Course_Setting_Parameters'});
}
+ my $js = &page_js().'
+
+';
my $start_page =
- &Apache::loncommon::start_page('Set/Modify Course Parameters',
- &page_js(),
+ &Apache::loncommon::start_page('Set/Modify Course Parameters',$js,
{'add_entries' => \%loaditems,});
my $breadcrumbs =
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
+ my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'});
+ my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'});
+ $r->print($start_page.$breadcrumbs);
$r->print(<
+
+
ENDHEAD
}
sub print_row {
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone,
- $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_;
+ $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp,
+ $readonly)=@_;
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
@@ -930,7 +982,7 @@ sub print_row {
if ($parmlev eq 'full') {
$r->print(''
- .$$part{$which}.' ');
+ .($$part{$which} eq '0'?'0 ('.&mt('default').')':$$part{$which}).'');
} else {
$parm=~s|\[.*\]\s||g;
}
@@ -949,31 +1001,31 @@ sub print_row {
if ($parmlev eq 'general') {
if ($uname) {
- &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
} elsif ($cgroup) {
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
} elsif ($csec) {
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
} else {
- &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
}
} elsif ($parmlev eq 'map') {
if ($uname) {
- &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
} elsif ($cgroup) {
- &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
} elsif ($csec) {
- &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
} else {
- &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
}
} else {
if ($uname) {
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)) {
@@ -986,32 +1038,32 @@ 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);
- &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
if ($csec) {
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
}
if ($cgroup) {
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &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) {
if ($othergrp) {
$r->print($othergrp);
}
- &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
- &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display);
+ &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
}
} # end of $parmlev if/else
@@ -1031,15 +1083,29 @@ sub print_row {
}
sub print_td {
- my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_;
+ my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp,$readonly)=@_;
$r->print('');
my $nolink = 0;
- if ($which == 11 || $which == 12) {
+ if ($readonly) {
$nolink = 1;
- } elsif ($mprefix =~ /availablestudent\&$/) {
- if ($which > 3) {
+ } else {
+ if ($which == 11 || $which == 12) {
$nolink = 1;
+ } elsif (($env{'request.course.sec'} ne '') && ($which > 9)) {
+ $nolink = 1;
+ } elsif ($which == 4 || $which == 5 || $which == 6) {
+ if ($noeditgrp) {
+ $nolink = 1;
+ }
+ } elsif ($mprefix =~ /availablestudent\&$/) {
+ if ($which > 3) {
+ $nolink = 1;
+ }
+ } elsif ($mprefix =~ /examcode\&$/) {
+ unless ($which == 2) {
+ $nolink = 1;
+ }
}
}
if ($nolink) {
@@ -1052,8 +1118,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);
@@ -1068,7 +1134,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 = '';
@@ -1138,6 +1203,7 @@ sub extractResourceInformation {
$$typep{$id}=$1;
$$keyp{$id}='';
$$uris{$id}=$srcf;
+
foreach my $key (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
next if ($key!~/^parameter_/);
@@ -1193,7 +1259,7 @@ sub extractResourceInformation {
$$mapp{$mapid}=$$mapp{$id};
$$allmaps{$mapid}=$$mapp{$id};
if ($mapid eq '1') {
- $$maptitles{$mapid}=&mt('Main Course Documents');
+ $$maptitles{$mapid}=&mt('Main Content');
} else {
$$maptitles{$mapid}=&Apache::lonnet::gettitle($$mapp{$id});
}
@@ -1214,12 +1280,12 @@ sub isdateparm {
}
#
-# This function prints a list of parameters, which were selected. It also display a link from which you can
-# hide or show the complete parameter list, from which you can choose your parameters.
+# parmmenu displays a list of the selected parameters.
+# It also offers a link to show/hide the complete parameter list
+# from which you can select all desired parameters.
#
sub parmmenu {
- my ($r,$allparms,$pscat,$keyorder)=@_;
- my $tempkey;
+ my ($r)=@_;
$r->print(<
//
ENDSCRIPT
- $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View')));
-
- #part to print selected parms overview
- $r->print(&mt('Selected Parameters:').' ');
-
- #print out all possible parms and hide them by default
- $r->print('');
- foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) {
- $r->print('print(' style="display:none"');
- }
- $r->print('>'
- .($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} : $tempkey)
- .' '
- );
- }
- $r->print(' ');
$r->print(' ');
- &shortCuts($r,$allparms,$pscat,$keyorder);
+ &shortCuts($r);
$r->print(' ');
-
- $r->print(
- ''
- .&mt('Show detailed Parameter Selection')
- .'
'
- );
-
- $r->print(&Apache::lonhtmlcommon::row_closure(1));
}
# return a hash
sub categories {
@@ -1369,10 +1392,13 @@ sub lookUpTableParameter {
'contentopen' => 'time_settings',
'contentclose' => 'time_settings',
'discussend' => 'time_settings',
+ 'printstartdate' => 'time_settings',
+ 'printenddate' => 'time_settings',
'weight' => 'grading',
'handgrade' => 'grading',
'maxtries' => 'tries',
'hinttries' => 'tries',
+ 'randomizeontries' => 'tries',
'type' => 'problem_appearance',
'problemstatus' => 'problem_appearance',
'display' => 'problem_appearance',
@@ -1399,8 +1425,11 @@ sub lookUpTableParameter {
'acc' => 'misc',
'maxcollaborators' => 'misc',
'scoreformat' => 'misc',
-
- );
+ 'lenient' => 'grading',
+ 'retrypartial' => 'tries',
+ 'discussvote' => 'misc',
+ 'examcode' => 'high_level_randomization',
+ );
}
sub whatIsMyCategory {
@@ -1467,62 +1496,42 @@ sub parmboxes {
'file_submission' => [],
'misc' => [],
);
- my $hidelink =
- ''
- .''
- .&mt('Hide detailed Parameter Selection')
- .' '
- .'
'
- ."\n";
-;
+
foreach $tempparameter (keys %$allparms) {
&whatIsMyCategory($tempparameter, \%categoryList);
}
#part to print the parm-list
- $r->print(
- '\n");
}
#
# This function offers some links on the parameter section to get with one click a group a parameters
#
sub shortCuts {
- my ($r,$allparms,$pscat,$keyorder)=@_;
+ my ($r)=@_;
# Parameter Selection
$r->print(
@@ -1555,8 +1564,12 @@ sub shortCuts {
sub partmenu {
my ($r,$allparts,$psprt)=@_;
+ my $selsize = 1+scalar(keys(%{$allparts}));
+ if ($selsize > 8) {
+ $selsize = 8;
+ }
- $r->print('');
+ $r->print('');
$r->print('print(' selected="selected"') unless (@{$psprt});
$r->print('>'.&mt('All Parts').' ');
@@ -1577,7 +1590,7 @@ sub partmenu {
}
sub usermenu {
- my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups)=@_;
+ my ($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,$usersgroups,$pssymb)=@_;
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
&Apache::loncommon::selectstudent_link('parmform','uname','udom');
my $selscript=&Apache::loncommon::studentbrowser_javascript();
@@ -1586,12 +1599,23 @@ sub usermenu {
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:').' ';
}
- if (%sectionhash && %grouphash && $parmlev ne 'full') {
+ if (%sectionhash && %grouphash && $parmlev ne 'full' && $currsec eq '') {
$sections .= ' '.&mt('or').' ';
$sections .= qq|
|;
- } else {
+ } elsif ($currsec eq '') {
$sections .= qq|
-COURSECONTENTSCRIPT
-
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+');
+ $r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel'));
&levelmenu($r,\%alllevs,$parmlev);
$r->print(&Apache::lonhtmlcommon::row_closure());
&mapmenu($r,\%allmaps,$pschp,\%maptitles, \%symbp);
@@ -2194,20 +2328,20 @@ COURSECONTENTSCRIPT
$r->print(&Apache::lonhtmlcommon::end_pick_box());
# Step 2
- $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification')));
- &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder);
+ $r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2'));
+ &displaymenu($r,\%allparms,\@pscat,\%keyorder,'parmmenuscroll');
# Step 3
- $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)')));
+ $r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3'));
$r->print(&Apache::lonhtmlcommon::start_pick_box());
- &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
+ &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb);
$r->print(&Apache::lonhtmlcommon::row_closure(1));
$r->print(&Apache::lonhtmlcommon::end_pick_box());
# Update Display Button
$r->print(''
.' '
+ .' value="'.&mt('Update Display').'" />'
.' '
.'
');
$r->print('');
@@ -2223,23 +2357,28 @@ COURSECONTENTSCRIPT
.''
.'');
} else {
+ $r->print();
# parameter screen for a single resource.
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb);
my $title = &Apache::lonnet::gettitle($pssymb);
- $r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource).
+ $r->print(&mt('Specific Resource: [_1] ([_2])',
+ $title,''.$resource.' ').
' '.
' ');
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)')));
$r->print(&Apache::lonhtmlcommon::start_pick_box());
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')).
- ''.&mt('Show all parts').': ');
- &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups);
+ ''.
+ ' '.
+ &mt('Show all parts').
+ ' ');
+ &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups,$pssymb);
$r->print(&Apache::lonhtmlcommon::row_closure(1));
$r->print(&Apache::lonhtmlcommon::end_pick_box());
$r->print(''
.' '
+ .' value="'.&mt('Update Display').'" />'
.' '
.'
');
}
@@ -2263,15 +2402,25 @@ COURSECONTENTSCRIPT
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat;
my $csuname=$env{'user.name'};
my $csudom=$env{'user.domain'};
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
if ($parmlev eq 'full') {
+#
+# This produces the cascading table output of parameters
+#
my $coursespan=$csec?8:5;
my $userspan=3;
if ($cgroup ne '') {
$coursespan += 3;
}
- $r->print('
');
+ $r->print(&Apache::loncommon::start_data_table());
+#
+# This produces the headers
+#
$r->print(' ');
$r->print(''.&mt('Any User').' ');
if ($uname) {
@@ -2284,7 +2433,6 @@ COURSECONTENTSCRIPT
my %lt=&Apache::lonlocal::texthash(
'pie' => "Parameter in Effect",
'csv' => "Current Session Value",
- 'at' => 'at',
'rl' => "Resource Level",
'ic' => 'in Course',
'aut' => "Assessment URL and Title",
@@ -2300,7 +2448,7 @@ COURSECONTENTSCRIPT
);
$r->print(<$lt{'pie'}
-$lt{'csv'} ($csuname $lt{'at'} $csudom)
+$lt{'csv'} ($csuname:$csudom)
$lt{'ic'} $lt{'rl'}
$lt{'ic'}
@@ -2336,7 +2484,9 @@ ENDTABLEHEADFOUR
}
$r->print(' ');
-
+#
+# Done with the headers
+#
my $defbgone='';
my $defbgtwo='';
my $defbgthree = '';
@@ -2376,11 +2526,18 @@ ENDTABLEHEADFOUR
my %default=();
my $uri=&Apache::lonnet::declutter($uris{$rid});
+ my $filter=$env{'form.filter'};
foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
if (grep $_ eq $tempkeyp, @catmarker) {
+ my $parmname=&Apache::lonnet::metadata($uri,$_.'.name');
+# We may only want certain parameters listed
+ if ($filter) {
+ unless ($filter=~/\Q$parmname\E/) { next; }
+ }
+ $name{$_}=$parmname;
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
- $name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');
+
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display');
if ($allparms{$name{$_}} ne '') {
my $identifier;
@@ -2424,8 +2581,8 @@ ENDTABLEHEADFOUR
$r->print(''.$maptitles{$mapp{$rid}}.' ');
-
foreach (&keysinorder_bytype(\%name,\%keyorder)) {
+
unless ($firstrow) {
$r->print('');
} else {
@@ -2434,13 +2591,13 @@ ENDTABLEHEADFOUR
&print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
$defbgthree,$parmlev,$uname,$udom,$csec,
- $cgroup,\@usersgroups);
+ $cgroup,\@usersgroups,$noeditgrp,$readonly);
}
}
}
} # end foreach ids
# -------------------------------------------------- End entry for one resource
- $r->print('
');
+ $r->print(&Apache::loncommon::end_data_table);
} # end of full
#--------------------------------------------------- Entry for parm level map
if ($parmlev eq 'map') {
@@ -2557,7 +2714,8 @@ ENDTABLEHEADFOUR
$r->print(&Apache::loncommon::start_data_table_row());
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
\%type,\%display,$defbgone,$defbgtwo,$defbgthree,
- $parmlev,$uname,$udom,$csec,$cgroup);
+ $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp,
+ $readonly);
}
$r->print(&Apache::loncommon::end_data_table().'
'
.''
@@ -2647,8 +2805,9 @@ ENDMAPONE
foreach (&keysinorder(\%name,\%keyorder)) {
$r->print(&Apache::loncommon::start_data_table_row());
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default,
- \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
- $parmlev,$uname,$udom,$csec,$cgroup);
+ \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
+ $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp,
+ $readonly);
}
$r->print(&Apache::loncommon::end_data_table()
.''
@@ -2656,7 +2815,8 @@ ENDMAPONE
);
} # end of $parmlev eq general
}
- $r->print(''.&Apache::loncommon::end_page());
+ $r->print('');
+ $r->print(&Apache::loncommon::end_page());
} # end sub assessparms
##################################################
@@ -2665,12 +2825,19 @@ ENDMAPONE
my $tableopen;
sub tablestart {
+ my ($readonly) = @_;
if ($tableopen) {
- return '';
+ return '';
} else {
- $tableopen=1;
- return &Apache::loncommon::start_data_table().''.&mt('Parameter').' '.
- &mt('Delete').' '.&mt('Set to ...').' ';
+ $tableopen=1;
+ my $output = &Apache::loncommon::start_data_table().''.&mt('Parameter').' ';
+ if ($readonly) {
+ $output .= ''.&mt('Current value').' ';
+ } else {
+ $output .= ''.&mt('Delete').' '.&mt('Set to ...').' ';
+ }
+ $output .= ' ';
+ return $output;
}
}
@@ -2703,7 +2870,11 @@ sub readdata {
}
}
}
- return $resourcedata;
+ if (wantarray) {
+ return ($resourcedata,$classlist);
+ } else {
+ return $resourcedata;
+ }
}
@@ -2718,8 +2889,10 @@ sub storedata {
undef %newdata;
my @deldata=();
undef @deldata;
- foreach (keys %env) {
- if ($_=~/^form\.([a-z]+)\_(.+)$/) {
+ my ($got_chostname,$chostname,$cmajor,$cminor);
+ my $now = time;
+ foreach my $key (keys(%env)) {
+ if ($key =~ /^form\.([a-z]+)\_(.+)$/) {
my $cmd=$1;
my $thiskey=$2;
my ($tuname,$tudom)=&extractuser($thiskey);
@@ -2728,20 +2901,71 @@ sub storedata {
$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./;
}
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') {
- my ($data, $typeof, $text);
+ my ($data, $typeof, $text, $name, $valchk);
if ($cmd eq 'set') {
- $data=$env{$_};
+ $data=$env{$key};
+ $valchk = $data;
$typeof=$env{'form.typeof_'.$thiskey};
$text = &mt('Saved modified parameter for');
+ if ($typeof eq 'string_questiontype') {
+ $name = 'type';
+ } elsif ($typeof eq 'string_lenient') {
+ $name = 'lenient';
+ } elsif ($typeof eq 'string_discussvote') {
+ $name = 'discussvote';
+ } elsif ($typeof eq 'string_examcode') {
+ $name = 'examcode';
+ if (&Apache::lonnet::validCODE($data)) {
+ $valchk = 'valid';
+ }
+ } elsif ($typeof eq 'string_yesno') {
+ if ($thiskey =~ /\.retrypartial$/) {
+ $name = 'retrypartial';
+ }
+ }
} elsif ($cmd eq 'datepointer') {
- $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_});
+ $data=&Apache::lonhtmlcommon::get_date_from_form($env{$key});
$typeof=$env{'form.typeof_'.$thiskey};
$text = &mt('Saved modified date for');
+ if ($typeof eq 'date_start') {
+ if ($thiskey =~ /\.printstartdate$/) {
+ $name = 'printstartdate';
+ if (($data) && ($data > $now)) {
+ $valchk = 'future';
+ }
+ }
+ } elsif ($typeof eq 'date_end') {
+ if ($thiskey =~ /\.printenddate$/) {
+ $name = 'printenddate';
+ if (($data) && ($data < $now)) {
+ $valchk = 'past';
+ }
+ }
+ }
} elsif ($cmd eq 'dateinterval') {
$data=&get_date_interval_from_form($thiskey);
$typeof=$env{'form.typeof_'.$thiskey};
$text = &mt('Saved modified date for');
}
+ if ($name ne '') {
+ my ($needsrelease,$needsnewer);
+ $needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$valchk"};
+ if ($needsrelease) {
+ unless ($got_chostname) {
+ ($chostname,$cmajor,$cminor)=¶meter_release_vars();
+ $got_chostname = 1;
+ }
+ $needsnewer = ¶meter_releasecheck($name,$valchk,
+ $needsrelease,
+ $cmajor,$cminor);
+ if ($needsnewer) {
+ $r->print(' '.&oldversion_warning($name,$data,
+ $chostname,$cmajor,
+ $cminor,$needsrelease));
+ next;
+ }
+ }
+ }
if (defined($data) and $$olddata{$thiskey} ne $data) {
if ($tuname) {
if (&Apache::lonnet::put('resourcedata',{$tkey=>$data,
@@ -2784,7 +3008,7 @@ sub storedata {
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') {
my %loghash=map { $_ => '' } @deldata;
&log_parmset(\%loghash,1);
- $r->print(''.&mt('Deleted [_1] parameter(s) ',$delentries));
+ $r->print(''.&mt('Deleted [quant,_1,parameter]',$delentries/2).' ');
} else {
$r->print(''.
&mt('Error deleting parameters').'
');
@@ -2794,7 +3018,7 @@ sub storedata {
if ($putentries) {
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') {
&log_parmset(\%newdata,0);
- $r->print(''.&mt('Saved [_1] parameter(s)',$putentries/2).' ');
+ $r->print(''.&mt('Saved [quant,_1,parameter]',$putentries/2).' ');
} else {
$r->print(''.
&mt('Error saving parameters').'
');
@@ -2829,7 +3053,7 @@ sub parse_listdata_key {
}
sub listdata {
- my ($r,$resourcedata,$listdata,$sortorder)=@_;
+ my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_;
# Start list output
my $oldsection='';
@@ -2840,6 +3064,16 @@ sub listdata {
my $foundkeys=0;
my %keyorder=&standardkeyorder();
+ my ($secidx,%grouphash);
+ if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
+ $secidx = &Apache::loncoursedata::CL_SECTION();
+ if (&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'});
+ }
+ }
+
foreach my $thiskey (sort {
my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);
my ($bstudent,$bres,$bpart,$bparm) = &parse_listdata_key($b,$listdata);
@@ -2882,25 +3116,46 @@ sub listdata {
} keys %{$listdata}) {
if ($$listdata{$thiskey.'.type'}) {
- my $thistype=$$listdata{$thiskey.'.type'};
- if ($$resourcedata{$thiskey.'.type'}) {
- $thistype=$$resourcedata{$thiskey.'.type'};
+ my $thistype=$$listdata{$thiskey.'.type'};
+ if ($$resourcedata{$thiskey.'.type'}) {
+ $thistype=$$resourcedata{$thiskey.'.type'};
}
my ($middle,$part,$name)=
($thiskey=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
my $section=&mt('All Students');
if ($middle=~/^\[(.*)\]/) {
- my $issection=$1;
- if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
- $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
- } else {
- $section=&mt('Group/Section').': '.$issection;
- }
- $middle=~s/^\[(.*)\]//;
+ my $issection=$1;
+ if ($issection=~/^useropt\:($match_username)\:($match_domain)/) {
+ my ($stuname,$studom) = ($1,$2);
+ if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
+ if (ref($classlist) eq 'HASH') {
+ if (ref($classlist->{$stuname.':'.$studom}) eq 'ARRAY') {
+ next unless ($classlist->{$stuname.':'.$studom}->[$secidx] eq $env{'request.course.sec'});
+ }
+ }
+ }
+ $section=&mt('User').": ".&Apache::loncommon::plainname($1,$2);
+ } else {
+ if (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
+ if (exists($grouphash{$issection})) {
+ $section=&mt('Group').': '.$issection;
+ } elsif ($issection eq $env{'request.course.sec'}) {
+ $section = &mt('Section').': '.$issection;
+ } else {
+ next;
+ }
+ } else {
+ $section=&mt('Group/Section').': '.$issection;
+ }
+ }
+ $middle=~s/^\[(.*)\]//;
+ } elsif (($env{'request.course.sec'} ne '') && ($caller eq 'overview')) {
+ $readonly = 1;
}
$middle=~s/\.+$//;
$middle=~s/^\.+//;
my $realm=''.&mt('All Resources').' ';
+
if ($middle=~/^(.+)\_\_\_\(all\)$/) {
$realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' ('.$1.') ';
} elsif ($middle) {
@@ -2939,36 +3194,49 @@ sub listdata {
# Ready to print
#
my $parmitem = &standard_parameter_names($name);
- $r->print(&tablestart().
+ $r->print(&tablestart($readonly).
&Apache::loncommon::start_data_table_row().
''.&mt($parmitem).
- ' ');
+ ' ');
+ unless ($readonly) {
+ $r->print(' ');
+ }
+ $r->print('');
$foundkeys++;
if (&isdateparm($thistype)) {
- my $jskey='key_'.$pointer;
- $pointer++;
- $r->print(
- &Apache::lonhtmlcommon::date_setter('parmform',
- $jskey,
- $$resourcedata{$thiskey},
- '',1,'','').
+ my $jskey='key_'.$pointer;
+ my $state;
+ $pointer++;
+ if ($readonly) {
+ $state = 'disabled';
+ }
+ $r->print(
+ &Apache::lonhtmlcommon::date_setter('parmform',
+ $jskey,
+ $$resourcedata{$thiskey},
+ '',1,$state));
+ unless ($readonly) {
+ $r->print(
' '.
(($$resourcedata{$thiskey}!=0)?''.
&mt('Shift all dates based on this date').' ':'').
&date_sanity_info($$resourcedata{$thiskey})
);
+ }
} elsif ($thistype eq 'date_interval') {
- $r->print(&date_interval_selector($thiskey,
- $$resourcedata{$thiskey}));
+ $r->print(&date_interval_selector($thiskey,
+ $$resourcedata{$thiskey},$readonly));
} elsif ($thistype =~ m/^string/) {
- $r->print(&string_selector($thistype,$thiskey,
- $$resourcedata{$thiskey}));
+ $r->print(&string_selector($thistype,$thiskey,
+ $$resourcedata{$thiskey},$name,$readonly));
} else {
- $r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
+ $r->print(&default_selector($thiskey,$$resourcedata{$thiskey},$readonly));
+ }
+ unless ($readonly) {
+ $r->print(' ');
}
- $r->print(' ');
$r->print(' '.&Apache::loncommon::end_data_table_row());
}
}
@@ -2977,7 +3245,7 @@ sub listdata {
sub date_interval_selector {
- my ($thiskey, $showval) = @_;
+ my ($thiskey, $showval, $readonly) = @_;
my $result;
foreach my $which (['days', 86400, 31],
['hours', 3600, 23],
@@ -2989,10 +3257,12 @@ sub date_interval_selector {
my %select = ((map {$_ => $_} (0..$max)),
'select_form_order' => [0..$max]);
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey,
- \%select);
+ \%select,'',$readonly);
$result .= ' '.&mt($name);
}
- $result .= ' ';
+ unless ($readonly) {
+ $result .= ' ';
+ }
return $result;
}
@@ -3014,8 +3284,12 @@ sub get_date_interval_from_form {
sub default_selector {
- my ($thiskey, $showval) = @_;
- return ' ';
+ my ($thiskey, $showval, $readonly) = @_;
+ my $disabled;
+ if ($readonly) {
+ $disabled = ' disabled="disabled"';
+ }
+ return ' ';
}
my %strings =
@@ -3028,25 +3302,113 @@ my %strings =
[ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ],
[ 'no', 'No, don\'t show correct/incorrect feedback.' ],
[ 'no_feedback_ever', 'No, show no feedback at all.' ]],
+ 'string_questiontype'
+ => [[ 'problem', 'Standard Problem'],
+ [ 'survey', 'Survey'],
+ [ 'anonsurveycred', 'Anonymous Survey (credit for submission)'],
+ [ 'exam', 'Exam'],
+ [ 'anonsurvey', 'Anonymous Survey'],
+ [ 'randomizetry', 'New Randomization Each N Tries (default N=1)'],
+ [ 'practice', 'Practice'],
+ [ 'surveycred', 'Survey (credit for submission)']],
+ 'string_lenient'
+ => [['yes', 'Yes' ],
+ [ 'no', 'No' ],
+ [ 'default', 'Default - only bubblesheet grading is lenient' ]],
+ 'string_discussvote'
+ => [['yes','Yes'],
+ ['notended','Yes, unless discussion ended'],
+ ['no','No']],
);
+sub standard_string_options {
+ my ($string_type) = @_;
+ if (ref($strings{$string_type}) eq 'ARRAY') {
+ return $strings{$string_type};
+ }
+ return;
+}
sub string_selector {
- my ($thistype, $thiskey, $showval) = @_;
+ my ($thistype, $thiskey, $showval, $name, $readonly) = @_;
if (!exists($strings{$thistype})) {
- return &default_selector($thiskey,$showval);
+ return &default_selector($thiskey,$showval,$readonly);
}
- my $result;
- foreach my $possibilities (@{ $strings{$thistype} }) {
- my ($name, $description) = @{ $possibilities };
- $result .= ' ';
+ my $numinrow = 3;
+ if ($thistype eq 'string_problemstatus') {
+ $numinrow = 2;
+ } elsif ($thistype eq 'string_questiontype') {
+ if (keys(%skiptype) > 0) {
+ $numinrow = 4;
+ }
+ }
+ my $rem;
+ if (ref($strings{$thistype}) eq 'ARRAY') {
+ my $i=0;
+ foreach my $possibilities (@{ $strings{$thistype} }) {
+ next unless (ref($possibilities) eq 'ARRAY');
+ my ($name, $description) = @{ $possibilities };
+ next if ($skiptype{$name});
+ $rem = $i%($numinrow);
+ if ($rem == 0) {
+ if ($i > 0) {
+ $result .= '';
+ }
+ $result .= '';
+ }
+ $result .= ''.
+ ''.
+ ' ';
+ $i++;
+ }
+ $rem = @{ $strings{$thistype} }%($numinrow);
+ my $colsleft = $numinrow - $rem;
+ if ($colsleft > 1 ) {
+ $result .= ''.
+ ' ';
+ } elsif ($colsleft == 1) {
+ $result .= ' ';
+ }
+ $result .= ' ';
+ }
+ if ($result) {
+ $result = '';
}
return $result;
}
@@ -3087,17 +3449,34 @@ sub dateshift {
}
sub newoverview {
- my ($r) = @_;
+ my ($r,$parm_permission) = @_;
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
text=>"Overview Mode"});
- my $start_page = &Apache::loncommon::start_page('Set Parameters');
+
+ my %loaditems = (
+ 'onload' => "showHide_courseContent(); resize_scrollbox('mapmenuscroll','1','1');",
+ );
+ my $js = '
+
+';
+ my $start_page = &Apache::loncommon::start_page('Set Parameters',$js,
+ {'add_entries' => \%loaditems,});
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
+ $r->print($start_page.$breadcrumbs);
$r->print(<
ENDOVER
my @ids=();
@@ -3123,6 +3502,7 @@ ENDOVER
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat');
my $pschp=$env{'form.pschp'};
+
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt');
if (!@psprt) { $psprt[0]='0'; }
@@ -3134,6 +3514,9 @@ ENDOVER
@selected_sections = ('all');
}
}
+ if ($env{'request.course.sec'} ne '') {
+ @selected_sections = ($env{'request.course.sec'});
+ }
my @selected_groups =
&Apache::loncommon::get_env_multiple('form.Group');
@@ -3158,7 +3541,7 @@ ENDOVER
$r->print('');
#$r->print('
Step 1 ');
$r->print('
');
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
+ $r->print(&Apache::lonhtmlcommon::start_pick_box(undef,'parmlevel'));
&levelmenu($r,\%alllevs,$parmlev);
if ($parmlev ne 'general') {
$r->print(&Apache::lonhtmlcommon::row_closure());
@@ -3170,22 +3553,29 @@ ENDOVER
$r->print('
');
$r->print('
');
- $r->print(&Apache::lonhtmlcommon::start_pick_box());
- &parmmenu($r,\%allparms,\@pscat,\%keyorder);
- $r->print(&Apache::lonhtmlcommon::end_pick_box());
- &parmboxes($r,\%allparms,\@pscat,\%keyorder);
+ &displaymenu($r,\%allparms,\@pscat,\%keyorder);
$r->print(&Apache::lonhtmlcommon::start_pick_box());
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
+ my $sectionselector = §ionmenu(\@selected_sections);
+ my $groupselector = &groupmenu(\@selected_groups);
$r->print('
'.
- ''.&mt('Parts').' '.&mt('Section(s)').
- ' '.&mt('Group(s)').' ');
+ ' '.&mt('Parts').' ');
+ if ($sectionselector) {
+ $r->print(''.&mt('Section(s)').' ');
+ }
+ if ($groupselector) {
+ $r->print(''.&mt('Group(s)').' ');
+ }
+ $r->print('');
&partmenu($r,\%allparts,\@psprt);
- $r->print(' ');
- §ionmenu($r,\@selected_sections);
- $r->print(' ');
- &groupmenu($r,\@selected_groups);
- $r->print('
');
- #$r->print('');
+ $r->print('');
+ if ($sectionselector) {
+ $r->print('
'.$sectionselector.' ');
+ }
+ if ($groupselector) {
+ $r->print('
'.$groupselector.' ');
+ }
+ $r->print('');
$r->print(&Apache::lonhtmlcommon::row_closure(1));
$r->print(&Apache::lonhtmlcommon::end_pick_box());
$r->print('
');
@@ -3219,11 +3609,14 @@ ENDOVER
# List data
- &listdata($r,$resourcedata,$listdata,$sortorder);
+ &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly);
+ }
+ $r->print(&tableend());
+ unless ($readonly) {
+ $r->print(((($env{'form.store'}) || ($env{'form.dis'}))?'
':''));
}
- $r->print(&tableend().
- ((($env{'form.store'}) || ($env{'form.dis'}))?'
':'').
- ''.&Apache::loncommon::end_page());
+ $r->print('');
+ $r->print(&Apache::loncommon::end_page());
}
sub secgroup_lister {
@@ -3262,39 +3655,54 @@ sub secgroup_lister {
}
sub overview {
- my ($r) = @_;
+ my ($r,$parm_permission) = @_;
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
-
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
text=>"Overview Mode"});
my $start_page=&Apache::loncommon::start_page('Modify Parameters');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
- $r->print(<
-ENDOVER
-# Store modified
+ $r->print($start_page.$breadcrumbs);
+ $r->print(''.
- &Apache::loncommon::end_page());
+ $r->print(&tableend().'');
+ if ($foundkeys) {
+ unless ($readonly) {
+ $r->print('
'.$submitbutton.'
');
+ }
+ } else {
+ $r->print(''.&mt('There are no parameters.').'
');
+ }
+ $r->print(''.&Apache::loncommon::end_page());
}
sub clean_parameters {
@@ -3356,10 +3764,8 @@ ENDOVER
$r->print(&mt('All users'));
} elsif ($data{'scope_type'} eq 'user') {
$r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
- } elsif ($data{'scope_type'} eq 'section') {
- $r->print(&mt('Section: [_1]',$data{'scope'}));
- } elsif ($data{'scope_type'} eq 'group') {
- $r->print(&mt('Group: [_1]',$data{'scope'}));
+ } elsif ($data{'scope_type'} eq 'secgroup') {
+ $r->print(&mt('Group/Section: [_1]',$data{'scope'}));
}
$r->print(' ');
if ($data{'realm_type'} eq 'all') {
@@ -3369,8 +3775,9 @@ ENDOVER
} elsif ($data{'realm_type'} eq 'symb') {
my ($map,$resid,$url) =
&Apache::lonnet::decode_symb($data{'realm'});
- $r->print(&mt('Resource: [_1] with ID: [_2] in folder [_3]',
- $url,$resid,$map));
+ $r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]',
+ $url.' ',
+ $resid.' ',$map));
}
$r->print(' '.&mt('Part: [_1]',$data{'parameter_part'}));
$r->print('');
@@ -3379,8 +3786,8 @@ ENDOVER
}
$r->print(&Apache::loncommon::end_data_table().''.
' '.
- '
'.
- &Apache::loncommon::end_page());
+ '');
+ $r->print(&Apache::loncommon::end_page());
}
sub date_shift_one {
@@ -3392,11 +3799,8 @@ sub date_shift_one {
text=>"Shifting Dates"});
my $start_page=&Apache::loncommon::start_page('Shift Dates');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
- $r->print(<print('