version 1.522.2.23.2.1, 2017/06/13 16:20:44
|
version 1.534, 2013/06/27 18:12:22
|
Line 46 This module sets coursewide and assessme
|
Line 46 This module sets coursewide and assessme
|
|
|
=over |
=over |
|
|
|
=pod |
|
|
=item parmval() |
=item parmval() |
|
|
Figure out a cascading parameter. |
Figure out a cascading parameter. |
Line 137 javascript function 'pjump'.
|
Line 139 javascript function 'pjump'.
|
|
|
extractResourceInformation extracts lots of information about all of the 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<env{'user.name'}> : Current username |
=item * B<env{'user.name'}> : Current username |
|
|
=item * B<env{'user.domain'}> : Domain of current user. |
=item * B<env{'user.domain'}> : Domain of current user. |
|
|
=item * B<env{"request.course.fn"}> : Course |
=item * b<env{"request.course.fn"} : Course |
|
|
=back |
|
|
|
Outputs: See list below |
|
|
|
=over 4 |
Outputs: See list below: |
|
|
=item * B<ids> (out) : An array that will contain all of the ids in the course. |
=item * B<ids> (out) : An array that will contain all of the ids in the course. |
|
|
Line 177 Outputs: See list below
|
Line 173 Outputs: See list below
|
|
|
=item * B<defkeytype> |
=item * B<defkeytype> |
|
|
=back |
|
|
|
=item isdateparm() |
=item isdateparm() |
|
|
=item parmmenu() |
=item parmmenu() |
Line 216 Returns: nothing
|
Line 210 Returns: nothing
|
|
|
Variables used (guessed by Jeremy): |
Variables used (guessed by Jeremy): |
|
|
=over |
|
|
|
=item * B<pscat>: 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<pscat>: 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<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
=item * B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
Line 230 Variables used (guessed by Jeremy):
|
Line 222 Variables used (guessed by Jeremy):
|
When storing information, store as part 0 |
When storing information, store as part 0 |
When requesting information, request from full part |
When requesting information, request from full part |
|
|
=back |
|
|
|
=item tablestart() |
=item tablestart() |
|
|
=item tableend() |
=item tableend() |
Line 298 Set portfolio metadata
|
Line 288 Set portfolio metadata
|
|
|
Main handler. Calls &assessparms subroutine. |
Main handler. Calls &assessparms subroutine. |
|
|
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 323 use HTML::Entities;
|
Line 314 use HTML::Entities;
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
|
sub startSettingsScreen { |
|
my ($r,$mode,$crstype)=@_; |
|
|
|
my $tabtext = &mt('Course Settings'); |
|
if ($crstype eq 'Community') { |
|
$tabtext = &mt('Community Settings'); |
|
} |
|
$r->print("\n".'<ul class="LC_TabContentBigger" id="main">'); |
|
$r->print("\n".'<li'.($mode eq 'coursepref'?' class="active"':'').'><a href="/adm/courseprefs"><b> '. |
|
$tabtext. |
|
' </b></a></li>'); |
|
|
|
$r->print("\n".'<li'.($mode eq 'parmset'?' class="active"':'').' id="tabbededitor"><a href="/adm/parmset"><b>'. |
|
&mt('Content and Problem Settings').'</b></a></li>'); |
|
$r->print("\n".'</ul>'."\n"); |
|
$r->print('<div class="LC_Box" style="clear:both;margin:0;" id="parameditor"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'); |
|
} |
|
|
|
sub endSettingsScreen { |
|
my ($r)=@_; |
|
$r->print('</div></div></div>'); |
|
} |
|
|
|
|
|
|
sub parmval { |
sub parmval { |
my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, |
return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec, |
Line 752 sub storeparm_by_symb_inner {
|
Line 768 sub storeparm_by_symb_inner {
|
|
|
|
|
sub valout { |
sub valout { |
my ($value,$type,$name,$editable)=@_; |
my ($value,$type,$editable)=@_; |
my $result = ''; |
my $result = ''; |
# Values of zero are valid. |
# Values of zero are valid. |
if (! $value && $value ne '0') { |
if (! $value && $value ne '0') { |
Line 760 sub valout {
|
Line 776 sub valout {
|
$result = |
$result = |
'<img src="/res/adm/pages/editmap.png"' |
'<img src="/res/adm/pages/editmap.png"' |
.' alt="'.&mt('Change').'"' |
.' alt="'.&mt('Change').'"' |
.' title="'.&mt('Change').'" style="border:0;" />'; |
.' title="'.&mt('Change').'" />'; |
} else { |
} else { |
$result=' '; |
$result=' '; |
} |
} |
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($totalsecs,$donesuffix) = split(/_/,$value,2); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($usesdone,$donebuttontext,$proctor,$secretkey); |
|
if ($donesuffix =~ /^done\:([^\:]+)\:(.*)$/) { |
|
$donebuttontext = $1; |
|
(undef,$proctor,$secretkey) = split(/_/,$2); |
|
$usesdone = 'done'; |
|
} elsif ($donesuffix =~ /^done(|_.+)$/) { |
|
$donebuttontext = &mt('Done'); |
|
($usesdone,$proctor,$secretkey) = split(/_/,$donesuffix); |
|
} |
|
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($totalsecs); |
|
my @timer; |
my @timer; |
$year=$year-70; |
$year=$year-70; |
$mday--; |
$mday--; |
Line 809 sub valout {
|
Line 815 sub valout {
|
push(@timer,&mt('[quant,_1,sec]',0)); |
push(@timer,&mt('[quant,_1,sec]',0)); |
} |
} |
$result.=join(", ",@timer); |
$result.=join(", ",@timer); |
if ($usesdone eq 'done') { |
|
if ($secretkey) { |
|
$result .= ' '.&mt('+ "[_1]" with proctor key: [_2]',$donebuttontext,$secretkey); |
|
} else { |
|
$result .= ' + "'.$donebuttontext.'"'; |
|
} |
|
} |
|
} elsif (&isdateparm($type)) { |
} elsif (&isdateparm($type)) { |
$result = &Apache::lonlocal::locallocaltime($value). |
$result = &Apache::lonlocal::locallocaltime($value). |
&date_sanity_info($value); |
&date_sanity_info($value); |
Line 842 sub plink {
|
Line 841 sub plink {
|
my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/); |
my ($parmname)=((split(/\&/,$marker))[1]=~/\_([^\_]+)$/); |
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
unless (defined($winvalue)) { $winvalue=$val; } |
unless (defined($winvalue)) { $winvalue=$val; } |
my $valout = &valout($value,$type,$parmname,1); |
my $valout = &valout($value,$type,1); |
my $unencmarker = $marker; |
my $unencmarker = $marker; |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
\$hour, \$min, \$sec) { |
\$hour, \$min, \$sec) { |
Line 895 sub page_js {
|
Line 894 sub page_js {
|
var newWin = window.open(url, wdwName, options); |
var newWin = window.open(url, wdwName, options); |
newWin.focus(); |
newWin.focus(); |
} |
} |
|
|
// ]]> |
// ]]> |
|
|
</script> |
</script> |
$selscript |
$selscript |
ENDJS |
ENDJS |
Line 922 function showHide_courseContent() {
|
Line 923 function showHide_courseContent() {
|
COURSECONTENTSCRIPT |
COURSECONTENTSCRIPT |
} |
} |
|
|
sub done_proctor_js { |
|
return <<"END"; |
|
function toggleSecret(form,radio,key) { |
|
var radios = form[radio+key]; |
|
if (radios.length) { |
|
for (var i=0; i<radios.length; i++) { |
|
if (radios[i].checked) { |
|
if (radios[i].value == '_done_proctor') { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='text'; |
|
} |
|
} else { |
|
if (document.getElementById('done_'+key+'_proctorkey')) { |
|
document.getElementById('done_'+key+'_proctorkey').type='hidden'; |
|
document.getElementById('done_'+key+'_proctorkey').value=''; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
END |
|
|
|
} |
|
|
|
sub startpage { |
sub startpage { |
my ($r,$psymb) = @_; |
my ($r,$psymb,$crstype) = @_; |
|
|
my %loaditems = ( |
my %loaditems = ( |
'onload' => "group_or_section('cgroup')", |
'onload' => "group_or_section('cgroup')", |
Line 975 sub startpage {
|
Line 951 sub startpage {
|
</script> |
</script> |
'; |
'; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set/Modify Course Parameters',$js, |
&Apache::loncommon::start_page('Set/Modify Course Parameters',$js, |
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); |
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'}); |
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); |
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'}); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<input type="hidden" value="" name="pres_value" /> |
<input type="hidden" value="" name="pres_value" /> |
Line 996 ENDHEAD
|
Line 973 ENDHEAD
|
|
|
sub print_row { |
sub print_row { |
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone, |
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone, |
$defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp, |
$defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_; |
$readonly)=@_; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
Line 1036 sub print_row {
|
Line 1012 sub print_row {
|
my $thismarker=$which; |
my $thismarker=$which; |
$thismarker=~s/^parameter\_//; |
$thismarker=~s/^parameter\_//; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
my $effective_parm = &valout($outpar[$result],$typeoutpar[$result],$thismarker); |
my $effective_parm = &valout($outpar[$result],$typeoutpar[$result]); |
my ($othergrp,$grp_parm,$controlgrp); |
my ($othergrp,$grp_parm,$controlgrp); |
|
|
if ($parmlev eq 'general') { |
if ($parmlev eq 'general') { |
|
|
if ($uname) { |
if ($uname) { |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} elsif ($parmlev eq 'map') { |
} elsif ($parmlev eq 'map') { |
|
|
if ($uname) { |
if ($uname) { |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} else { |
} else { |
if ($uname) { |
if ($uname) { |
Line 1079 sub print_row {
|
Line 1055 sub print_row {
|
} |
} |
} |
} |
|
|
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
&print_td($r,13,$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,'',$readonly); |
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
if ($csec) { |
if ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
if ($cgroup) { |
if ($cgroup) { |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
if ($uname) { |
if ($uname) { |
if ($othergrp) { |
if ($othergrp) { |
$r->print($othergrp); |
$r->print($othergrp); |
} |
} |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
} # end of $parmlev if/else |
} # end of $parmlev if/else |
Line 1116 sub print_row {
|
Line 1092 sub print_row {
|
my $sessionvaltype=$typeoutpar[$result]; |
my $sessionvaltype=$typeoutpar[$result]; |
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } |
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } |
$r->print('<td style="background-color:#999999;" align="center"><font color="#FFFFFF">'. |
$r->print('<td style="background-color:#999999;" align="center"><font color="#FFFFFF">'. |
&valout($sessionval,$sessionvaltype,$$name{$which}).' '. |
&valout($sessionval,$sessionvaltype).' '. |
'</font></td>'); |
'</font></td>'); |
} |
} |
$r->print('</tr>'); |
$r->print('</tr>'); |
Line 1124 sub print_row {
|
Line 1100 sub print_row {
|
} |
} |
|
|
sub print_td { |
sub print_td { |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp,$readonly)=@_; |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
';" align="center">'); |
';" align="center">'); |
my $nolink = 0; |
my $nolink = 0; |
if ($readonly) { |
if ($which == 11 || $which == 12) { |
$nolink = 1; |
$nolink = 1; |
} else { |
} elsif ($mprefix =~ /availablestudent\&$/) { |
if ($which == 11 || $which == 12) { |
if ($which > 3) { |
|
$nolink = 1; |
|
} |
|
} elsif ($mprefix =~ /examcode\&$/) { |
|
unless ($which == 2) { |
$nolink = 1; |
$nolink = 1; |
} elsif ($mprefix =~ /availablestudent\&$/) { |
|
if ($which > 3) { |
|
$nolink = 1; |
|
} |
|
} elsif ($mprefix =~ /examcode\&$/) { |
|
unless ($which == 2) { |
|
$nolink = 1; |
|
} |
|
} |
} |
} |
} |
if ($nolink) { |
if ($nolink) { |
$r->print(&valout($$outpar[$which],$$typeoutpar[$which],$mprefix)); |
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
} else { |
} else { |
$r->print(&plink($$typeoutpar[$which], |
$r->print(&plink($$typeoutpar[$which], |
$$display{$value},$$outpar[$which], |
$$display{$value},$$outpar[$which], |
Line 1169 sub print_usergroups {
|
Line 1141 sub print_usergroups {
|
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if ($result > 3) { |
if ($result > 3) { |
$bgcolor = '#AAFFAA'; |
$bgcolor = '#AAFFAA'; |
$grp_parm = &valout($coursereply,$resulttype,$what); |
$grp_parm = &valout($coursereply,$resulttype); |
} |
} |
$grp_parm = &valout($coursereply,$resulttype,$what); |
$grp_parm = &valout($coursereply,$resulttype); |
$output = '<td style="background-color:'.$bgcolor.';" align="center">'; |
$output = '<td style="background-color:'.$bgcolor.';" align="center">'; |
if ($resultgroup && $resultlevel) { |
if ($resultgroup && $resultlevel) { |
$output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm; |
$output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm; |
Line 1429 sub lookUpTableParameter {
|
Line 1401 sub lookUpTableParameter {
|
'contentopen' => 'time_settings', |
'contentopen' => 'time_settings', |
'contentclose' => 'time_settings', |
'contentclose' => 'time_settings', |
'discussend' => 'time_settings', |
'discussend' => 'time_settings', |
'printstartdate' => 'time_settings', |
'printopendate' => 'time_settings', |
'printenddate' => 'time_settings', |
'printclosedate' => 'time_settings', |
'weight' => 'grading', |
'weight' => 'grading', |
'handgrade' => 'grading', |
'handgrade' => 'grading', |
'maxtries' => 'tries', |
'maxtries' => 'tries', |
Line 1465 sub lookUpTableParameter {
|
Line 1437 sub lookUpTableParameter {
|
'lenient' => 'grading', |
'lenient' => 'grading', |
'retrypartial' => 'tries', |
'retrypartial' => 'tries', |
'discussvote' => 'misc', |
'discussvote' => 'misc', |
'examcode' => 'high_level_randomization', |
'examcode' => 'high_level_randomization', |
); |
); |
} |
} |
|
|
Line 1542 sub parmboxes {
|
Line 1514 sub parmboxes {
|
|
|
#Print parameters |
#Print parameters |
for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) { |
for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) { |
next if(@{$categoryList{$key}} == 0); |
if(@{$categoryList{$key}} == 0) { |
$r->print('<div class="LC_Box LC_400Box">' |
next; |
.'<h4 class="LC_hcell">' |
} else { |
.&mt($categories{$key}) |
$r->print('<div class="LC_Box LC_400Box">' |
.'</h4>'."\n"); |
.'<h4 class="LC_hcell">' |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
.&mt($categories{$key}) |
$r->print('<span class="LC_nobreak">' |
.'</h4>'."\n"); |
.'<label><input type="checkbox" name="pscat" ' |
foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) { |
.'value="'.$tempkey.'" '); |
$r->print('<span class="LC_nobreak">' |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
.'<label><input type="checkbox" name="pscat" '); |
$r->print(' checked="checked"'); |
$r->print('value="'.$tempkey.'" '); |
} |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
$r->print(' checked="checked"'); |
|
} |
|
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: $tempkey) |
: $tempkey) |
.'</label></span><br />'."\n"); |
.'</label></span><br />'."\n"); |
|
} |
|
$r->print("</div>\n"); |
} |
} |
$r->print("</div>\n"); |
|
} |
} |
|
|
$r->print("</div>\n"); |
$r->print("</div>\n"); |
Line 1726 function group_or_section(caller) {
|
Line 1701 function group_or_section(caller) {
|
# This function shows on table Mode the available Parameters for the selected Resources |
# This function shows on table Mode the available Parameters for the selected Resources |
# |
# |
sub displaymenu { |
sub displaymenu { |
my ($r,$allparms,$pscat,$psprt,$keyorder,$divid)=@_; |
my ($r,$allparms,$pscat,$psprt,$keyorder)=@_; |
|
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
|
|
&parmmenu($r,$allparms,$pscat,$keyorder); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::loncommon::start_scrollbox('480px','440px','200px',$divid)); |
$r->print(&Apache::loncommon::start_scrollbox()); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
&parmboxes($r,$allparms,$pscat,$keyorder); |
$r->print(&Apache::loncommon::end_scrollbox()); |
$r->print(&Apache::loncommon::end_scrollbox()); |
|
|
Line 1806 sub mapmenu {
|
Line 1781 sub mapmenu {
|
.'</div>' |
.'</div>' |
); |
); |
|
|
$r->print(&Apache::loncommon::start_scrollbox('700px','680px','400px','mapmenuscroll')); |
$r->print(&Apache::loncommon::start_scrollbox(undef,undef,undef,'mapmenuscroll')); |
$r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); |
$r->print(&Apache::loncommon::start_data_table(undef,'mapmenuinner')); |
|
|
# Display row: "All Maps or Folders" |
# Display row: "All Maps or Folders" |
Line 2017 sub standardkeyorder {
|
Line 1992 sub standardkeyorder {
|
'parameter_0_discussend' => 19, |
'parameter_0_discussend' => 19, |
'parameter_0_discusshide' => 20, |
'parameter_0_discusshide' => 20, |
'parameter_0_discussvote' => 21, |
'parameter_0_discussvote' => 21, |
'parameter_0_printstartdate' => 22, |
'parameter_0_printopendate' => 22, |
'parameter_0_printenddate' => 23); |
'parameter_0_printclosedate' => 23); |
} |
} |
|
|
|
|
sub assessparms { |
sub assessparms { |
|
|
my ($r,$parm_permission) = @_; |
my $r=shift; |
|
|
|
|
|
|
# -------------------------------------------------------- Variable declaration |
# -------------------------------------------------------- Variable declaration |
Line 2068 sub assessparms {
|
Line 2044 sub assessparms {
|
|
|
$csec=$env{'form.csec'}; |
$csec=$env{'form.csec'}; |
$cgroup=$env{'form.cgroup'}; |
$cgroup=$env{'form.cgroup'}; |
my $noeditgrp; |
|
if ($cgroup ne '') { |
|
unless (&Apache::lonnet::allowed('mdg',$env{'request.course.id'})) { |
|
if (($env{'request.course.groups'} eq '') || |
|
(!grep(/^\Q$cgroup\E$/,split(/,/,$env{'request.course.groups'})))) { |
|
$noeditgrp = 1; |
|
} |
|
} |
|
} |
|
|
|
if ($udom=$env{'form.udom'}) { |
if ($udom=$env{'form.udom'}) { |
} elsif ($udom=$env{'request.role.domain'}) { |
} elsif ($udom=$env{'request.role.domain'}) { |
Line 2091 sub assessparms {
|
Line 2058 sub assessparms {
|
|
|
|
|
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
if (!@psprt) { $psprt[0]='0'; } |
if (!@psprt) { $psprt[0]='all'; } |
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
if (($env{'form.part'}) && ($psprt[0] ne 'all')) { $psprt[0]=$env{'form.part'}; } |
|
|
my $pssymb=''; |
my $pssymb=''; |
Line 2184 sub assessparms {
|
Line 2151 sub assessparms {
|
$symbp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
|
|
# ---------------------------------------------------------- Anything to store? |
# ---------------------------------------------------------- Anything to store? |
if ($env{'form.pres_marker'} && $parm_permission->{'edit'}) { |
if ($env{'form.pres_marker'}) { |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
Line 2193 sub assessparms {
|
Line 2160 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 $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 2227 sub assessparms {
|
Line 2194 sub assessparms {
|
} |
} |
} |
} |
} |
} |
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode|printstartdate|printenddate)\&\d+$/) { |
} elsif ($markers[$i] =~ /_(type|lenient|retrypartial|discussvote|examcode)\&\d+$/) { |
$name = $1; |
$name = $1; |
my $val = $values[$i]; |
my $val = $values[$i]; |
if ($name eq 'examcode') { |
if ($name eq 'examcode') { |
if (&Apache::lonnet::validCODE($values[$i])) { |
if (&Apache::lonnet::validCODE($values[$i])) { |
$val = 'valid'; |
$val = 'valid'; |
} |
} |
} elsif ($name eq 'printstartdate') { |
|
if ($val =~ /^\d+$/) { |
|
if ($val > $now) { |
|
$val = 'future'; |
|
} |
|
} |
|
} elsif ($name eq 'printenddate') { |
|
if ($val =~ /^\d+$/) { |
|
if ($val < $now) { |
|
$val = 'past'; |
|
} |
|
} |
|
} |
} |
$needsrelease = |
$needsrelease = |
$Apache::lonnet::needsrelease{"parameter:$name:$val"}; |
$Apache::lonnet::needsrelease{"parameter:$name:$val"}; |
Line 2256 sub assessparms {
|
Line 2211 sub assessparms {
|
} |
} |
$needsnewer = ¶meter_releasecheck($name,$val, |
$needsnewer = ¶meter_releasecheck($name,$val, |
$needsrelease, |
$needsrelease, |
|
$chostname, |
$cmajor,$cminor); |
$cmajor,$cminor); |
} |
} |
} |
} |
Line 2284 sub assessparms {
|
Line 2240 sub assessparms {
|
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
&startpage($r,$pssymb); |
my $crstype = &Apache::loncommon::course_type(); |
|
&startpage($r,$pssymb,$crstype); |
|
|
foreach ('tolerance','date_default','date_start','date_end', |
foreach ('tolerance','date_default','date_start','date_end', |
'date_interval','int','float','string') { |
'date_interval','int','float','string') { |
Line 2336 ENDPARMSELSCRIPT
|
Line 2293 ENDPARMSELSCRIPT
|
|
|
# Step 2 |
# Step 2 |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(2,&mt('Parameter Specification'),'parmstep2')); |
&displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder,'parmmenuscroll'); |
&displaymenu($r,\%allparms,\@pscat,\@psprt,\%keyorder); |
|
|
# Step 3 |
# Step 3 |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3')); |
$r->print(&Apache::lonhtmlcommon::topic_bar(3,&mt('User Specification (optional)'),'parmstep3')); |
Line 2364 ENDPARMSELSCRIPT
|
Line 2321 ENDPARMSELSCRIPT
|
.'</a>' |
.'</a>' |
.'</p>'); |
.'</p>'); |
} else { |
} else { |
$r->print(); |
|
# parameter screen for a single resource. |
# parameter screen for a single resource. |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$iid,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
my $title = &Apache::lonnet::gettitle($pssymb); |
Line 2374 ENDPARMSELSCRIPT
|
Line 2330 ENDPARMSELSCRIPT
|
'<br />'); |
'<br />'); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::topic_bar('',&mt('Additional Display Specification (optional)'))); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')). |
|
'<label>'. |
|
'<input type="checkbox" name="psprt" value="all"'. |
|
($env{'form.psprt'}?' checked="checked"':'').' />'. |
|
&mt('Show all parts'). |
|
'</label></td></tr>'); |
|
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$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()); |
Line 2409 ENDPARMSELSCRIPT
|
Line 2359 ENDPARMSELSCRIPT
|
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my $csuname=$env{'user.name'}; |
my $csuname=$env{'user.name'}; |
my $csudom=$env{'user.domain'}; |
my $csudom=$env{'user.domain'}; |
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
# |
# |
Line 2498 ENDTABLEHEADFOUR
|
Line 2444 ENDTABLEHEADFOUR
|
my $defbgtwo=''; |
my $defbgtwo=''; |
my $defbgthree = ''; |
my $defbgthree = ''; |
|
|
foreach (@ids) { |
foreach my $rid (@ids) { |
|
|
my $rid=$_; |
|
my ($inmapid)=($rid=~/\.(\d+)$/); |
my ($inmapid)=($rid=~/\.(\d+)$/); |
|
|
if ((!$pssymb && |
if ((!$pssymb && |
Line 2598 ENDTABLEHEADFOUR
|
Line 2543 ENDTABLEHEADFOUR
|
&print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default, |
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$cgroup,\@usersgroups,$noeditgrp,$readonly); |
$cgroup,\@usersgroups); |
} |
} |
} |
} |
} |
} |
Line 2721 ENDTABLEHEADFOUR
|
Line 2666 ENDTABLEHEADFOUR
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
$parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp, |
$parmlev,$uname,$udom,$csec,$cgroup); |
$readonly); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
.'</div>' |
.'</div>' |
Line 2812 ENDMAPONE
|
Line 2756 ENDMAPONE
|
foreach (&keysinorder(\%name,\%keyorder)) { |
foreach (&keysinorder(\%name,\%keyorder)) { |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
$parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp, |
$parmlev,$uname,$udom,$csec,$cgroup); |
$readonly); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table() |
$r->print(&Apache::loncommon::end_data_table() |
.'</p>' |
.'</p>' |
Line 2823 ENDMAPONE
|
Line 2766 ENDMAPONE
|
} # end of $parmlev eq general |
} # end of $parmlev eq general |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} # end sub assessparms |
} # end sub assessparms |
|
|
Line 2832 ENDMAPONE
|
Line 2776 ENDMAPONE
|
my $tableopen; |
my $tableopen; |
|
|
sub tablestart { |
sub tablestart { |
my ($readonly) = @_; |
|
if ($tableopen) { |
if ($tableopen) { |
return ''; |
return ''; |
} else { |
} else { |
$tableopen=1; |
$tableopen=1; |
my $output = &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th>'; |
return &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th><th>'. |
if ($readonly) { |
&mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>'; |
$output .= '<th>'.&mt('Current value').'</th>'; |
|
} else { |
|
$output .= '<th>'.&mt('Delete').'</th><th>'.&mt('Set to ...').'</th>'; |
|
} |
|
$output .= '</tr>'; |
|
return $output; |
|
} |
} |
} |
} |
|
|
Line 2877 sub readdata {
|
Line 2814 sub readdata {
|
} |
} |
} |
} |
} |
} |
if (wantarray) { |
return $resourcedata; |
return ($resourcedata,$classlist); |
|
} else { |
|
return $resourcedata; |
|
} |
|
} |
} |
|
|
|
|
Line 2897 sub storedata {
|
Line 2830 sub storedata {
|
my @deldata=(); |
my @deldata=(); |
undef @deldata; |
undef @deldata; |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my ($got_chostname,$chostname,$cmajor,$cminor); |
my $now = time; |
|
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
if ($key =~ /^form\.([a-z]+)\_(.+)$/) { |
my $cmd=$1; |
my $cmd=$1; |
Line 2908 sub storedata {
|
Line 2840 sub storedata {
|
$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./; |
$tkey=~s/\.\[useropt\:$tuname\:$tudom\]\./\./; |
} |
} |
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
if ($cmd eq 'set' || $cmd eq 'datepointer' || $cmd eq 'dateinterval') { |
my ($data, $typeof, $text, $name, $valchk); |
my ($data, $typeof, $text, $name); |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
$data=$env{$key}; |
$data=$env{$key}; |
$valchk = $data; |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified parameter for'); |
$text = &mt('Saved modified parameter for'); |
if ($typeof eq 'string_questiontype') { |
if ($typeof eq 'string_questiontype') { |
Line 2921 sub storedata {
|
Line 2852 sub storedata {
|
} elsif ($typeof eq 'string_discussvote') { |
} elsif ($typeof eq 'string_discussvote') { |
$name = 'discussvote'; |
$name = 'discussvote'; |
} elsif ($typeof eq 'string_examcode') { |
} elsif ($typeof eq 'string_examcode') { |
$name = 'examcode'; |
$name = 'examcode'; |
if (&Apache::lonnet::validCODE($data)) { |
|
$valchk = 'valid'; |
|
} |
|
} elsif ($typeof eq 'string_yesno') { |
} elsif ($typeof eq 'string_yesno') { |
if ($thiskey =~ /\.retrypartial$/) { |
if ($thiskey =~ /\.retrypartial$/) { |
$name = 'retrypartial'; |
$name = 'retrypartial'; |
} |
} |
} |
} |
} elsif ($cmd eq 'datepointer') { |
if ($name ne '') { |
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
my ($needsrelease,$needsnewer); |
$typeof=$env{'form.typeof_'.$thiskey}; |
$needsrelease = $Apache::lonnet::needsrelease{"parameter:$name:$data"}; |
$text = &mt('Saved modified date for'); |
if ($needsrelease) { |
if ($typeof eq 'date_start') { |
unless ($got_chostname) { |
if ($thiskey =~ /\.printstartdate$/) { |
($chostname,$cmajor,$cminor)=¶meter_release_vars(); |
$name = 'printstartdate'; |
$got_chostname = 1; |
if (($data) && ($data > $now)) { |
|
$valchk = 'future'; |
|
} |
|
} |
|
} elsif ($typeof eq 'date_end') { |
|
if ($thiskey =~ /\.printenddate$/) { |
|
$name = 'printenddate'; |
|
if (($data) && ($data < $now)) { |
|
$valchk = 'past'; |
|
} |
} |
|
$needsnewer = ¶meter_releasecheck($name,$data, |
|
$needsrelease, |
|
$chostname,$cmajor, |
|
$cminor); |
} |
} |
} |
|
} 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) { |
if ($needsnewer) { |
$r->print('<br />'.&oldversion_warning($name,$data, |
$r->print('<br />'.&oldversion_warning($name,$data, |
$chostname,$cmajor, |
$chostname,$cmajor, |
Line 2972 sub storedata {
|
Line 2878 sub storedata {
|
next; |
next; |
} |
} |
} |
} |
|
} elsif ($cmd eq 'datepointer') { |
|
$data=&Apache::lonhtmlcommon::get_date_from_form($env{$key}); |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
|
$text = &mt('Saved modified date for'); |
|
} elsif ($cmd eq 'dateinterval') { |
|
$data=&get_date_interval_from_form($thiskey); |
|
$typeof=$env{'form.typeof_'.$thiskey}; |
|
$text = &mt('Saved modified date for'); |
} |
} |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if ($tuname) { |
if ($tuname) { |
Line 3015 sub storedata {
|
Line 2929 sub storedata {
|
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
if (&Apache::lonnet::del('resourcedata',\@deldata,$dom,$crs) eq 'ok') { |
my %loghash=map { $_ => '' } @deldata; |
my %loghash=map { $_ => '' } @deldata; |
&log_parmset(\%loghash,1); |
&log_parmset(\%loghash,1); |
$r->print('<h2>'.&mt('Deleted [quant,_1,parameter]',$delentries/2).'</h2>'); |
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)',$delentries).'</h2>'); |
} else { |
} else { |
$r->print('<div class="LC_error">'. |
$r->print('<div class="LC_error">'. |
&mt('Error deleting parameters').'</div>'); |
&mt('Error deleting parameters').'</div>'); |
Line 3025 sub storedata {
|
Line 2939 sub storedata {
|
if ($putentries) { |
if ($putentries) { |
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
if (&Apache::lonnet::put('resourcedata',\%newdata,$dom,$crs) eq 'ok') { |
&log_parmset(\%newdata,0); |
&log_parmset(\%newdata,0); |
$r->print('<h3>'.&mt('Saved [quant,_1,parameter]',$putentries/2).'</h3>'); |
$r->print('<h3>'.&mt('Saved [_1] parameter(s)',$putentries/2).'</h3>'); |
} else { |
} else { |
$r->print('<div class="LC_error">'. |
$r->print('<div class="LC_error">'. |
&mt('Error saving parameters').'</div>'); |
&mt('Error saving parameters').'</div>'); |
Line 3060 sub parse_listdata_key {
|
Line 2974 sub parse_listdata_key {
|
} |
} |
|
|
sub listdata { |
sub listdata { |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_; |
my ($r,$resourcedata,$listdata,$sortorder)=@_; |
# Start list output |
# Start list output |
|
|
my $oldsection=''; |
my $oldsection=''; |
Line 3170 sub listdata {
|
Line 3084 sub listdata {
|
# Ready to print |
# Ready to print |
# |
# |
my $parmitem = &standard_parameter_names($name); |
my $parmitem = &standard_parameter_names($name); |
$r->print(&tablestart($readonly). |
$r->print(&tablestart(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><b>'.&mt($parmitem). |
'<td><b>'.&mt($parmitem). |
'</b></td>'); |
'</b></td><td><input type="checkbox" name="del_'. |
unless ($readonly) { |
$thiskey.'" /></td><td>'); |
$r->print('<td><input type="checkbox" name="del_'. |
|
$thiskey.'" /></td>'); |
|
} |
|
$r->print('<td>'); |
|
$foundkeys++; |
$foundkeys++; |
if (&isdateparm($thistype)) { |
if (&isdateparm($thistype)) { |
my $jskey='key_'.$pointer; |
my $jskey='key_'.$pointer; |
my $state; |
$pointer++; |
$pointer++; |
$r->print( |
if ($readonly) { |
&Apache::lonhtmlcommon::date_setter('parmform', |
$state = 'disabled'; |
$jskey, |
} |
$$resourcedata{$thiskey}, |
$r->print( |
'',1,'',''). |
&Apache::lonhtmlcommon::date_setter('parmform', |
|
$jskey, |
|
$$resourcedata{$thiskey}, |
|
'',1,$state)); |
|
unless ($readonly) { |
|
$r->print( |
|
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
&mt('Shift all dates based on this date').'</a></span>':''). |
&mt('Shift all dates based on this date').'</a></span>':''). |
&date_sanity_info($$resourcedata{$thiskey}) |
&date_sanity_info($$resourcedata{$thiskey}) |
); |
); |
} |
|
} elsif ($thistype eq 'date_interval') { |
} elsif ($thistype eq 'date_interval') { |
$r->print(&date_interval_selector($thiskey,$name, |
$r->print(&date_interval_selector($thiskey, |
$$resourcedata{$thiskey},$readonly)); |
$$resourcedata{$thiskey})); |
} elsif ($thistype =~ m/^string/) { |
} elsif ($thistype =~ m/^string/) { |
$r->print(&string_selector($thistype,$thiskey, |
$r->print(&string_selector($thistype,$thiskey, |
$$resourcedata{$thiskey},$name,$readonly)); |
$$resourcedata{$thiskey},$name)); |
} else { |
} else { |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey},$readonly)); |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
} |
|
unless ($readonly) { |
|
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
|
$thistype.'" />'); |
|
} |
} |
|
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
|
$thistype.'" />'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
Line 3221 sub listdata {
|
Line 3122 sub listdata {
|
|
|
|
|
sub date_interval_selector { |
sub date_interval_selector { |
my ($thiskey, $pname, $showval, $readonly) = @_; |
my ($thiskey, $showval) = @_; |
my ($result,%skipval); |
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], |
Line 3234 sub date_interval_selector {
|
Line 3134 sub date_interval_selector {
|
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, |
$result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey, |
\%select,'',$readonly); |
\%select); |
$result .= ' '.&mt($name); |
$result .= ' '.&mt($name); |
} |
} |
if ($pname eq 'interval') { |
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
unless ($skipval{'done'}) { |
|
my $checkedon = ''; |
|
my $checkedproc = ''; |
|
my $currproctorkey = ''; |
|
my $currprocdisplay = 'hidden'; |
|
my $currdonetext = &mt('Done'); |
|
my $checkedoff = ' checked="checked"'; |
|
if ($currval =~ /^(?:\d+)_done$/) { |
|
$checkedon = ' checked="checked"'; |
|
$checkedoff = ''; |
|
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:$/) { |
|
$currdonetext = $1; |
|
$checkedon = ' checked="checked"'; |
|
$checkedoff = ''; |
|
} elsif ($currval =~ /^(?:\d+)_done_proctor_(.+)$/) { |
|
$currproctorkey = $1; |
|
$checkedproc = ' checked="checked"'; |
|
$checkedoff = ''; |
|
$currprocdisplay = 'text'; |
|
} elsif ($currval =~ /^(?:\d+)_done\:([^\:]+)\:_proctor_(.+)$/) { |
|
$currdonetext = $1; |
|
$currproctorkey = $2; |
|
$checkedproc = ' checked="checked"'; |
|
$checkedoff = ''; |
|
$currprocdisplay = 'text'; |
|
} |
|
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
|
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.$disabled.' />'. |
|
&mt('No').'</label>'.(' 'x2). |
|
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.$disabled.' />'. |
|
&mt('Yes').'</label>'.(' 'x2). |
|
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.$disabled.' />'. |
|
&mt('Yes, with proctor key').'</label>'. |
|
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
|
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
|
'<span class="LC_nobreak">'.&mt('Button text').': '. |
|
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
|
} |
|
} |
|
unless ($readonly) { |
|
$result .= '<input type="hidden" name="dateinterval_'.$thiskey.'" />'; |
|
} |
|
return $result; |
return $result; |
|
|
} |
} |
Line 3306 sub get_date_interval_from_form {
|
Line 3159 sub get_date_interval_from_form {
|
|
|
|
|
sub default_selector { |
sub default_selector { |
my ($thiskey, $showval, $readonly) = @_; |
my ($thiskey, $showval) = @_; |
my $disabled; |
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'" />'; |
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
|
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'"'.$disabled.' />'; |
|
} |
} |
|
|
my %strings = |
my %strings = |
Line 3328 my %strings =
|
Line 3177 my %strings =
|
=> [[ 'problem', 'Standard Problem'], |
=> [[ 'problem', 'Standard Problem'], |
[ 'survey', 'Survey'], |
[ 'survey', 'Survey'], |
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
[ 'anonsurveycred', 'Anonymous Survey (credit for submission)'], |
[ 'exam', 'Exam'], |
[ 'exam', 'Bubblesheet Exam'], |
[ 'anonsurvey', 'Anonymous Survey'], |
[ 'anonsurvey', 'Anonymous Survey'], |
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'randomizetry', 'New Randomization Each N Tries (default N=1)'], |
[ 'practice', 'Practice'], |
[ 'practice', 'Practice'], |
Line 3352 sub standard_string_options {
|
Line 3201 sub standard_string_options {
|
} |
} |
|
|
sub string_selector { |
sub string_selector { |
my ($thistype, $thiskey, $showval, $name, $readonly) = @_; |
my ($thistype, $thiskey, $showval, $name) = @_; |
|
|
if (!exists($strings{$thistype})) { |
if (!exists($strings{$thistype})) { |
return &default_selector($thiskey,$showval,$readonly); |
return &default_selector($thiskey,$showval); |
} |
} |
|
|
my %skiptype; |
my %skiptype; |
Line 3374 sub string_selector {
|
Line 3223 sub string_selector {
|
$got_chostname = 1; |
$got_chostname = 1; |
} |
} |
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
my $needsnewer=¶meter_releasecheck($name,$parmval,$needsrelease, |
$cmajor,$cminor); |
$chostname,$cmajor, |
|
$cminor); |
if ($needsnewer) { |
if ($needsnewer) { |
$skiptype{$parmval} = 1; |
$skiptype{$parmval} = 1; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
my ($result,$disabled); |
|
|
|
if ($readonly) { |
my $result; |
$disabled = ' disabled="disabled"'; |
|
} |
|
my $numinrow = 3; |
my $numinrow = 3; |
if ($thistype eq 'string_problemstatus') { |
if ($thistype eq 'string_problemstatus') { |
$numinrow = 2; |
$numinrow = 2; |
Line 3412 sub string_selector {
|
Line 3259 sub string_selector {
|
$result .= '<td class="LC_left_item">'. |
$result .= '<td class="LC_left_item">'. |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="radio" name="set_'.$thiskey. |
'<input type="radio" name="set_'.$thiskey. |
'" value="'.$name.'"'.$disabled; |
'" value="'.$name.'"'; |
if ($showval eq $name) { |
if ($showval eq $name) { |
$result .= ' checked="checked"'; |
$result .= ' checked="checked"'; |
} |
} |
Line 3471 sub dateshift {
|
Line 3318 sub dateshift {
|
} |
} |
|
|
sub newoverview { |
sub newoverview { |
my ($r,$parm_permission) = @_; |
my ($r) = @_; |
|
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $readonly = 1; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
|
|
Line 3491 sub newoverview {
|
Line 3335 sub newoverview {
|
'. |
'. |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&Apache::lonhtmlcommon::resize_scrollbox_js('params')."\n". |
&showhide_js()."\n". |
&showhide_js()."\n". |
&done_proctor_js()."\n". |
|
'// ]]> |
'// ]]> |
</script> |
</script> |
'; |
'; |
Line 3499 sub newoverview {
|
Line 3342 sub newoverview {
|
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
<form method="post" action="/adm/parmset?action=newoverview" name="parmform"> |
ENDOVER |
ENDOVER |
Line 3527 ENDOVER
|
Line 3371 ENDOVER
|
my $pschp=$env{'form.pschp'}; |
my $pschp=$env{'form.pschp'}; |
|
|
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
if (!@psprt) { $psprt[0]='0'; } |
if (!@psprt) { $psprt[0]='all'; } |
|
|
my @selected_sections = |
my @selected_sections = |
&Apache::loncommon::get_env_multiple('form.Section'); |
&Apache::loncommon::get_env_multiple('form.Section'); |
Line 3619 ENDOVER
|
Line 3463 ENDOVER
|
|
|
# List data |
# List data |
|
|
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly); |
&listdata($r,$resourcedata,$listdata,$sortorder); |
} |
} |
$r->print(&tableend()); |
$r->print(&tableend(). |
unless ($readonly) { |
((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':''). |
$r->print(((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'')); |
'</form>'); |
} |
&endSettingsScreen($r); |
$r->print('</form>'); |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3665 sub secgroup_lister {
|
Line 3508 sub secgroup_lister {
|
} |
} |
|
|
sub overview { |
sub overview { |
my ($r,$parm_permission) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $js = '<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
|
&done_proctor_js()."\n". |
|
'// ]]>'."\n". |
|
'</script>'."\n"; |
|
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'.$js); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
$r->print('<form method="post" action="/adm/parmset?action=setoverview" name="parmform">'); |
|
|
# Store modified |
# Store modified |
unless ($readonly) { |
|
&storedata($r,$crs,$dom); |
&storedata($r,$crs,$dom); |
} |
|
|
|
# Read modified data |
# Read modified data |
|
|
my ($resourcedata,$classlist)=&readdata($crs,$dom); |
my $resourcedata=&readdata($crs,$dom); |
|
|
|
|
my $sortorder=$env{'form.sortorder'}; |
my $sortorder=$env{'form.sortorder'}; |
unless ($sortorder) { $sortorder='realmstudent'; } |
unless ($sortorder) { $sortorder='realmstudent'; } |
&sortmenu($r,$sortorder); |
&sortmenu($r,$sortorder); |
|
|
my $submitbutton = '<input type="submit" value="'.&mt('Save').'" />'; |
|
|
|
if ($readonly) { |
|
$r->print('<p>'.$submitbutton.'</p>'); |
|
} |
|
|
|
|
|
# List data |
# List data |
|
|
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist,$readonly); |
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
|
|
$r->print(&tableend().'<p>'); |
$r->print(&tableend().'<p>'. |
if ($foundkeys) { |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':'<span class="LC_info">'.&mt('There are no parameters.').'</span>').'</p></form>'. |
unless ($readonly) { |
&Apache::loncommon::end_page()); |
$r->print('<p>'.$submitbutton.'</p>'); |
|
} |
|
} else { |
|
$r->print('<p class="LC_info">'.&mt('There are no parameters.').'</p>'); |
|
} |
|
$r->print('</form>'.&Apache::loncommon::end_page()); |
|
} |
} |
|
|
sub clean_parameters { |
sub clean_parameters { |
Line 3794 ENDOVER
|
Line 3616 ENDOVER
|
my ($map,$resid,$url) = |
my ($map,$resid,$url) = |
&Apache::lonnet::decode_symb($data{'realm'}); |
&Apache::lonnet::decode_symb($data{'realm'}); |
$r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]', |
$r->print(&mt('Resource: [_1]with ID: [_2]in folder [_3]', |
$url.' <br /> ', |
$url.' <br /> ', |
$resid.' <br /> ',$map)); |
$resid.' <br /> ',$map)); |
} |
} |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print('</td></tr>'); |
$r->print('</td></tr>'); |
Line 3805 ENDOVER
|
Line 3627 ENDOVER
|
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'</p></form>'); |
'</p></form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3812 sub date_shift_one {
|
Line 3635 sub date_shift_one {
|
my ($r) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
text=>"Shifting Dates"}); |
text=>"Shifting Dates"}); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
$r->print('<form name="shiftform" method="post" action="">'. |
&startSettingsScreen($r,'parmset',$crstype); |
|
$r->print('<form name="shiftform" method="post">'. |
'<table><tr><td>'.&mt('Currently set date:').'</td><td>'. |
'<table><tr><td>'.&mt('Currently set date:').'</td><td>'. |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}).'</td></tr>'. |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}).'</td></tr>'. |
'<tr><td>'.&mt('Shifted date:').'</td><td>'. |
'<tr><td>'.&mt('Shifted date:').'</td><td>'. |
&Apache::lonhtmlcommon::date_setter('shiftform', |
&Apache::lonhtmlcommon::dshowerfuck.net |
|
ate_setter('shiftform', |
'timeshifted', |
'timeshifted', |
$env{'form.timebase'},, |
$env{'form.timebase'},, |
''). |
''). |
Line 3830 sub date_shift_one {
|
Line 3656 sub date_shift_one {
|
'<input type="hidden" name="action" value="dateshift2" />'. |
'<input type="hidden" name="action" value="dateshift2" />'. |
'<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'. |
'<input type="hidden" name="timebase" value="'.$env{'form.timebase'}.'" />'. |
'<input type="submit" value="'.&mt('Shift all dates accordingly').'" /></form>'); |
'<input type="submit" value="'.&mt('Shift all dates accordingly').'" /></form>'); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3837 sub date_shift_two {
|
Line 3664 sub date_shift_two {
|
my ($r) = @_; |
my ($r) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
text=>"Shifting Dates"}); |
text=>"Shifting Dates"}); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $start_page=&Apache::loncommon::start_page('Shift Dates'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted'); |
$r->print('<h2>'.&mt('Shift Dates').'</h2>'. |
$r->print(&mt('Shifting all dates such that [_1] becomes [_2]', |
'<p>'.&mt('Shifting all dates such that [_1] becomes [_2]', |
|
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
&Apache::lonlocal::locallocaltime($env{'form.timebase'}), |
&Apache::lonlocal::locallocaltime($timeshifted)).'</p>'); |
&Apache::lonlocal::locallocaltime($timeshifted))); |
my $delta=$timeshifted-$env{'form.timebase'}; |
my $delta=$timeshifted-$env{'form.timebase'}; |
&dateshift($delta); |
&dateshift($delta); |
$r->print( |
&endSettingsScreen($r); |
&Apache::lonhtmlcommon::confirm_success(&mt('Done')). |
|
'<br /><br />'. |
|
&Apache::lonhtmlcommon::actionbox( |
|
['<a href="/adm/parmset">'.&mt('Content and Problem Settings').'</a>'])); |
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3898 sub parse_key {
|
Line 3722 sub parse_key {
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Content and Problem Settings'); |
return &Apache::loncommon::start_page('Settings'); |
} |
} |
|
|
|
|
Line 3911 sub print_main_menu {
|
Line 3735 sub print_main_menu {
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $lc_crstype = lc($crstype); |
my $lc_crstype = lc($crstype); |
|
|
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print(<<ENDMAINFORMHEAD); |
$r->print(<<ENDMAINFORMHEAD); |
<form method="post" enctype="multipart/form-data" |
<form method="post" enctype="multipart/form-data" |
action="/adm/parmset" name="studentform"> |
action="/adm/parmset" name="studentform"> |
Line 3921 ENDMAINFORMHEAD
|
Line 3746 ENDMAINFORMHEAD
|
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}); |
my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}); |
my $vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'}); |
|
my $vpa = &Apache::lonnet::allowed('vpa',$env{'request.course.id'}); |
|
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
'/'.$env{'request.course.sec'}); |
'/'.$env{'request.course.sec'}); |
} |
} |
if ((!$vcb) && ($env{'request.course.sec'} ne '')) { |
|
$vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'}); |
|
} |
|
my (%linktext,%linktitle,%url); |
|
if ($parm_permission->{'edit'}) { |
|
%linktext = ( |
|
newoverview => 'Edit Resource Parameters - Overview Mode', |
|
settable => 'Edit Resource Parameters - Table Mode', |
|
setoverview => 'Modify Resource Parameters - Overview Mode', |
|
); |
|
%linktitle = ( |
|
newoverview => 'Set/Modify resource parameters in overview mode.', |
|
settable => 'Set/Modify resource parameters in table mode.', |
|
setoverview => 'Set/Modify existing resource parameters in overview mode.', |
|
); |
|
} else { |
|
%linktext = ( |
|
newoverview => 'View Resource Parameters - Overview Mode', |
|
settable => 'View Resource Parameters - Table Mode', |
|
setoverview => 'View Resource Parameters - Overview Mode', |
|
); |
|
%linktitle = ( |
|
newoverview => 'Display resource parameters in overview mode.', |
|
settable => 'Display resource parameters in table mode.', |
|
setoverview => 'Display existing resource parameters in overview mode.', |
|
); |
|
} |
|
if ($mgr) { |
|
$linktext{'resettimes'} = 'Reset Student Access Times'; |
|
$linktitle{'resettimes'} = "Reset access times for folders/maps, resources or the $lc_crstype."; |
|
$url{'resettimes'} = '/adm/helper/resettimes.helper'; |
|
} elsif ($vgr) { |
|
$linktext{'resettimes'} = 'Display Student Access Times', |
|
$linktitle{'resettimes'} = "Display access times for folders/maps, resources or the $lc_crstype.", |
|
$url{'resettimes'} = '/adm/accesstimes'; |
|
} |
|
my @menu = |
my @menu = |
( { categorytitle=>"Content Settings for this $crstype", |
( { categorytitle=>"Content Settings for this $crstype", |
items => [ |
items => [ |
{ linktext => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
permission => $parm_permission->{'setrestrictmeta'}, |
permission => $parm_permission, |
linktitle => "Restrict metadata for this $lc_crstype." , |
linktitle => "Restrict metadata for this $lc_crstype." , |
icon =>'contact-new.png' , |
icon =>'contact-new.png' , |
}, |
}, |
{ linktext => $linktext{'resettimes'}, |
{ linktext => 'Reset Student Access Times', |
url => $url{'resettimes'}, |
url => '/adm/helper/resettimes.helper', |
permission => ($vgr || $mgr), |
permission => $mgr, |
linktitle => $linktitle{'resettimes'}, |
linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , |
icon => 'start-here.png', |
icon => 'start-here.png' , |
}, |
}, |
{ linktext => 'Blocking Communication/Resource Access', |
{ linktext => 'Blocking Communication/Resource Access', |
url => '/adm/setblock', |
url => '/adm/setblock', |
permission => ($vcb || $dcm), |
permission => $dcm, |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
icon => 'comblock.png', |
icon => 'comblock.png', |
}, |
}, |
{ linktext => 'Set Parameter Setting Default Actions', |
{ linktext => 'Set Parameter Setting Default Actions', |
url => '/adm/parmset?action=setdefaults', |
url => '/adm/parmset?action=setdefaults', |
permission => $parm_permission->{'setdefaults'}, |
permission => $parm_permission, |
linktitle =>'Set default actions for parameters.' , |
linktitle =>'Set default actions for parameters.' , |
icon => 'folder-new.png' , |
icon => 'folder-new.png' , |
}]}, |
}]}, |
Line 3995 ENDMAINFORMHEAD
|
Line 3782 ENDMAINFORMHEAD
|
items => [ |
items => [ |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
url => '/adm/helper/parameter.helper', |
url => '/adm/helper/parameter.helper', |
permission => $parm_permission->{'helper'}, |
permission => $parm_permission, |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
icon => 'dialog-information.png' , |
icon => 'dialog-information.png' , |
#help => 'Parameter_Helper', |
#help => 'Parameter_Helper', |
}, |
}, |
{ linktext => $linktext{'newoverview'}, |
{ linktext => 'Edit Resource Parameters - Overview Mode', |
url => '/adm/parmset?action=newoverview', |
url => '/adm/parmset?action=newoverview', |
permission => $parm_permission->{'newoverview'}, |
permission => $parm_permission, |
linktitle => $linktitle{'newoverview'}, |
linktitle =>'Set/Modify resource parameters in overview mode.' , |
icon => 'edit-find.png', |
icon => 'edit-find.png' , |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => $linktext{'settable'}, |
{ linktext => 'Edit Resource Parameters - Table Mode', |
url => '/adm/parmset?action=settable', |
url => '/adm/parmset?action=settable', |
permission => $parm_permission->{'settable'}, |
permission => $parm_permission, |
linktitle => $linktitle{'settable'}, |
linktitle =>'Set/Modify resource parameters in table mode.' , |
icon => 'edit-copy.png', |
icon => 'edit-copy.png' , |
#help => 'Table_Mode', |
#help => 'Table_Mode', |
}]}, |
}]}, |
{ categorytitle => 'Existing Parameter Settings for Resources', |
{ categorytitle => 'Existing Parameter Settings for Resources', |
items => [ |
items => [ |
{ linktext => $linktext{'setoverview'}, |
{ linktext => 'Modify Resource Parameters - Overview Mode', |
url => '/adm/parmset?action=setoverview', |
url => '/adm/parmset?action=setoverview', |
permission => $parm_permission->{'setoverview'}, |
permission => $parm_permission, |
linktitle => $linktitle{'setoverview'}, |
linktitle =>'Set/Modify existing resource parameters in overview mode.' , |
icon => 'preferences-desktop-wallpaper.png', |
icon => 'preferences-desktop-wallpaper.png' , |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => 'Change Log', |
{ linktext => 'Change Log', |
url => '/adm/parmset?action=parameterchangelog', |
url => '/adm/parmset?action=parameterchangelog', |
permission => $parm_permission->{'parameterchangelog'}, |
permission => $parm_permission, |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
icon => 'document-properties.png', |
icon => 'document-properties.png', |
}]} |
}]} |
); |
); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
&endSettingsScreen($r); |
return; |
return; |
} |
} |
|
|
Line 4099 sub order_meta_fields {
|
Line 3886 sub order_meta_fields {
|
my $idx = 1; |
my $idx = 1; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};; |
$r->print(&Apache::loncommon::start_page('Order Metadata Fields')); |
$r->print(&Apache::loncommon::start_page('Order Metadata Fields')); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
text=>"Add Metadata Field"}); |
text=>"Add Metadata Field"}); |
Line 4107 sub order_meta_fields {
|
Line 3895 sub order_meta_fields {
|
text=>"Restrict Metadata"}, |
text=>"Restrict Metadata"}, |
{text=>"Order Metadata"}); |
{text=>"Order Metadata"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata')); |
|
&startSettingsScreen($r,'parmset',$crstype); |
if ($env{'form.storeorder'}) { |
if ($env{'form.storeorder'}) { |
my $newpos = $env{'form.newpos'} - 1; |
my $newpos = $env{'form.newpos'} - 1; |
my $currentpos = $env{'form.currentpos'} - 1; |
my $currentpos = $env{'form.currentpos'} - 1; |
Line 4160 sub order_meta_fields {
|
Line 3949 sub order_meta_fields {
|
foreach my $key (@fields_in_order) { |
foreach my $key (@fields_in_order) { |
$r->print('<tr><td>'); |
$r->print('<tr><td>'); |
$r->print('<form method="post" action="">'); |
$r->print('<form method="post" action="">'); |
$r->print('<select name="newpos" onchange="this.form.submit()">'); |
$r->print('<select name="newpos" onChange="this.form.submit()">'); |
for (my $i = 1;$i le $num_fields;$i ++) { |
for (my $i = 1;$i le $num_fields;$i ++) { |
if ($i eq $idx) { |
if ($i eq $idx) { |
$r->print('<option value="'.$i.'" SELECTED>('.$i.')</option>'); |
$r->print('<option value="'.$i.'" SELECTED>('.$i.')</option>'); |
Line 4176 sub order_meta_fields {
|
Line 3965 sub order_meta_fields {
|
$idx ++; |
$idx ++; |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
|
&endSettingsScreen($r); |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
Line 4197 sub addmetafield {
|
Line 3987 sub addmetafield {
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field')); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
&startSettingsScreen($r,'parmset',$crstype); |
if (exists($env{'form.undelete'})) { |
if (exists($env{'form.undelete'})) { |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undeletefield'); |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undeletefield'); |
foreach my $meta_field(@meta_fields) { |
foreach my $meta_field(@meta_fields) { |
Line 4231 sub addmetafield {
|
Line 4023 sub addmetafield {
|
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
$r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.<form method="post" action="/adm/parmset?action=addmetadata">'); |
$r->print('<hr /><strong>Or</strong> you may enter a new metadata field name.<form method="post" action="/adm/parmset?action=addmetadata"'); |
$r->print('<input type="text" name="fieldname" /><br />'); |
$r->print('<input type="text" name="fieldname" /><br />'); |
$r->print('<input type="submit" value="Add Metadata Field" />'); |
$r->print('<input type="submit" value="Add Metadata Field" />'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
|
&endSettingsScreen($r); |
} |
} |
|
|
|
|
Line 4252 sub setrestrictmeta {
|
Line 4045 sub setrestrictmeta {
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
|
&startSettingsScreen($r,'parmset',$crstype); |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $save_field = ''; |
my $save_field = ''; |
if ($env{'form.restrictmeta'}) { |
if ($env{'form.restrictmeta'}) { |
Line 4322 ENDButtons
|
Line 4117 ENDButtons
|
$buttons |
$buttons |
</form> |
</form> |
ENDenv |
ENDenv |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return 'ok'; |
return 'ok'; |
} |
} |
Line 4362 sub defaultsetter {
|
Line 4158 sub defaultsetter {
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
text=>"Set Defaults"}); |
text=>"Set Defaults"}); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
$r->print($start_page.$breadcrumbs); |
$r->print($start_page.$breadcrumbs); |
|
&startSettingsScreen($r,'parmset',$crstype); |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
$r->print('<form method="post" action="/adm/parmset?action=setdefaults" name="defaultform">'); |
|
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my @ids=(); |
my @ids=(); |
my %typep=(); |
my %typep=(); |
my %keyp=(); |
my %keyp=(); |
Line 4423 sub defaultsetter {
|
Line 4221 sub defaultsetter {
|
foreach my $key (keys %allparms) { |
foreach my $key (keys %allparms) { |
$newrules{$key.'_triggers'}=$triggers{$key}; |
$newrules{$key.'_triggers'}=$triggers{$key}; |
} |
} |
&Apache::lonnet::put('parmdefactions',\%newrules,$dom,$crs); |
&Apache::lonnet::put('parmdefactions',\%newrules,$cdom,$cnum); |
&Apache::lonnet::del('parmdefactions',\@delrules,$dom,$crs); |
&Apache::lonnet::del('parmdefactions',\@delrules,$cdom,$cnum); |
&resetrulescache(); |
&resetrulescache(); |
} |
} |
my %lt=&Apache::lonlocal::texthash('days' => 'Days', |
my %lt=&Apache::lonlocal::texthash('days' => 'Days', |
Line 4512 ENDYESNO
|
Line 4310 ENDYESNO
|
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
"\n".'<input type="submit" name="storerules" value="'. |
"\n".'<input type="submit" name="storerules" value="'. |
&mt('Save').'" /></form>'."\n"); |
&mt('Save').'" /></form>'."\n"); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
Line 4599 sub standard_parameter_types {
|
Line 4398 sub standard_parameter_types {
|
} |
} |
|
|
sub parm_change_log { |
sub parm_change_log { |
my ($r,$parm_permission)=@_; |
my ($r)=@_; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'} |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
text=>"Parameter Change Log"}); |
text=>"Parameter Change Log"}); |
my $js = '<script type="text/javascript">'."\n". |
my $js = '<script type="text/javascript">'."\n". |
Line 4609 sub parm_change_log {
|
Line 4411 sub parm_change_log {
|
'</script>'."\n"; |
'</script>'."\n"; |
$r->print(&Apache::loncommon::start_page('Parameter Change Log',$js)); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log',$js)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
&startSettingsScreen($r,'parmset',$crstype); |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog',$cdom,$cnum); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
|
|
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
|
|
Line 4628 sub parm_change_log {
|
Line 4429 sub parm_change_log {
|
$r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". |
$r->print(&Apache::loncommon::display_filter('parmslog').' '."\n". |
'<input type="submit" value="'.&mt('Display').'" />'. |
'<input type="submit" value="'.&mt('Display').'" />'. |
'</form></fieldset></div><br clear="all" />'); |
'</form></fieldset></div><br clear="all" />'); |
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
undef($readonly); |
|
} |
|
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
|
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'. |
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'. |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th>'); |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'. |
unless ($readonly) { |
&Apache::loncommon::end_data_table_header_row()); |
$r->print('<th>'.&mt('Announce').'</th>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
my $shown=0; |
my $shown=0; |
my $folder=''; |
my $folder=''; |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
Line 4673 sub parm_change_log {
|
Line 4467 sub parm_change_log {
|
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $send_msg_link=''; |
my $send_msg_link=''; |
if ((!$readonly) && |
if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
(($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
|
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
$send_msg_link ='<br />'. |
$send_msg_link ='<br />'. |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
Line 4744 sub parm_change_log {
|
Line 4537 sub parm_change_log {
|
} |
} |
} |
} |
} |
} |
$output .= '</td>'; |
$output .= '</td><td>'; |
|
|
unless ($readonly) { |
if ($stillactive) { |
$output .= '<td>'; |
my $parmitem = &standard_parameter_names($parmname); |
if ($stillactive) { |
$parmitem = &mt($parmitem); |
my $parmitem = &standard_parameter_names($parmname); |
my $title=&mt('Changed [_1]',$parmitem); |
$parmitem = &mt($parmitem); |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
my $title=&mt('Changed [_1]',$parmitem); |
$parmitem,$realmdescription, |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
$parmitem,$realmdescription, |
if (($uname) && ($udom)) { |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
$output .= |
if (($uname) && ($udom)) { |
&Apache::loncommon::messagewrapper('Notify User', |
$output .= |
$uname,$udom,$title, |
&Apache::loncommon::messagewrapper('Notify User', |
$description); |
$uname,$udom,$title, |
} else { |
$description); |
$output .= |
} else { |
&Apache::lonrss::course_blog_link($id,$title, |
$output .= |
$description); |
&Apache::lonrss::course_blog_link($id,$title, |
} |
$description); |
} |
} |
$output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
} |
|
$output .= '</td>'; |
|
} |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
} |
} |
if ($env{'form.displayfilter'} eq 'containing') { |
if ($env{'form.displayfilter'} eq 'containing') { |
my $wholeentry=$about_me_link.':'. |
my $wholeentry=$about_me_link.':'. |
Line 4788 sub parm_change_log {
|
Line 4577 sub parm_change_log {
|
|| $shown<=$env{'form.show'})) { last; } |
|| $shown<=$env{'form.show'})) { last; } |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
|
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 4836 sub update_slots {
|
Line 4626 sub update_slots {
|
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
'',$uname,$udom,$cnum,$cdom); |
'',$uname,$udom,$cnum,$cdom); |
|
|
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
'',$uname,$udom,$uname,$udom); |
'',$uname,$udom,$uname,$udom); |
} |
} |
return $success; |
return $success; |
} |
} |
Line 4870 sub delete_slots {
|
Line 4660 sub delete_slots {
|
context => 'parameter', |
context => 'parameter', |
); |
); |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
&Apache::lonnet::write_log('course','slotreservationslog',\%storehash, |
1,$uname,$udom,$cnum,$cdom); |
1,$uname,$udom,$cnum,$cdom); |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
&Apache::lonnet::write_log('course',$cdom.'_'.$cnum.'_slotlog',\%storehash, |
1,$uname,$udom,$uname,$udom); |
1,$uname,$udom,$uname,$udom); |
} |
} |
} |
} |
} |
} |
Line 4895 sub parameter_release_vars {
|
Line 4685 sub parameter_release_vars {
|
} |
} |
|
|
sub parameter_releasecheck { |
sub parameter_releasecheck { |
my ($name,$value,$needsrelease,$cmajor,$cminor) = @_; |
my ($name,$value,$needsrelease,$chostname,$cmajor,$cminor) = @_; |
my $needsnewer; |
my $needsnewer; |
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
my ($needsmajor,$needsminor) = split(/\./,$needsrelease); |
if (($cmajor < $needsmajor) || |
if (($cmajor < $needsmajor) || |
Line 4919 sub oldversion_warning {
|
Line 4709 sub oldversion_warning {
|
); |
); |
if (exists($stringtypes{$name})) { |
if (exists($stringtypes{$name})) { |
if ($name eq 'examcode') { |
if ($name eq 'examcode') { |
$desc = $value; |
|
} elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { |
} elsif (ref($strings{$stringtypes{$name}}) eq 'ARRAY') { |
foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { |
foreach my $possibilities (@{ $strings{$stringtypes{$name}} }) { |
next unless (ref($possibilities) eq 'ARRAY'); |
next unless (ref($possibilities) eq 'ARRAY'); |
Line 4930 sub oldversion_warning {
|
Line 4720 sub oldversion_warning {
|
} |
} |
} |
} |
} |
} |
} elsif (($name eq 'printstartdate') || ($name eq 'printenddate')) { |
|
my $now = time; |
|
if ($value =~ /^\d+$/) { |
|
if ($name eq 'printstartdate') { |
|
if ($value > $now) { |
|
$desc = &Apache::lonlocal::locallocaltime($value); |
|
} |
|
} elsif ($name eq 'printenddate') { |
|
if ($value < $now) { |
|
$desc = &Apache::lonlocal::locallocaltime($value); |
|
} |
|
} |
|
} |
|
} |
} |
my $standard_name = &standard_parameter_names($name); |
my $standard_name = &standard_parameter_names($name); |
return '<p class="LC_warning">'. |
return '<p class="LC_warning">'. |
Line 4954 sub oldversion_warning {
|
Line 4731 sub oldversion_warning {
|
'</p>'; |
'</p>'; |
} |
} |
|
|
sub get_permission { |
|
my %permission; |
|
my $allowed = 0; |
|
return (\%permission,$allowed) unless ($env{'request.course.id'}); |
|
if ((&Apache::lonnet::allowed('opa',$env{'request.course.id'})) || |
|
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'}))) { |
|
%permission= ( |
|
'edit' => 1, |
|
'set' => 1, |
|
'setoverview' => 1, |
|
'addmetadata' => 1, |
|
'ordermetadata' => 1, |
|
'setrestrictmeta' => 1, |
|
'newoverview' => 1, |
|
'setdefaults' => 1, |
|
'settable' => 1, |
|
'parameterchangelog' => 1, |
|
'cleanparameters' => 1, |
|
'dateshift1' => 1, |
|
'dateshift2' => 1, |
|
'helper' => 1, |
|
); |
|
} elsif ((&Apache::lonnet::allowed('vpa',$env{'request.course.id'})) || |
|
(&Apache::lonnet::allowed('vpa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'}))) { |
|
%permission = ( |
|
'set' => 1, |
|
'settable' => 1, |
|
'newoverview' => 1, |
|
'setoverview' => 1, |
|
'parameterchangelog' => 1, |
|
); |
|
} |
|
foreach my $perm (values(%permission)) { |
|
if ($perm) { $allowed=1; last; } |
|
} |
|
return (\%permission,$allowed); |
|
} |
|
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
|
|
Line 5021 sub handler {
|
Line 4758 sub handler {
|
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
|
|
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
my ($parm_permission,$allowed) = &get_permission(); |
my $parm_permission = |
|
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
|
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'})); |
my $exists = &check_for_course_info(); |
my $exists = &check_for_course_info(); |
|
|
if ($env{'request.course.id'} && $allowed && $exists) { |
if ($env{'request.course.id'} && $parm_permission && $exists) { |
# |
# |
# Main switch on form.action and form.state, as appropriate |
# Main switch on form.action and form.state, as appropriate |
# |
# |
# Check first if coming from someone else headed directly for |
# Check first if coming from someone else headed directly for |
# the table mode |
# the table mode |
if (($parm_permission->{'set'}) && |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
&& (!$env{'form.dis'})) || ($env{'form.symb'}))) { |
&assessparms($r); |
&assessparms($r,$parm_permission); |
|
} elsif (! exists($env{'form.action'})) { |
} elsif (! exists($env{'form.action'})) { |
&print_main_menu($r,$parm_permission); |
&print_main_menu($r,$parm_permission); |
} elsif (!$parm_permission->{$env{'form.action'}}) { |
|
&print_main_menu($r,$parm_permission); |
|
} elsif ($env{'form.action'} eq 'setoverview') { |
} elsif ($env{'form.action'} eq 'setoverview') { |
&overview($r,$parm_permission); |
&overview($r); |
} elsif ($env{'form.action'} eq 'addmetadata') { |
} elsif ($env{'form.action'} eq 'addmetadata') { |
&addmetafield($r); |
&addmetafield($r); |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
&order_meta_fields($r); |
&order_meta_fields($r); |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
&setrestrictmeta($r); |
&setrestrictmeta($r); |
} elsif ($env{'form.action'} eq 'newoverview') { |
} elsif ($env{'form.action'} eq 'newoverview') { |
&newoverview($r,$parm_permission); |
&newoverview($r); |
} elsif ($env{'form.action'} eq 'setdefaults') { |
} elsif ($env{'form.action'} eq 'setdefaults') { |
&defaultsetter($r); |
&defaultsetter($r); |
} elsif ($env{'form.action'} eq 'settable') { |
} elsif ($env{'form.action'} eq 'settable') { |
&assessparms($r,$parm_permission); |
&assessparms($r); |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
&parm_change_log($r,$parm_permission); |
&parm_change_log($r); |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
&clean_parameters($r); |
&clean_parameters($r); |
} elsif ($env{'form.action'} eq 'dateshift1') { |
} elsif ($env{'form.action'} eq 'dateshift1') { |
&date_shift_one($r); |
&date_shift_one($r); |
} elsif ($env{'form.action'} eq 'dateshift2') { |
} elsif ($env{'form.action'} eq 'dateshift2') { |