version 1.292, 2006/04/18 02:13:49
|
version 1.325, 2006/07/17 17:23:24
|
Line 63 use Apache::lonhomework;
|
Line 63 use Apache::lonhomework;
|
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
|
use Apache::longroup; |
|
use Apache::lonrss; |
|
use LONCAPA; |
|
|
# --- Caches local to lonparmset |
# --- Caches local to lonparmset |
|
|
Line 90 Inputs: $what - a parameter spec (inclu
|
Line 93 Inputs: $what - a parameter spec (inclu
|
|
|
Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 14 possible levels |
Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 14 possible levels |
|
|
14 - General Course |
14- General Course |
13 - Map or Folder level in course |
13- Map or Folder level in course |
12- resource default |
12- resource default |
11- map default |
11- map default |
10 - resource level in course |
10- resource level in course |
9 - General for section |
9 - General for section |
8 - Map or Folder level for section |
8 - Map or Folder level for section |
7 - resource level in section |
7 - resource level in section |
Line 117 sub parmval {
|
Line 120 sub parmval {
|
sub parmval_by_symb { |
sub parmval_by_symb { |
my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
my ($what,$symb,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_; |
# load caches |
# load caches |
|
|
&cacheparmhash(); |
&cacheparmhash(); |
|
|
my $useropt=&Apache::lonnet::get_userresdata($uname,$udom); |
my $useropt=&Apache::lonnet::get_userresdata($uname,$udom); |
Line 126 sub parmval_by_symb {
|
Line 128 sub parmval_by_symb {
|
my @outpar=(); |
my @outpar=(); |
# ----------------------------------------------------- Cascading lookup scheme |
# ----------------------------------------------------- Cascading lookup scheme |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
|
$map = &Apache::lonnet::deversion($map); |
|
|
my $symbparm=$symb.'.'.$what; |
my $symbparm=$symb.'.'.$what; |
my $mapparm=$map.'___(all).'.$what; |
my $mapparm=$map.'___(all).'.$what; |
Line 394 sub storeparm_by_symb {
|
Line 397 sub storeparm_by_symb {
|
return ''; |
return ''; |
} |
} |
|
|
{ |
sub log_parmset { |
my $logid; |
return &Apache::lonnet::instructor_log('parameterlog',@_); |
sub log_parmset { |
|
my ($storehash,$delflag,$uname,$udom)=@_; |
|
my $logentry=join(',',map { |
|
&Apache::lonnet::escape($_).'=>'.&Apache::lonnet::escape($$storehash{$_}); |
|
} keys %$storehash); |
|
$logid++; |
|
my $id=time().'00000'.$$.'00000'.$logid; |
|
&Apache::lonnet::put('nohist_parameterlog', |
|
{ |
|
$id.'_exe_uname' => $env{'user.name'}, |
|
$id.'_exe_udom' => $env{'user.domain'}, |
|
$id.'_exe_time' => time(), |
|
$id.'_exe_ip' => $ENV{'REMOTE_ADDR'}, |
|
$id.'_delflag' => $delflag, |
|
$id.'_logentry' => $logentry, |
|
$id.'_uname' => $uname, |
|
$id.'_udom' => $udom, |
|
}, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'} |
|
); |
|
} |
|
} |
} |
|
|
sub storeparm_by_symb_inner { |
sub storeparm_by_symb_inner { |
Line 426 sub storeparm_by_symb_inner {
|
Line 407 sub storeparm_by_symb_inner {
|
# ---------------------------------------------------------- Construct prefixes |
# ---------------------------------------------------------- Construct prefixes |
$spnam=~s/\_([^\_]+)$/\.$1/; |
$spnam=~s/\_([^\_]+)$/\.$1/; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
|
$map = &Apache::lonnet::deversion($map); |
|
|
my $symbparm=$symb.'.'.$spnam; |
my $symbparm=$symb.'.'.$spnam; |
my $mapparm=$map.'___(all).'.$spnam; |
my $mapparm=$map.'___(all).'.$spnam; |
|
|
Line 511 sub storeparm_by_symb_inner {
|
Line 494 sub storeparm_by_symb_inner {
|
} |
} |
|
|
if ($reply=~/^error\:(.*)/) { |
if ($reply=~/^error\:(.*)/) { |
return "<font color=red>Write Error: $1</font>"; |
return "<span class=\"LC_error\">Write Error: $1</span>"; |
} |
} |
return ''; |
return ''; |
} |
} |
Line 525 sub storeparm_by_symb_inner {
|
Line 508 sub storeparm_by_symb_inner {
|
|
|
Format a value for output. |
Format a value for output. |
|
|
Inputs: $value, $type |
Inputs: $value, $type, $editable |
|
|
Returns: $value, formatted for output. If $type indicates it is a date, |
Returns: $value, formatted for output. If $type indicates it is a date, |
localtime($value) is returned. |
localtime($value) is returned. |
|
$editable will return an icon to click on |
|
|
=cut |
=cut |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
sub valout { |
sub valout { |
my ($value,$type)=@_; |
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') { |
$result = ' '; |
if ($editable) { |
|
$result = '<span class="LC_clickhere">*</span>'; |
|
} else { |
|
$result=' '; |
|
} |
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
Line 607 sub plink {
|
Line 595 sub plink {
|
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$marker.'" /></td></tr><tr><td align="center">'. |
return '<table width="100%"><tr valign="top" align="right"><td><a name="'.$marker.'" /></td></tr><tr><td align="center">'. |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
&valout($value,$type).'</a></td></tr></table>'; |
&valout($value,$type,1).'</a></td></tr></table>'; |
} |
} |
|
|
sub page_js { |
sub page_js { |
Line 672 sub startpage {
|
Line 660 sub startpage {
|
&page_js(), |
&page_js(), |
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::breadcrumbs(undef, |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
'Table Mode Parameter Setting'); |
|
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
Line 720 sub print_row {
|
Line 707 sub print_row {
|
} |
} |
my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); |
my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); |
if ($automatic) { |
if ($automatic) { |
$parm.='<font color="red"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</font>'; |
$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>'; |
} |
} |
$r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>'); |
$r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>'); |
|
|
Line 1075 sub parmmenu {
|
Line 1062 sub parmmenu {
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
$r->print(); |
$r->print(); |
$r->print("\n<table><tr>"); |
$r->print("\n<table id=\"LC_parm_overview_parm_menu\"><tr>"); |
my $cnt=0; |
my $cnt=0; |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
foreach $tempkey (&keysindisplayorder($allparms,$keyorder)) { |
$r->print("\n<td><font size='-1'><label><input type='checkbox' name='pscat' "); |
$r->print("\n<td><label><input type='checkbox' name='pscat' "); |
$r->print('value="'.$tempkey.'"'); |
$r->print('value="'.$tempkey.'"'); |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
if ($$pscat[0] eq "all" || grep $_ eq $tempkey, @{$pscat}) { |
$r->print(' checked'); |
$r->print(' checked'); |
} |
} |
$r->print('>'.$$allparms{$tempkey}.'</label></font></td>'); |
$r->print('>'.$$allparms{$tempkey}.'</label></td>'); |
$cnt++; |
$cnt++; |
if ($cnt==3) { |
if ($cnt==3) { |
$r->print("</tr>\n<tr>"); |
$r->print("</tr>\n<tr>"); |
Line 1091 ENDSCRIPT
|
Line 1078 ENDSCRIPT
|
} |
} |
} |
} |
$r->print(' |
$r->print(' |
</tr><tr><td> |
</tr><tr id=\"LC_parm_overview_parm_menu_selectors\"><td> |
<a href="javascript:checkall(true, \'pscat\')">Select All</a><br /> |
<a href="javascript:checkall(true, \'pscat\')">Select All</a><br /> |
<a href="javascript:checkstandard()">Select Common Only</a> |
<a href="javascript:checkstandard()">Select Common Only</a> |
</td><td> |
</td><td> |
Line 1141 sub usermenu {
|
Line 1128 sub usermenu {
|
'oi' => "or ID", |
'oi' => "or ID", |
'ad' => "at Domain" |
'ad' => "at Domain" |
); |
); |
my %sectionhash=(); |
|
my $sections=''; |
my $sections=''; |
my $numsec = &Apache::loncommon::get_sections( |
my %sectionhash = &Apache::loncommon::get_sections(); |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
|
\%sectionhash); |
|
my $groups; |
my $groups; |
my %grouphash; |
my %grouphash = &Apache::longroup::coursegroups(); |
my $numgrp = &Apache::loncommon::coursegroups( |
|
\%grouphash, |
if (%sectionhash) { |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
if ($numsec > 0) { |
|
$sections=$lt{'se'}.': <select name="csec"'; |
$sections=$lt{'se'}.': <select name="csec"'; |
if ($numsec && $numgrp && $parmlev ne 'full') { |
if (%grouphash && $parmlev ne 'full') { |
$sections .= qq| onchange="group_or_section('csec')" |; |
$sections .= qq| onchange="group_or_section('csec')" |; |
} |
} |
$sections .= '>'; |
$sections .= '>'; |
Line 1166 sub usermenu {
|
Line 1147 sub usermenu {
|
} |
} |
$sections.='</select>'; |
$sections.='</select>'; |
} |
} |
if ($numsec && $numgrp && $parmlev ne 'full') { |
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
$sections .= ' or '; |
$sections .= ' or '; |
$sections .= qq| |
$sections .= qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 1192 function group_or_section(caller) {
|
Line 1173 function group_or_section(caller) {
|
</script> |
</script> |
|; |
|; |
} |
} |
if ($numgrp > 0) { |
|
|
if (%grouphash) { |
$groups=$lt{'gr'}.': <select name="cgroup"'; |
$groups=$lt{'gr'}.': <select name="cgroup"'; |
if ($numsec && $numgrp && $env{'form.action'} eq 'settable') { |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
} |
} |
$groups .= '>'; |
$groups .= '>'; |
Line 1271 sub levelmenu {
|
Line 1253 sub levelmenu {
|
|
|
sub sectionmenu { |
sub sectionmenu { |
my ($r,$selectedsections)=@_; |
my ($r,$selectedsections)=@_; |
my %sectionhash=(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
my $sections=''; |
return if (!%sectionhash); |
my $numsec = &Apache::loncommon::get_sections( |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$r->print('<select name="Section" multiple="true" size="8" >'); |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
foreach my $s ('all',sort keys %sectionhash) { |
\%sectionhash); |
$r->print(' <option value="'.$s.'"'); |
if ($numsec) { |
foreach (@{$selectedsections}) { |
$r->print('<select name="Section" multiple="true" size="8" >'); |
if ($s eq $_) { |
foreach my $s ('all',sort keys %sectionhash) { |
$r->print(' selected'); |
$r->print(' <option value="'.$s.'"'); |
last; |
foreach (@{$selectedsections}) { |
|
if ($s eq $_) { |
|
$r->print(' selected'); |
|
last; |
|
} |
|
} |
} |
$r->print('>'.$s."</option>\n"); |
|
} |
} |
$r->print("</select>\n"); |
$r->print('>'.$s."</option>\n"); |
} |
} |
|
$r->print("</select>\n"); |
} |
} |
|
|
sub groupmenu { |
sub groupmenu { |
my ($r,$selectedgroups)=@_; |
my ($r,$selectedgroups)=@_; |
my %grouphash; |
my %grouphash = &Apache::longroup::coursegroups(); |
my $numgrp = &Apache::loncommon::coursegroups( |
return if (!%grouphash); |
\%grouphash, |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$r->print('<select name="Group" multiple="true" size="8" >'); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
foreach my $group (sort(keys(%grouphash))) { |
if ($numgrp) { |
$r->print(' <option value="'.$group.'"'); |
$r->print('<select name="Group" multiple="true" size="8" >'); |
foreach (@{$selectedgroups}) { |
foreach my $group (sort(keys(%grouphash))) { |
if ($group eq $_) { |
$r->print(' <option value="'.$group.'"'); |
$r->print(' selected'); |
foreach (@{$selectedgroups}) { |
last; |
if ($group eq $_) { |
} |
$r->print(' selected'); |
} |
last; |
$r->print('>'.$group."</option>\n"); |
} |
|
} |
|
$r->print('>'.$group."</option>\n"); |
|
} |
|
$r->print("</select>\n"); |
|
} |
} |
|
$r->print("</select>\n"); |
} |
} |
|
|
|
|
Line 1438 sub assessparms {
|
Line 1411 sub assessparms {
|
my $uhome; |
my $uhome; |
my $csec; |
my $csec; |
my $cgroup; |
my $cgroup; |
my $grouplist; |
|
my @usersgroups = (); |
my @usersgroups = (); |
|
|
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
Line 1510 sub assessparms {
|
Line 1482 sub assessparms {
|
$id=''; |
$id=''; |
} else { |
} else { |
$message= |
$message= |
"<font color=red>".&mt("Unknown ID")." '$id' ". |
'<span class="LC_error">'.&mt("Unknown ID")." '$id' ". |
&mt('at domain')." '$udom'</font>"; |
&mt('at domain')." '$udom'</span>"; |
} |
} |
} else { |
} else { |
$uname=$env{'form.uname'}; |
$uname=$env{'form.uname'}; |
Line 1522 sub assessparms {
|
Line 1494 sub assessparms {
|
$uhome=&Apache::lonnet::homeserver($uname,$udom); |
$uhome=&Apache::lonnet::homeserver($uname,$udom); |
if ($uhome eq 'no_host') { |
if ($uhome eq 'no_host') { |
$message= |
$message= |
"<font color=red>".&mt("Unknown user")." '$uname' ". |
'<span class="LC_error">'.&mt("Unknown user")." '$uname' ". |
&mt("at domain")." '$udom'</font>"; |
&mt("at domain")." '$udom'</span>"; |
$uname=''; |
$uname=''; |
} else { |
} else { |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
|
|
if ($csec eq '-1') { |
if ($csec eq '-1') { |
$message="<font color=red>". |
$message='<span class="LC_error">'. |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
&mt("not in this course")."</font>"; |
&mt("not in this course")."</span>"; |
$uname=''; |
$uname=''; |
$csec=$env{'form.csec'}; |
$csec=$env{'form.csec'}; |
$cgroup=$env{'form.cgroup'}; |
$cgroup=$env{'form.cgroup'}; |
Line 1544 sub assessparms {
|
Line 1516 sub assessparms {
|
.$name{'lastname'}.' '.$name{'generation'}. |
.$name{'lastname'}.' '.$name{'generation'}. |
"<br>\n".&mt('ID').": ".$name{'id'}.'<p>'; |
"<br>\n".&mt('ID').": ".$name{'id'}.'<p>'; |
} |
} |
$grouplist = &Apache::lonnet::get_users_groups( |
@usersgroups = &Apache::lonnet::get_users_groups( |
$udom,$uname,$env{'request.course.id'}); |
$udom,$uname,$env{'request.course.id'}); |
if ($grouplist) { |
if (@usersgroups > 0) { |
@usersgroups = &Apache::lonnet::sort_course_groups($grouplist, |
unless (grep(/^\Q$cgroup\E$/,@usersgroups)) { |
$env{'request.course.id'}); |
|
unless (grep/^\Q$cgroup\E$/,@usersgroups) { |
|
$cgroup = $usersgroups[0]; |
$cgroup = $usersgroups[0]; |
} |
} |
} else { |
|
$cgroup = ''; |
|
} |
} |
} |
} |
} |
} |
Line 1609 sub assessparms {
|
Line 1577 sub assessparms {
|
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
&displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); |
} else { |
} else { |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb); |
my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb); |
$r->print(&mt('Specific Resource').": ".$resource. |
my $title = &Apache::lonnet::gettitle($pssymb); |
'<input type="hidden" value="'.$pssymb.'" name="symb">'. |
$r->print(&mt('Specific Resource: [_1] ([_2])',$title,$resource). |
|
'<input type="hidden" value="'.$pssymb.'" name="symb" />'. |
'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />'); |
($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />'); |
} |
} |
Line 1770 ENDTABLEHEADFOUR
|
Line 1739 ENDTABLEHEADFOUR
|
'</font></tt><p><b>'. |
'</font></tt><p><b>'. |
"<a href=\"javascript:openWindow('". |
"<a href=\"javascript:openWindow('". |
&Apache::lonnet::clutter($uri).'?symb='. |
&Apache::lonnet::clutter($uri).'?symb='. |
&Apache::lonnet::escape($symbp{$rid}). |
&escape($symbp{$rid}). |
"', 'metadatafile', '450', '500', 'no', 'yes')\";". |
"', 'metadatafile', '450', '500', 'no', 'yes')\";". |
" TARGET=_self>$title"); |
" TARGET=_self>$title"); |
|
|
Line 1969 ENDMAPONE
|
Line 1938 ENDMAPONE
|
} |
} |
|
|
if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")}; |
if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")}; |
if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$csec</i></font>\n")}; |
if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$cgroup</i></font>\n")}; |
$r->print("</h4>\n"); |
$r->print("</h4>\n"); |
#---------------------------------------------------------------- print table |
#---------------------------------------------------------------- print table |
$r->print('<p><table border="2">'); |
$r->print('<p><table border="2">'); |
Line 2012 sub crsenv {
|
Line 1981 sub crsenv {
|
my $r=shift; |
my $r=shift; |
my $setoutput=''; |
my $setoutput=''; |
|
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef, |
my $breadcrumbs = |
'Edit Course Environment'); |
&Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment'); |
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'}; |
|
|
Line 2114 sub crsenv {
|
Line 2083 sub crsenv {
|
} |
} |
} |
} |
} |
} |
|
|
|
my $start_table =&Apache::loncommon::start_data_table(); |
|
my $start_header_row=&Apache::loncommon::start_data_table_header_row(); |
|
my $end_header_row =&Apache::loncommon::end_data_table_header_row(); |
# ------------------------- Re-init course environment entries for this session |
# ------------------------- Re-init course environment entries for this session |
|
|
&Apache::lonnet::coursedescription($env{'request.course.id'}); |
&Apache::lonnet::coursedescription($env{'request.course.id'}, |
|
{'freshen_cache' => 1}); |
|
|
# -------------------------------------------------------- Get parameters again |
# -------------------------------------------------------- Get parameters again |
|
|
Line 2129 sub crsenv {
|
Line 2103 sub crsenv {
|
('url' => '<b>'.&mt('Top Level Map').'</b> '. |
('url' => '<b>'.&mt('Top Level Map').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','url','sequence')\">". |
"('envform','url','sequence')\">". |
&mt('Select Map').'</a><br /><font color=red> '. |
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
&mt('Modification may make assessment data inaccessible'). |
&mt('Modification may make assessment data inaccessible'). |
'</font>', |
'</span>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'courseid' => '<b>'.&mt('Course ID or number'). |
'courseid' => '<b>'.&mt('Course ID or number'). |
'</b><br />'. |
'</b><br />'. |
Line 2202 sub crsenv {
|
Line 2176 sub crsenv {
|
'('.&mt('or set value to "[_1]" to allow all roles',"<tt>yes</tt>").')', |
'('.&mt('or set value to "[_1]" to allow all roles',"<tt>yes</tt>").')', |
'rndseed' |
'rndseed' |
=> '<b>'.&mt('Randomization algorithm used').'</b> <br />'. |
=> '<b>'.&mt('Randomization algorithm used').'</b> <br />'. |
'<font color="red">'.&mt('Modifying this will make problems').' '. |
'<span class="LC_error">'.&mt('Modifying this will make problems').' '. |
&mt('have different numbers and answers').'</font>', |
&mt('have different numbers and answers').'</span>', |
'receiptalg' |
'receiptalg' |
=> '<b>'.&mt('Receipt algorithm used').'</b> <br />'. |
=> '<b>'.&mt('Receipt algorithm used').'</b> <br />'. |
&mt('This controls how receipt numbers are generated.'), |
&mt('This controls how receipt numbers are generated.'), |
Line 2218 sub crsenv {
|
Line 2192 sub crsenv {
|
' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. |
' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. |
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
|
'print_header_format' |
|
=> '<b>Print header format; substitutions: %n student name %c course id %a assignment', |
'anonymous_quiz' |
'anonymous_quiz' |
=> '<b>'.&mt('Anonymous quiz/exam').'</b><br />'. |
=> '<b>'.&mt('Anonymous quiz/exam').'</b><br />'. |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
Line 2229 sub crsenv {
|
Line 2205 sub crsenv {
|
'disable_receipt_display' |
'disable_receipt_display' |
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
|
'task_messages' |
|
=> '<b>'.&mt('Send message to student when clicking Done on Tasks. [_1] to send a message only to student, [_2] to send message to student and add record to user information page for instructors. Leave blank to disable.','<tt>only_student</tt>','<tt>student_and_user_notes_screen</tt>').'</b>', |
'disablesigfigs' |
'disablesigfigs' |
=> '<b>'.&mt('Disable checking of Significant Figures').'</b><br />'. |
=> '<b>'.&mt('Disable checking of Significant Figures').'</b><br />'. |
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
Line 2256 sub crsenv {
|
Line 2234 sub crsenv {
|
'problem_stream_switch', |
'problem_stream_switch', |
'suppress_tries', |
'suppress_tries', |
'default_paper_size', |
'default_paper_size', |
|
'print_header_format', |
'disable_receipt_display', |
'disable_receipt_display', |
'spreadsheet_default_classcalc', |
'spreadsheet_default_classcalc', |
'spreadsheet_default_studentcalc', |
'spreadsheet_default_studentcalc', |
Line 2265 sub crsenv {
|
Line 2244 sub crsenv {
|
'default_enrollment_end_date', |
'default_enrollment_end_date', |
'tthoptions', |
'tthoptions', |
'disablesigfigs', |
'disablesigfigs', |
'disableexampointprint' |
'disableexampointprint', |
|
'task_messages' |
); |
); |
foreach my $parameter (sort(keys(%values))) { |
foreach my $parameter (sort(keys(%values))) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
Line 2275 sub crsenv {
|
Line 2255 sub crsenv {
|
} |
} |
} |
} |
} |
} |
|
|
foreach my $parameter (@Display_Order) { |
foreach my $parameter (@Display_Order) { |
my $description = $descriptions{$parameter}; |
my $description = $descriptions{$parameter}; |
# onchange is javascript to automatically check the 'Set' button. |
# onchange is javascript to automatically check the 'Set' button. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
"['envform'].elements['".$parameter."_setparmval']". |
"['envform'].elements['".$parameter."_setparmval']". |
'.checked=true;"'; |
'.checked=true;"'; |
$output .= '<tr><td>'.$description.'</td>'; |
$output .= &Apache::loncommon::start_data_table_row(). |
|
'<td>'.$description.'</td>'; |
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::date_setter('envform', |
&Apache::lonhtmlcommon::date_setter('envform', |
Line 2298 sub crsenv {
|
Line 2280 sub crsenv {
|
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
'</td>'; |
'</td>'; |
$output .= "</tr>\n"; |
$output .= &Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
my $onchange = 'onFocus="javascript:window.document.forms'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
'[\'envform\'].elements[\'newp_setparmval\']'. |
'[\'envform\'].elements[\'newp_setparmval\']'. |
'.checked=true;"'; |
'.checked=true;"'; |
$output.='<tr><td><i>'.&mt('Create New Environment Variable').'</i><br />'. |
$output.=&Apache::loncommon::start_data_table_row(). |
|
'<td><i>'.&mt('Create New Environment Variable').'</i><br />'. |
'<input type="text" size=40 name="newp_name" '. |
'<input type="text" size=40 name="newp_name" '. |
$onchange.' /></td><td>'. |
$onchange.' /></td><td>'. |
'<input type="text" size=40 name="newp_value" '. |
'<input type="text" size=40 name="newp_value" '. |
$onchange.' /></td><td>'. |
$onchange.' /></td><td>'. |
'<input type="checkbox" name="newp_setparmval" /></td></tr>'; |
'<input type="checkbox" name="newp_setparmval" /></td>'. |
|
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'par' => 'Parameter', |
'par' => 'Parameter', |
Line 2326 sub crsenv {
|
Line 2310 sub crsenv {
|
'</script>'; |
'</script>'; |
|
|
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set Course Environment Parameters', |
&Apache::loncommon::start_page('Set Course Environment', |
$browse_js); |
$browse_js); |
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
|
my $end_table=&Apache::loncommon::end_data_table(); |
$r->print(<<ENDENV); |
$r->print(<<ENDENV); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
$setoutput |
$setoutput |
<p> |
$start_table |
<table border=2> |
$start_header_row |
<tr><th>$lt{'par'}</th><th>$lt{'val'}</th><th>$lt{'set'}?</th></tr> |
<th>$lt{'par'}</th><th>$lt{'val'}</th><th>$lt{'set'}?</th> |
|
$end_header_row |
$output |
$output |
</table> |
$end_table |
<input type="submit" name="crsenv" value="$lt{'sce'}"> |
<input type="submit" name="crsenv" value="$lt{'sce'}"> |
</form> |
</form> |
$end_page |
$end_page |
Line 2355 sub tablestart {
|
Line 2341 sub tablestart {
|
return ''; |
return ''; |
} else { |
} else { |
$tableopen=1; |
$tableopen=1; |
return '<table border="2"><tr><th>'.&mt('Parameter').'</th><th>'. |
return &Apache::loncommon::start_data_table().'<tr><th>'.&mt('Parameter').'</th><th>'. |
&mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>'; |
&mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>'; |
} |
} |
} |
} |
Line 2363 sub tablestart {
|
Line 2349 sub tablestart {
|
sub tableend { |
sub tableend { |
if ($tableopen) { |
if ($tableopen) { |
$tableopen=0; |
$tableopen=0; |
return '</table>'; |
return &Apache::loncommon::end_data_table(); |
} else { |
} else { |
return''; |
return''; |
} |
} |
Line 2426 sub storedata {
|
Line 2412 sub storedata {
|
$r->print('<br />'.&mt('Stored modified parameter for').' '. |
$r->print('<br />'.&mt('Stored modified parameter for').' '. |
&Apache::loncommon::plainname($tuname,$tudom)); |
&Apache::loncommon::plainname($tuname,$tudom)); |
} else { |
} else { |
$r->print('<h2><font color="red">'. |
$r->print('<div class="LC_error">'. |
&mt('Error storing parameters').'</font></h2>'); |
&mt('Error storing parameters').'</div>'); |
} |
} |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
} else { |
} else { |
Line 2441 sub storedata {
|
Line 2427 sub storedata {
|
&log_parmset({$tkey=>''},1,$tuname,$tudom); |
&log_parmset({$tkey=>''},1,$tuname,$tudom); |
$r->print('<br />'.&mt('Deleted parameter for').' '.&Apache::loncommon::plainname($tuname,$tudom)); |
$r->print('<br />'.&mt('Deleted parameter for').' '.&Apache::loncommon::plainname($tuname,$tudom)); |
} else { |
} else { |
$r->print('<h2><font color="red">'. |
$r->print('<div class="LC_error">'. |
&mt('Error deleting parameters').'</font></h2>'); |
&mt('Error deleting parameters').'</div>'); |
} |
} |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
} else { |
} else { |
Line 2459 sub storedata {
|
Line 2445 sub storedata {
|
&log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom); |
&log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom); |
$r->print('<br />'.&mt('Stored modified date for').' '.&Apache::loncommon::plainname($tuname,$tudom)); |
$r->print('<br />'.&mt('Stored modified date for').' '.&Apache::loncommon::plainname($tuname,$tudom)); |
} else { |
} else { |
$r->print('<h2><font color="red">'. |
$r->print('<div class="LC_error">'. |
&mt('Error storing parameters').'</font></h2>'); |
&mt('Error storing parameters').'</div>'); |
} |
} |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
} else { |
} else { |
Line 2481 sub storedata {
|
Line 2467 sub storedata {
|
&log_parmset(\%loghash,1); |
&log_parmset(\%loghash,1); |
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries)); |
$r->print('<h2>'.&mt('Deleted [_1] parameter(s)</h2>',$delentries)); |
} else { |
} else { |
$r->print('<h2><font color="red">'. |
$r->print('<div class="LC_error">'. |
&mt('Error deleting parameters').'</font></h2>'); |
&mt('Error deleting parameters').'</div>'); |
} |
} |
&Apache::lonnet::devalidatecourseresdata($crs,$dom); |
&Apache::lonnet::devalidatecourseresdata($crs,$dom); |
} |
} |
Line 2491 sub storedata {
|
Line 2477 sub storedata {
|
&log_parmset(\%newdata,0); |
&log_parmset(\%newdata,0); |
$r->print('<h3>'.&mt('Stored [_1] parameter(s)',$putentries/2).'</h3>'); |
$r->print('<h3>'.&mt('Stored [_1] parameter(s)',$putentries/2).'</h3>'); |
} else { |
} else { |
$r->print('<h2><font color="red">'. |
$r->print('<div class="LC_error">'. |
&mt('Error storing parameters').'</font></h2>'); |
&mt('Error storing parameters').'</div>'); |
} |
} |
&Apache::lonnet::devalidatecourseresdata($crs,$dom); |
&Apache::lonnet::devalidatecourseresdata($crs,$dom); |
} |
} |
Line 2567 sub listdata {
|
Line 2553 sub listdata {
|
} |
} |
$middle=~s/\.+$//; |
$middle=~s/\.+$//; |
$middle=~s/^\.+//; |
$middle=~s/^\.+//; |
my $realm='<font color="red">'.&mt('All Resources').'</font>'; |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
$realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><span class="LC_parm_folder">('.$1.')</span></span>'; |
} elsif ($middle) { |
} elsif ($middle) { |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
$realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>'; |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
} |
} |
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
if ($realm ne $oldrealm) { |
if ($realm ne $oldrealm) { |
Line 2599 sub listdata {
|
Line 2585 sub listdata {
|
} |
} |
if ($part ne $oldpart) { |
if ($part ne $oldpart) { |
$r->print(&tableend(). |
$r->print(&tableend(). |
"\n<font color='blue'>".&mt('Part').": $part</font>"); |
"\n<span class=\"LC_parm_part\">".&mt('Part').": $part</span>"); |
$oldpart=$part; |
$oldpart=$part; |
} |
} |
# |
# |
# Preset defaults? |
|
# |
|
my ($hour,$min,$sec,$val)=('','','',''); |
|
unless ($$resourcedata{$thiskey}) { |
|
my ($parmname)=($thiskey=~/\.(\w+)$/); |
|
($hour,$min,$sec,$val)=&preset_defaults($parmname); |
|
} |
|
|
|
# |
|
# Ready to print |
# Ready to print |
# |
# |
$r->print(&tablestart().'<tr><td><b>'.$name. |
$r->print(&tablestart(). |
':</b></td><td><input type="checkbox" name="del_'. |
&Apache::loncommon::start_data_table_row(). |
|
'<td><b>'.&standard_parameter_names($name). |
|
'</b></td><td><input type="checkbox" name="del_'. |
$thiskey.'" /></td><td>'); |
$thiskey.'" /></td><td>'); |
$foundkeys++; |
$foundkeys++; |
if (&isdateparm($thistype)) { |
if (&isdateparm($thistype)) { |
Line 2625 sub listdata {
|
Line 2604 sub listdata {
|
&Apache::lonhtmlcommon::date_setter('parmform', |
&Apache::lonhtmlcommon::date_setter('parmform', |
$jskey, |
$jskey, |
$$resourcedata{$thiskey}, |
$$resourcedata{$thiskey}, |
'',1,'','',$hour,$min,$sec). |
'',1,'',''). |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
&date_sanity_info($$resourcedata{$thiskey}) |
&date_sanity_info($$resourcedata{$thiskey}) |
); |
); |
Line 2633 sub listdata {
|
Line 2612 sub listdata {
|
my $showval; |
my $showval; |
if (defined($$resourcedata{$thiskey})) { |
if (defined($$resourcedata{$thiskey})) { |
$showval=$$resourcedata{$thiskey}; |
$showval=$$resourcedata{$thiskey}; |
} else { |
|
$showval=$val; |
|
} |
} |
$r->print('<label><input type="radio" name="set_'.$thiskey. |
$r->print('<label><input type="radio" name="set_'.$thiskey. |
'" value="yes"'); |
'" value="yes"'); |
Line 2652 sub listdata {
|
Line 2629 sub listdata {
|
my $showval; |
my $showval; |
if (defined($$resourcedata{$thiskey})) { |
if (defined($$resourcedata{$thiskey})) { |
$showval=$$resourcedata{$thiskey}; |
$showval=$$resourcedata{$thiskey}; |
} else { |
|
$showval=$val; |
|
} |
} |
$r->print('<input type="text" name="set_'.$thiskey.'" value="'. |
$r->print('<input type="text" name="set_'.$thiskey.'" value="'. |
$showval.'">'); |
$showval.'">'); |
} |
} |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$thistype.'">'); |
$thistype.'">'); |
$r->print('</td></tr>'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
return $foundkeys; |
return $foundkeys; |
Line 2672 sub newoverview {
|
Line 2647 sub newoverview {
|
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 $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
Line 2730 ENDOVER
|
Line 2705 ENDOVER
|
|
|
# Menu to select levels, etc |
# Menu to select levels, etc |
|
|
$r->print('<table border="1"><tr><td>'); |
$r->print('<table id="LC_parm_overview_scope"> |
|
<tr><td class="LC_parm_overview_level_menu">'); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print('<td>'); |
$r->print('<td class="LC_parm_overview_map_menu">'); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
|
|
$r->print('<table border="1"><tr><td>'); |
$r->print('<table id="LC_parm_overview_controls"> |
|
<tr><td class="LC_parm_overview_parm_selectors">'); |
&parmmenu($r,\%allparms,\@pscat,\%keyorder); |
&parmmenu($r,\%allparms,\@pscat,\%keyorder); |
$r->print('</td><td><table border="0" cellspacing="0" cellpadding="0">'. |
$r->print('</td><td class="LC_parm_overview_restrictions"> |
'<tr><td>'.&mt('Parts').'</td><td></td><td>'.&mt('Section(s)'). |
<table class="LC_parm_overview_restrictions">'. |
'</td><td></td><td>'.&mt('Group(s)').'</td></tr><tr><td>'); |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
|
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
$r->print('</td><td> </td><td>'); |
$r->print('</td><td>'); |
§ionmenu($r,\@selected_sections); |
§ionmenu($r,\@selected_sections); |
$r->print('</td><td> </td><td>'); |
$r->print('</td><td>'); |
&groupmenu($r,\@selected_groups); |
&groupmenu($r,\@selected_groups); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
Line 2826 sub overview {
|
Line 2804 sub overview {
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
Line 3017 ENDMAINFORMHEAD
|
Line 2995 ENDMAINFORMHEAD
|
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
|
|
my @menu = |
my @menu = |
( |
( { divider=>'Settings for Your Course', |
{ text => 'Set Course Environment Parameters', |
}, |
|
{ text => 'Set Course Environment', |
action => 'crsenv', |
action => 'crsenv', |
permission => $parm_permission, |
permission => $parm_permission, |
|
help => 'Course_Environment', |
}, |
}, |
{ text => 'Set Portfolio Metadata', |
{ text => 'Set Portfolio Metadata', |
action => 'setrestrictmeta', |
action => 'setrestrictmeta', |
Line 3030 ENDMAINFORMHEAD
|
Line 3010 ENDMAINFORMHEAD
|
url => '/adm/slotrequest?command=showslots', |
url => '/adm/slotrequest?command=showslots', |
permission => $vgr, |
permission => $vgr, |
}, |
}, |
{ divider => 1, |
{ text => 'Set Parameter Setting Default Actions', |
|
action => 'setdefaults', |
|
permission => $parm_permission, |
|
}, |
|
{ divider => 'New and Existing Parameter Settings for Your Resources', |
}, |
}, |
{ text => 'Set/Modify Resource Parameters - Helper Mode', |
{ text => 'Set/Modify Resource Parameters - Helper Mode', |
url => '/adm/helper/parameter.helper', |
url => '/adm/helper/parameter.helper', |
permission => $parm_permission, |
permission => $parm_permission, |
|
help => 'Parameter_Helper', |
}, |
}, |
{ text => 'Modify Resource Parameters - Overview Mode', |
{ text => 'Set/Modify Resource Parameters - Overview Mode', |
action => 'setoverview', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Set Resource Parameters - Overview Mode', |
|
action => 'newoverview', |
action => 'newoverview', |
permission => $parm_permission, |
permission => $parm_permission, |
|
help => 'Parameter_Overview', |
}, |
}, |
{ text => 'Set/Modify Resource Parameters - Table Mode', |
{ text => 'Set/Modify Resource Parameters - Table Mode', |
action => 'settable', |
action => 'settable', |
permission => $parm_permission, |
permission => $parm_permission, |
help => 'Cascading_Parameters', |
help => 'Table_Mode', |
}, |
}, |
{ text => 'Set Parameter Setting Default Actions', |
{ divider => 'Existing Parameter Settings for Your Resources', |
action => 'setdefaults', |
}, |
|
{ text => 'Modify Resource Parameters - Overview Mode', |
|
action => 'setoverview', |
permission => $parm_permission, |
permission => $parm_permission, |
}, |
help => 'Parameter_Overview', |
|
}, |
{ text => 'Parameter Change Log and Course Blog Posting/User Notification', |
{ text => 'Parameter Change Log and Course Blog Posting/User Notification', |
action => 'parameterchangelog', |
action => 'parameterchangelog', |
permission => $parm_permission, |
permission => $parm_permission, |
Line 3061 ENDMAINFORMHEAD
|
Line 3046 ENDMAINFORMHEAD
|
my $menu_html = ''; |
my $menu_html = ''; |
foreach my $menu_item (@menu) { |
foreach my $menu_item (@menu) { |
if ($menu_item->{'divider'}) { |
if ($menu_item->{'divider'}) { |
$menu_html .= '<hr />'; |
$menu_html .= '<h3>'.&mt($menu_item->{'divider'}).'</h3>'; |
next; |
next; |
} |
} |
next if (! $menu_item->{'permission'}); |
next if (! $menu_item->{'permission'}); |
$menu_html.='<p>'; |
$menu_html.='<p>'; |
$menu_html.='<font size="+1">'; |
$menu_html.='<span class="LC_parm_menu_item">'; |
if (exists($menu_item->{'url'})) { |
if (exists($menu_item->{'url'})) { |
$menu_html.=qq{<a href="$menu_item->{'url'}">}; |
$menu_html.=qq{<a href="$menu_item->{'url'}">}; |
} else { |
} else { |
$menu_html.= |
$menu_html.= |
qq{<a href="/adm/parmset?action=$menu_item->{'action'}">}; |
qq{<a href="/adm/parmset?action=$menu_item->{'action'}">}; |
} |
} |
$menu_html.= &mt($menu_item->{'text'}).'</a></font>'; |
$menu_html.= &mt($menu_item->{'text'}).'</a></span>'; |
if (exists($menu_item->{'help'})) { |
if (exists($menu_item->{'help'})) { |
$menu_html.= |
$menu_html.= |
&Apache::loncommon::help_open_topic($menu_item->{'help'}); |
&Apache::loncommon::help_open_topic($menu_item->{'help'}); |
Line 3116 sub setrestrictmeta {
|
Line 3101 sub setrestrictmeta {
|
my $put_result; |
my $put_result; |
|
|
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata')); |
'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 $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'}; |
Line 3148 sub setrestrictmeta {
|
Line 3132 sub setrestrictmeta {
|
} |
} |
} |
} |
} |
} |
&Apache::lonnet::coursedescription($env{'request.course.id'}); |
&Apache::lonnet::coursedescription($env{'request.course.id'}, |
|
{'freshen_cache' => 1}); |
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
foreach my $field (sort(keys(%metadata_fields))) { |
foreach my $field (sort(keys(%metadata_fields))) { |
&Apache::lonnet::logthis ($field); |
&Apache::lonnet::logthis ($field); |
Line 3173 sub defaultsetter {
|
Line 3158 sub defaultsetter {
|
|
|
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(undef,'Defaults'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
$r->print(<<ENDDEFHEAD); |
$r->print(<<ENDDEFHEAD); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
Line 3262 ENDDEFHEAD
|
Line 3247 ENDDEFHEAD
|
} |
} |
$r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'. |
$r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'. |
&mt('Automatic setting rules apply to table mode interfaces only.')); |
&mt('Automatic setting rules apply to table mode interfaces only.')); |
$r->print("\n<table border='1'><tr><th>".&mt('Rule for parameter').'</th><th>'. |
$r->print("\n".&Apache::loncommon::start_data_table(). |
&mt('Action').'</th><th>'.&mt('Value').'</th></tr>'); |
&Apache::loncommon::start_data_table_header_row(). |
|
"<th>".&mt('Rule for parameter').'</th><th>'. |
|
&mt('Action').'</th><th>'.&mt('Value').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row()); |
foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) { |
foreach my $tempkey (&keysindisplayorder(\%allparms,\%keyorder)) { |
unless ($tempkey) { next; } |
unless ($tempkey) { next; } |
$r->print("\n<tr><td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>'); |
$r->print("\n".&Apache::loncommon::start_data_table_row(). |
|
"<td>".$allparms{$tempkey}."\n<br />(".$tempkey.')</td><td>'); |
my $action=&rulescache($tempkey.'_action'); |
my $action=&rulescache($tempkey.'_action'); |
$r->print('<select name="'.$tempkey.'_action">'); |
$r->print('<select name="'.$tempkey.'_action">'); |
if (&isdateparm($defkeytype{$tempkey})) { |
if (&isdateparm($defkeytype{$tempkey})) { |
Line 3315 ENDYESNO
|
Line 3304 ENDYESNO
|
} else { |
} else { |
$r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />'); |
$r->print('<input type="text" size="20" name="'.$tempkey.'_value" value="'.&rulescache($tempkey.'_value').'" />'); |
} |
} |
$r->print('</td></tr>'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print("</table>\n<input type='submit' name='storerules' value='". |
$r->print(&Apache::loncommon::end_data_table(). |
|
"\n<input type='submit' name='storerules' value='". |
&mt('Store Rules')."' /></form>\n". |
&mt('Store Rules')."' /></form>\n". |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return; |
return; |
Line 3344 sub components {
|
Line 3334 sub components {
|
$section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom); |
$section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom); |
$issection=''; |
$issection=''; |
} |
} |
my $realm='<font color="red">'.&mt('All Resources').'</font>'; |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
|
my $realmdescription=&mt('all resources'); |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
$realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <br /><font color="#aaaaaa" size="-2">('.$1.')</font></font>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <span class="LC_parm_folder"><br />('.$1.')</span></span>'; |
} elsif ($middle) { |
$realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1); |
|
} elsif ($middle) { |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle); |
$realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><font color="#aaaaaa" size="-2">('.$url.' in '.$map.' id: '.$id.')</font></font>'; |
$realm='<span class="LC_parm_scope_resource">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' <br /><span class="LC_parm_symb">('.$url.' in '.$map.' id: '.$id.')</span></span>'; |
|
$realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle); |
} |
} |
my $what=$part.'.'.$name; |
my $what=$part.'.'.$name; |
return ($realm,$section,$name,$part,$typeflag, |
return ($realm,$section,$name,$part,$typeflag, |
$what,$middle,$uname,$udom,$issection); |
$what,$middle,$uname,$udom,$issection,$realmdescription); |
} |
} |
|
|
sub standard_parameter_names { |
sub standard_parameter_names { |
my ($name)=@_; |
my ($name)=@_; |
my %standard_parms=&Apache::lonlocal::texthash('duedate' => 'Due Date', |
my %standard_parms=&Apache::lonlocal::texthash('duedate' => 'Due Date', |
Line 3363 sub standard_parameter_names {
|
Line 3357 sub standard_parameter_names {
|
'maxtries' => 'Max. Number of Tries', |
'maxtries' => 'Max. Number of Tries', |
'weight' => 'Weight', |
'weight' => 'Weight', |
'date_start' => 'Starting Date', |
'date_start' => 'Starting Date', |
'date_end' => 'Ending Date'); |
'date_end' => 'Ending Date', |
|
'interval' => 'Time Interval Length', |
|
'tol' => 'Numerical Tolerance', |
|
'sig' => 'Significant Digits', |
|
'contentopen' => 'Content Opening Date', |
|
'contentclose' => 'Content Closing Date', |
|
'discussend' => 'End of Discussion Time', |
|
'discusshide' => 'Discussion Hidden', |
|
'problemstatus' => 'Problem Status Visible', |
|
'int_pos' => 'Positive Integer', |
|
'int_zero_pos' => 'Positive Integer or Zero', |
|
'hinttries' => 'Number of Tries till Hints appear', |
|
'numbubbles' => 'Number of Bubbles in Exam Mode'); |
if ($standard_parms{$name}) { |
if ($standard_parms{$name}) { |
return $standard_parms{$name}; |
return $standard_parms{$name}; |
} else { |
} else { |
Line 3371 sub standard_parameter_names {
|
Line 3377 sub standard_parameter_names {
|
} |
} |
} |
} |
|
|
|
# |
|
# Parameter Change Log |
|
# |
|
|
|
|
sub parm_change_log { |
sub parm_change_log { |
my ($r)=@_; |
my ($r)=@_; |
&startpage($r); |
&startpage($r); |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
my %exetime=(); |
|
foreach my $key (keys(%parmlog)) { |
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); } |
if ($key=~/^(.+)\_exe\_time$/) { |
|
$exetime{$1}=$parmlog{$key}; |
$r->print('<form action="/adm/parmset?action=settable" |
} |
method="post" name"parameterlog"> |
} |
<input type="hidden" name="action" |
|
value="parameterchangelog" />'); |
|
|
|
my %saveable_parameters = ('show' => 'scalar',); |
|
&Apache::loncommon::store_course_settings('parameter_log', |
|
\%saveable_parameters); |
|
&Apache::loncommon::restore_course_settings('parameter_log', |
|
\%saveable_parameters); |
|
if (!$env{'form.show'}) { $env{'form.show'}=10; } |
|
|
|
my $countselect = |
|
&Apache::lonmeta::selectbox('show',$env{'form.show'},undef, |
|
(&mt('all'),10,20,50,100,1000,10000)); |
|
|
|
$r->print('<nobr>'.&mt('[_1] Records',$countselect).'</nobr>'. |
|
'<input type="submit" value="'.&mt('Display').'" />'); |
|
|
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
$r->print('<table border="2">'); |
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
foreach my $id (sort { $exetime{$b}<=>$exetime{$a} } (keys(%exetime))) { |
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'. |
my @changes=split(/\,/,$parmlog{$id.'_logentry'}); |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'. |
|
&Apache::loncommon::end_data_table_header_row()); |
|
my $shown=0; |
|
foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) { |
|
my @changes=keys(%{$parmlog{$id}{'logentry'}}); |
my $count=$#changes+1; |
my $count=$#changes+1; |
my $time = |
my $time = |
&Apache::lonlocal::locallocaltime($parmlog{$id.'_exe_time'}); |
&Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'}); |
my $plainname = |
my $plainname = |
&Apache::loncommon::plainname($parmlog{$id.'_exe_uname'}, |
&Apache::loncommon::plainname($parmlog{$id}{'exe_uname'}, |
$parmlog{$id.'_exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $about_me_link = |
my $about_me_link = |
&Apache::loncommon::aboutmewrapper($plainname, |
&Apache::loncommon::aboutmewrapper($plainname, |
$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 ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
if ((($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 />'. |
my $send_msg_link ='<br />'. |
|
&Apache::loncommon::messagewrapper(&mt('Send message'), |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
$parmlog{$id.'_exe_uname'}, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id.'_exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
} |
} |
$r->print('<tr><td rowspan="'.$count.'">'.$time.'</td> |
my $row_start=&Apache::loncommon::start_data_table_row(); |
|
$r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td> |
<td rowspan="'.$count.'">'.$about_me_link. |
<td rowspan="'.$count.'">'.$about_me_link. |
'<br /><tt>'.$parmlog{$id.'_exe_uname'}. |
'<br /><tt>'.$parmlog{$id}{'exe_uname'}. |
':'.$parmlog{$id.'_exe_udom'}.'</tt>'. |
':'.$parmlog{$id}{'exe_udom'}.'</tt>'. |
$send_msg_link.'</td>'); |
$send_msg_link.'</td>'); |
my $makenewrow=0; |
my $makenewrow=0; |
my %istype=(); |
my %istype=(); |
foreach my $changed (sort @changes) { |
foreach my $changed (reverse(sort(@changes))) { |
my ($key,$value)=split(/\=\>/,&Apache::lonnet::unescape($changed)); |
my $value=$parmlog{$id}{'logentry'}->{$changed}; |
my ($realm,$section,$parmname,$part,$typeflag,$what,$middle,$uname,$udom,$issection)= |
my ($realm,$section,$parmname,$part,$typeflag,$what,$middle,$uname,$udom,$issection,$realmdescription)= |
&components($key,$parmlog{$id.'_uname'},$parmlog{$id.'_udom'}); |
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'}); |
if ($typeflag) { $istype{$parmname}=$value; } |
if ($typeflag) { $istype{$parmname}=$value; } |
if ($makenewrow) { $r->print('<tr>'); } else { $makenewrow=1; } |
if ($makenewrow) { $r->print($row_start); } else { $makenewrow=1; } |
$r->print('<td>'.$realm.'</td><td>'.$section.'</td><td>'. |
$r->print('<td>'.$realm.'</td><td>'.$section.'</td><td>'. |
&standard_parameter_names($parmname).'</td><td>'. |
&standard_parameter_names($parmname).'</td><td>'. |
($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>'); |
($part?&mt('Part: [_1]',$part):&mt('All Parts')).'</td><td>'); |
my $stillactive=0; |
my $stillactive=0; |
if ($parmlog{$id.'_deleteflag'}) { |
if ($parmlog{$id}{'deleteflag'}) { |
$r->print(&mt('Deleted')); |
$r->print(&mt('Deleted')); |
} else { |
} else { |
if ($typeflag) { |
if ($typeflag) { |
Line 3438 sub parm_change_log {
|
Line 3469 sub parm_change_log {
|
$r->print($value); |
$r->print($value); |
} |
} |
if ($value ne $all[$level]) { |
if ($value ne $all[$level]) { |
$r->print('<br /><font color="red">'.&mt('Not active anymore').'</font>'); |
$r->print('<br /><span class="LC_warning">'.&mt('Not active anymore').'</span>'); |
} else { |
} else { |
$stillactive=1; |
$stillactive=1; |
} |
} |
Line 3446 sub parm_change_log {
|
Line 3477 sub parm_change_log {
|
} |
} |
$r->print('</td>'); |
$r->print('</td>'); |
if ($stillactive) { |
if ($stillactive) { |
|
my $title=&mt('Changed [_1]',&standard_parameter_names($parmname)); |
|
my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription, |
|
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
if (($uname) && ($udom)) { |
if (($uname) && ($udom)) { |
$r->print('<td>Notify Link</td>'); |
$r->print('<td>'. |
|
&Apache::loncommon::messagewrapper('Notify User',$uname,$udom,$title,$description). |
|
'</td>'); |
} else { |
} else { |
$r->print('<td>Blog Link</td>'); |
$r->print('<td>'. |
|
&Apache::lonrss::course_blog_link($id,$title,$description). |
|
'</td>'); |
} |
} |
} else { |
} else { |
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
$r->print('</tr>'); |
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
|
$shown++; |
|
if (!($env{'form.show'} eq &mt('all') |
|
|| $shown<=$env{'form.show'})) { last; } |
} |
} |
$r->print('</table>'); |
$r->print(&Apache::loncommon::end_data_table()); |
|
$r->print('</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3496 sub handler {
|
Line 3538 sub handler {
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
text=>"Parameter Manager", |
text=>"Parameter Manager", |
faq=>10, |
faq=>10, |
bug=>'Instructor Interface'}); |
bug=>'Instructor Interface', |
|
help => 'Parameter_Manager'}); |
|
|
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
my $parm_permission = |
my $parm_permission = |
Line 3521 sub handler {
|
Line 3564 sub handler {
|
# the table mode |
# the table mode |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({help=>'Problem_Parameters', |
|
text=>"Problem Parameters"}); |
&assessparms($r); |
&assessparms($r); |
|
|
} elsif (! exists($env{'form.action'})) { |
} elsif (! exists($env{'form.action'})) { |
$r->print(&header()); |
$r->print(&header()); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Manager')); |
'Parameter Manager')); |
|
&print_main_menu($r,$parm_permission); |
&print_main_menu($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'crsenv' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'crsenv' && $parm_permission) { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |