version 1.413.4.3, 2010/01/25 21:58:31
|
version 1.442, 2009/04/05 17:31:04
|
Line 44 This module sets coursewide and assessme
|
Line 44 This module sets coursewide and assessme
|
|
|
=head1 INTERNAL SUBROUTINES |
=head1 INTERNAL SUBROUTINES |
|
|
=over 4 |
=over |
|
|
|
=pod |
|
|
=item parmval() |
=item parmval() |
|
|
Line 56 Inputs: $what - a parameter spec (inclu
|
Line 58 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 |
6 - General for group |
6 - General for group |
5 - Map or Folder level for group |
5 - Map or Folder level for group |
4 - resource level in group |
4 - resource level in group |
3 - General for specific student |
3 - General for specific student |
2 - Map or Folder level for specific student |
2 - Map or Folder level for specific student |
1 - resource level for specific student |
1 - resource level for specific student |
|
|
=item parmval_by_symb() |
=item parmval_by_symb() |
|
|
=item reset_caches() |
=item reset_caches() |
|
|
=item cacheparmhash() |
=item cacheparmhash() |
|
|
=item parmhash() |
=item parmhash() |
|
|
Line 118 Produces a link anchor.
|
Line 120 Produces a link anchor.
|
|
|
Inputs: $type,$dis,$value,$marker,$return,$call |
Inputs: $type,$dis,$value,$marker,$return,$call |
|
|
Returns: scalar with html code for a link which will envoke the |
Returns: scalar with html code for a link which will envoke the |
javascript function 'pjump'. |
javascript function 'pjump'. |
|
|
=item page_js() |
=item page_js() |
Line 133 javascript function 'pjump'.
|
Line 135 javascript function 'pjump'.
|
|
|
=item parm_control_group() |
=item parm_control_group() |
|
|
=item extractResourceInformation() : |
=item extractResourceInformation() : |
|
|
Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. |
Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. |
|
|
Line 145 Input: See list below:
|
Line 147 Input: See list below:
|
|
|
=item * B<keyp> : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id |
=item * B<keyp> : hash, id->key list, will contain a comma separated list of the meta-data keys available for the given id |
|
|
|
|
=item * B<allparms> : hash, name of parameter->display value (what is the display value?) |
=item * B<allparms> : hash, name of parameter->display value (what is the display value?) |
|
|
=item * B<allparts> : hash, part identification->text representation of part, where the text representation is "[Part $part]" |
=item * B<allparts> : hash, part identification->text representation of part, where the text representation is "[Part $part]" |
Line 190 Input: See list below:
|
Line 191 Input: See list below:
|
|
|
=item standardkeyorder() |
=item standardkeyorder() |
|
|
=item assessparms() : |
=item assessparms() : |
|
|
Show assessment data and parameters. This is a large routine that should |
Show assessment data and parameters. This is a large routine that should |
be simplified and shortened... someday. |
be simplified and shortened... someday. |
Line 213 Variables used (guessed by Jeremy):
|
Line 214 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 |
|
|
|
=item crsenv() |
|
|
|
Show and set course data and parameters. This is a large routine that should |
|
be simplified and shortened... someday. |
|
|
|
Inputs: $r |
|
|
|
Returns: nothing |
|
|
|
=item can_modify_catsettings() |
|
|
|
=item assign_course_categories() |
|
|
=item tablestart() |
=item tablestart() |
|
|
=item tableend() |
=item tableend() |
Line 250 Variables used (guessed by Jeremy):
|
Line 264 Variables used (guessed by Jeremy):
|
=item check_cloners() : |
=item check_cloners() : |
|
|
Checks if new users included in list of allowed cloners |
Checks if new users included in list of allowed cloners |
are valid users. Replaces supplied list with |
are valid users. Replaces supplied list with |
cleaned list containing only users with valid usernames |
cleaned list containing only users with valid usernames |
and domains. |
and domains. |
|
|
Inputs: $clonelist, $oldcloner |
Inputs: $clonelist, $oldcloner |
where $clonelist is ref to array of requested cloners, |
where $clonelist is ref to array of requested cloners, |
and $oldcloner is ref to array of currently allowed |
and $oldcloner is ref to array of currently allowed |
cloners. |
cloners. |
Line 270 change is made to the list of users allo
|
Line 284 change is made to the list of users allo
|
a course. |
a course. |
|
|
Inputs: $action,$cloner |
Inputs: $action,$cloner |
where $action is add or drop, and $cloner is identity of |
where $action is add or drop, and $cloner is identity of |
user for whom cloning ability is to be changed in course. |
user for whom cloning ability is to be changed in course. |
|
|
|
|
=item check_cloners() |
=item check_cloners() |
Line 306 Set portfolio metadata
|
Line 320 Set portfolio metadata
|
|
|
=item parm_change_log() |
=item parm_change_log() |
|
|
=item handler() : |
=item handler() : |
|
|
Main handler. Calls &assessparms subroutine. |
Main handler. Calls &assessparms and &crsenv subroutines. |
|
|
|
|
=back |
=back |
|
|
=cut |
=cut |
|
|
|
|
################################################################### |
################################################################### |
################################################################### |
################################################################### |
|
|
Line 335 use Apache::longroup;
|
Line 348 use Apache::longroup;
|
use Apache::lonrss; |
use Apache::lonrss; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
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 537 sub reset_caches {
|
Line 551 sub reset_caches {
|
} |
} |
|
|
|
|
|
|
sub preset_defaults { |
sub preset_defaults { |
my $type=shift; |
my $type=shift; |
if (&rulescache($type.'_action') eq 'default') { |
if (&rulescache($type.'_action') eq 'default') { |
Line 552 sub preset_defaults {
|
Line 567 sub preset_defaults {
|
} |
} |
|
|
|
|
|
|
|
|
sub date_sanity_info { |
sub date_sanity_info { |
my $checkdate=shift; |
my $checkdate=shift; |
unless ($checkdate) { return ''; } |
unless ($checkdate) { return ''; } |
Line 759 sub storeparm_by_symb_inner {
|
Line 776 sub storeparm_by_symb_inner {
|
return ''; |
return ''; |
} |
} |
|
|
|
|
sub valout { |
sub valout { |
my ($value,$type,$editable)=@_; |
my ($value,$type,$editable)=@_; |
my $result = ''; |
my $result = ''; |
Line 815 sub valout {
|
Line 833 sub valout {
|
return $result; |
return $result; |
} |
} |
|
|
|
|
sub plink { |
sub plink { |
my ($type,$dis,$value,$marker,$return,$call)=@_; |
my ($type,$dis,$value,$marker,$return,$call)=@_; |
my $winvalue=$value; |
my $winvalue=$value; |
Line 835 sub plink {
|
Line 854 sub plink {
|
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item = &HTML::Entities::encode($$item,'"<>&'); |
$$item =~ s/\'/\\\'/g; |
$$item =~ s/\'/\\\'/g; |
} |
} |
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="'.$unencmarker.'" /></td></tr><tr><td align="center">'. |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
'<a href="javascript:pjump('."'".$type."','".$dis."','".$winvalue."','" |
.$unencmarker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
$valout.'</a></td></tr></table>'; |
$valout.'</a></td></tr></table>'; |
} |
} |
|
|
Line 898 sub startpage {
|
Line 917 sub startpage {
|
my %loaditems = ('onunload' => "pclose()", |
my %loaditems = ('onunload' => "pclose()", |
'onload' => "group_or_section('cgroup')",); |
'onload' => "group_or_section('cgroup')",); |
|
|
|
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
|
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({help=>'Problem_Parameters', |
|
text=>"Problem Parameters"}); |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Table Mode", |
|
help => 'Course_Setting_Parameters'}); |
|
} |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Set/Modify Course Parameters', |
&Apache::loncommon::start_page('Set/Modify Course Parameters', |
&page_js(), |
&page_js(), |
Line 945 sub print_row {
|
Line 973 sub print_row {
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
$r->print('<td style="background-color:'.$defbgtwo.';" align="center">' |
$r->print('<td style="background-color:'.$defbgtwo.';" align="center">' |
.$$part{$which}.'</td>'); |
.$$part{$which}.'</td>'); |
} else { |
} else { |
$parm=~s|\[.*\]\s||g; |
$parm=~s|\[.*\]\s||g; |
} |
} |
my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); |
my $automatic=&rulescache(($which=~/\_([^\_]+)$/)[0].'_triggers'); |
Line 1040 sub print_row {
|
Line 1068 sub print_row {
|
&valout($sessionval,$sessionvaltype).' '. |
&valout($sessionval,$sessionvaltype).' '. |
'</font></td>'); |
'</font></td>'); |
} |
} |
|
$r->print('</tr>'); |
|
$r->print("\n"); |
} |
} |
|
|
sub print_td { |
sub print_td { |
Line 1120 sub parm_control_group {
|
Line 1150 sub parm_control_group {
|
return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype); |
return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype); |
} |
} |
|
|
|
|
|
|
sub extractResourceInformation { |
sub extractResourceInformation { |
my $ids = shift; |
my $ids = shift; |
my $typep = shift; |
my $typep = shift; |
Line 1158 sub extractResourceInformation {
|
Line 1190 sub extractResourceInformation {
|
# |
# |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
if (!exists($$allparms{$name}) || $$allparms{$name} =~ m/^\s*$/ ) { |
my ($display,$parmdis); |
my ($display,$parmdis); |
$display = &standard_parameter_names($name); |
$display = &standard_parameter_names($name); |
if ($display eq '') { |
if ($display eq '') { |
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
$parmdis = $display; |
$parmdis = $display; |
$parmdis =~ s/\s*\[Part.*$//g; |
$parmdis =~ s/\s*\[Part.*$//g; |
} else { |
} else { |
$parmdis = &mt($display); |
$parmdis = $display; |
} |
} |
$$allparms{$name}=$parmdis; |
$$allparms{$name}=$parmdis; |
if (ref($defkeytype)) { |
if (ref($defkeytype)) { |
$$defkeytype{$name}= |
$$defkeytype{$name}= |
Line 1218 sub extractResourceInformation {
|
Line 1250 sub extractResourceInformation {
|
} |
} |
|
|
|
|
################################################## |
|
################################################## |
|
|
|
sub isdateparm { |
sub isdateparm { |
my $type=shift; |
my $type=shift; |
Line 1301 ENDSCRIPT
|
Line 1331 ENDSCRIPT
|
$r->print(' checked="checked"'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: $tempkey). |
: $tempkey) |
'</label></td>'); |
.'</label></td>'); |
$cnt++; |
$cnt++; |
if ($cnt==3) { |
if ($cnt==3) { |
$r->print("</tr>\n<tr>"); |
$r->print("</tr>\n<tr>"); |
Line 1517 sub sectionmenu {
|
Line 1547 sub sectionmenu {
|
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
return if (!%sectionhash); |
return if (!%sectionhash); |
|
|
$r->print('<select name="Section" multiple="multiple" size="8" >'); |
$r->print('<select name="Section" multiple="multiple" size="8">'); |
foreach my $s ('all',sort keys %sectionhash) { |
foreach my $s ('all',sort keys %sectionhash) { |
$r->print(' <option value="'.$s.'"'); |
$r->print(' <option value="'.$s.'"'); |
foreach (@{$selectedsections}) { |
foreach (@{$selectedsections}) { |
Line 1536 sub groupmenu {
|
Line 1566 sub groupmenu {
|
my %grouphash = &Apache::longroup::coursegroups(); |
my %grouphash = &Apache::longroup::coursegroups(); |
return if (!%grouphash); |
return if (!%grouphash); |
|
|
$r->print('<select name="Group" multiple="multiple" size="8" >'); |
$r->print('<select name="Group" multiple="multiple" size="8">'); |
foreach my $group (sort(keys(%grouphash))) { |
foreach my $group (sort(keys(%grouphash))) { |
$r->print(' <option value="'.$group.'"'); |
$r->print(' <option value="'.$group.'"'); |
foreach (@{$selectedgroups}) { |
foreach (@{$selectedgroups}) { |
Line 1620 sub standardkeyorder {
|
Line 1650 sub standardkeyorder {
|
'parameter_0_discusshide' => 20); |
'parameter_0_discusshide' => 20); |
} |
} |
|
|
|
|
sub assessparms { |
sub assessparms { |
|
|
my $r=shift; |
my $r=shift; |
Line 1986 ENDTABLEHEADFOUR
|
Line 2017 ENDTABLEHEADFOUR
|
if (grep $_ eq $tempkeyp, @catmarker) { |
if (grep $_ eq $tempkeyp, @catmarker) { |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$part{$_}=&Apache::lonnet::metadata($uri,$_.'.part'); |
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name'); |
$name{$_}=&Apache::lonnet::metadata($uri,$_.'.name'); |
unless ($display{$_}) { $display{$_}=''; } |
|
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
if ($allparms{$name{$_}} ne '') { |
if ($allparms{$name{$_}} ne '') { |
my $identifier; |
my $identifier; |
Line 1997 ENDTABLEHEADFOUR
|
Line 2027 ENDTABLEHEADFOUR
|
} else { |
} else { |
$display{$_} = $parmdis; |
$display{$_} = $parmdis; |
} |
} |
|
unless ($display{$_}) { $display{$_}=''; } |
$display{$_}.=' ('.$name{$_}.')'; |
$display{$_}.=' ('.$name{$_}.')'; |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type'); |
$type{$_}=&Apache::lonnet::metadata($uri,$_.'.type'); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title'); |
$thistitle=&Apache::lonnet::metadata($uri,$_.'.title'); |
} |
} |
} |
} |
my $totalparms=scalar(keys(%name)); |
my $totalparms=scalar keys %name; |
if ($totalparms>0) { |
if ($totalparms>0) { |
my $firstrow=1; |
my $firstrow=1; |
my $title=&Apache::lonnet::gettitle($symbp{$rid}); |
my $title=&Apache::lonnet::gettitle($symbp{$rid}); |
$r->print('<tr><td style="background-color:'.$defbgone.';"'. |
$r->print('<tr><td style="background-color:'.$defbgone.';"'. |
' rowspan="'.$totalparms. |
' rowspan='.$totalparms. |
'"><tt><font size="-1">'. |
'><tt><font size="-1">'. |
join(' / ',split(/\//,$uri)). |
join(' / ',split(/\//,$uri)). |
'</font></tt><p><b>'. |
'</font></tt><p><b>'. |
"<a href=\"javascript:openWindow('". |
"<a href=\"javascript:openWindow('". |
Line 2023 ENDTABLEHEADFOUR
|
Line 2054 ENDTABLEHEADFOUR
|
} |
} |
$r->print('</a></b></td>'); |
$r->print('</a></b></td>'); |
$r->print('<td style="background-color:'.$defbgtwo.';"'. |
$r->print('<td style="background-color:'.$defbgtwo.';"'. |
' rowspan="'.$totalparms.'">'.$typep{$rid}. |
' rowspan='.$totalparms.'>'.$typep{$rid}. |
'</td>'); |
'</td>'); |
|
|
$r->print('<td style="background-color:'.$defbgone.';"'. |
$r->print('<td style="background-color:'.$defbgone.';"'. |
' rowspan="'.$totalparms. |
' rowspan='.$totalparms. |
'">'.$maptitles{$mapp{$rid}}.'</td>'); |
'>'.$maptitles{$mapp{$rid}}.'</td>'); |
|
|
foreach (&keysinorder_bytype(\%name,\%keyorder)) { |
foreach (&keysinorder_bytype(\%name,\%keyorder)) { |
unless ($firstrow) { |
unless ($firstrow) { |
Line 2040 ENDTABLEHEADFOUR
|
Line 2071 ENDTABLEHEADFOUR
|
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$cgroup,\@usersgroups); |
$cgroup,\@usersgroups); |
$r->print('</tr>'."\n"); |
|
} |
} |
} |
} |
} |
} |
Line 2050 ENDTABLEHEADFOUR
|
Line 2080 ENDTABLEHEADFOUR
|
} # end of full |
} # end of full |
#--------------------------------------------------- Entry for parm level map |
#--------------------------------------------------- Entry for parm level map |
if ($parmlev eq 'map') { |
if ($parmlev eq 'map') { |
my $defbgone = 'E0E099'; |
my $defbgone = '#E0E099'; |
my $defbgtwo = 'FFFF99'; |
my $defbgtwo = '#FFFF99'; |
my $defbgthree = 'FFBB99'; |
my $defbgthree = '#FFBB99'; |
|
|
my %maplist; |
my %maplist; |
|
|
Line 2149 ENDTABLEHEADFOUR
|
Line 2179 ENDTABLEHEADFOUR
|
,'<font color="red"><i>'.$coursename.'</i></font>' |
,'<font color="red"><i>'.$coursename.'</i></font>' |
) |
) |
."<br /></h4>\n" |
."<br /></h4>\n" |
); |
); |
#---------------------------------------------------------------- print table |
#---------------------------------------------------------------- print table |
$r->print('<p>'..&Apache::loncommon::start_data_table(). |
$r->print('<p>'.&Apache::loncommon::start_data_table() |
&Apache::loncommon::start_data_table_header_row(). |
.&Apache::loncommon::start_data_table_header_row() |
'<tr><th>'.&mt('Parameter Name').'</th>'. |
.'<th>'.&mt('Parameter Name').'</th>' |
'<th>'.&mt('Default Value').'</th>'. |
.'<th>'.&mt('Default Value').'</th>' |
'<th>'.&mt('Parameter in Effect').'</th>'. |
.'<th>'.&mt('Parameter in Effect').'</th>' |
&Apache::loncommon::end_data_table_header_row()); |
.&Apache::loncommon::end_data_table_header_row() |
|
); |
|
|
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); |
$parmlev,$uname,$udom,$csec,$cgroup); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table().'</p></div>'); |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
|
.'</div>' |
|
); |
} # end each map |
} # end each map |
} # end of $parmlev eq map |
} # end of $parmlev eq map |
#--------------------------------- Entry for parm level general (Course level) |
#--------------------------------- Entry for parm level general (Course level) |
if ($parmlev eq 'general') { |
if ($parmlev eq 'general') { |
my $defbgone = 'E0E099'; |
my $defbgone = '#E0E099'; |
my $defbgtwo = 'FFFF99'; |
my $defbgtwo = '#FFFF99'; |
my $defbgthree = 'FFBB99'; |
my $defbgthree = '#FFBB99'; |
|
|
#-------------------------------------------- for each map, gather information |
#-------------------------------------------- for each map, gather information |
my $mapid="0.0"; |
my $mapid="0.0"; |
Line 2240 ENDMAPONE
|
Line 2272 ENDMAPONE
|
if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$cgroup</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>'.&Apache::loncommon::start_data_table(). |
$r->print('<p>'.&Apache::loncommon::start_data_table() |
&Apache::loncommon::start_data_table_header_row(). |
.&Apache::loncommon::start_data_table_header_row() |
'<th>'.&mt('Parameter Name').'</th>'. |
.'<th>'.&mt('Parameter Name').'</th>' |
'<th>'.&mt('Default Value').'</th>'. |
.'<th>'.&mt('Default Value').'</th>' |
'<th>'.&mt('Parameter in Effect').'</th>'. |
.'<th>'.&mt('Parameter in Effect').'</th>' |
&Apache::loncommon::end_data_table_header_row()); |
.&Apache::loncommon::end_data_table_header_row() |
|
); |
|
|
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); |
$parmlev,$uname,$udom,$csec,$cgroup); |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
} |
$r->print(&Apache::loncommon::end_data_table().'</p></center>'); |
$r->print(&Apache::loncommon::end_data_table() |
|
.'</p>' |
|
.'</center>' |
|
); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
} |
} |
$r->print('</form>'.&Apache::loncommon::end_page()); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
} # end sub assessparms |
} # end sub assessparms |
|
|
|
|
|
|
|
sub crsenv { |
|
my $r=shift; |
|
my $setoutput=''; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
|
my $breadcrumbs = |
|
&Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment'); |
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
|
my (%crsinfo,$chome); |
|
my $crstype = &Apache::loncommon::course_type(); |
|
|
|
# |
|
# Go through list of changes |
|
foreach (keys %env) { |
|
next if ($_!~/^form\.(.+)\_setparmval$/); |
|
my $name = $1; |
|
my $value = $env{'form.'.$name.'_value'}; |
|
if ($name eq 'newp') { |
|
$name = $env{'form.newp_name'}; |
|
} |
|
if ($name =~ /^rolenames_([^_]+)$/) { |
|
$name = $1.'.plaintext'; |
|
my $standardtitle = |
|
&Apache::lonnet::plaintext($1,$crstype,$env{'request.course.id'},1); |
|
my %adv_roles = |
|
&Apache::lonnet::get_course_adv_roles($env{'request.course.id'},1); |
|
if ($value ne '') { |
|
foreach my $role (keys(%adv_roles)) { |
|
if ($role =~ m{^cr/$match_domain/$match_name/\Q$value\E$}) { |
|
$setoutput.= '<span class="LC_error">'. |
|
&mt('Requested replacement title for [_1] role is already used as the name of a custom role ([_2]).',$standardtitle,$value). |
|
'</span><br />'; |
|
undef($value); |
|
} |
|
} |
|
} |
|
} |
|
if ($name eq 'url') { |
|
$value=~s/^\/res\///; |
|
my $bkuptime=time; |
|
my @tmp = &Apache::lonnet::get |
|
('environment',['url'],$dom,$crs); |
|
$setoutput.=&mt('Backing up previous URL').': '. |
|
&Apache::lonnet::put |
|
('environment', |
|
{'top level map backup '.$bkuptime => $tmp[1] }, |
|
$dom,$crs). |
|
'<br />'; |
|
} |
|
# |
|
# Deal with modified default spreadsheets |
|
if ($name =~ /^spreadsheet_default_(classcalc| |
|
studentcalc| |
|
assesscalc)$/x) { |
|
my $sheettype = $1; |
|
if ($sheettype eq 'classcalc') { |
|
# no need to do anything since viewing the sheet will |
|
# cause it to be updated. |
|
} elsif ($sheettype eq 'studentcalc') { |
|
# expire all the student spreadsheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
} else { |
|
# expire all the assessment spreadsheets |
|
# this includes non-default spreadsheets, but better to |
|
# be safe than sorry. |
|
&Apache::lonnet::expirespread('','','assesscalc'); |
|
# expire all the student spreadsheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
} |
|
} |
|
# |
|
# Deal with the enrollment dates |
|
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
|
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value'); |
|
} |
|
# |
|
# Deal with the emails |
|
if ($name =~ /\.email$/) { |
|
foreach my $specifier (split(',',$value)) { |
|
my ($user,$sections_or_groups)= |
|
($specifier=~/^([^\(]+)\(([^\)]+)\)/); |
|
if (!$sections_or_groups) { |
|
$user = $specifier; |
|
} |
|
my ($name,$domain) = split(':',$user); |
|
if (!defined($user) || !defined($domain)) { |
|
$setoutput.= '<br /> <span class="LC_error">'. |
|
&mt("Invalid e-mail address specified, address must be of the form username:domain what was specified was ([_1])",$user). |
|
'</span>'; |
|
undef($value); |
|
} elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') { |
|
$setoutput.= '<br /> <span class="LC_error">'. |
|
&mt("Invalid e-mail address specified, user [_1] is unknown.",$name). |
|
'</span>'; |
|
undef($value); |
|
} |
|
} |
|
} |
|
# Get existing cloners |
|
my @oldcloner = (); |
|
if ($name eq 'cloners') { |
|
my %clonenames=&Apache::lonnet::dump('environment',$dom,$crs,'cloners'); |
|
if ($clonenames{'cloners'} =~ /,/) { |
|
@oldcloner = split/,/,$clonenames{'cloners'}; |
|
} else { |
|
$oldcloner[0] = $clonenames{'cloners'}; |
|
} |
|
} |
|
# |
|
# Let the user know we made the changes |
|
if ($name && defined($value)) { |
|
my %failed_cloners; |
|
if ($name eq 'cloners') { |
|
$value =~ s/\s//g; |
|
$value =~ s/^,//; |
|
$value =~ s/,$//; |
|
# check requested clones are valid users. |
|
%failed_cloners = &check_cloners(\$value,\@oldcloner); |
|
} |
|
my $put_result = &Apache::lonnet::put('environment', |
|
{$name=>$value},$dom,$crs); |
|
if ($put_result eq 'ok') { |
|
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
|
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
|
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
|
} elsif ($name eq 'categories') { |
|
$setoutput .= $env{'form.categories_display'}; |
|
} else { |
|
$setoutput .= $value; |
|
} |
|
$setoutput .= '</b>.<br />'; |
|
if ($name eq 'cloners') { |
|
&change_clone($value,\@oldcloner); |
|
} |
|
# Update environment and nohist_courseids.db |
|
if (($name eq 'description') || ($name eq 'cloners') || |
|
($name eq 'hidefromcat') || ($name eq 'categories')) { |
|
if ($chome eq '') { |
|
%crsinfo = |
|
&Apache::lonnet::courseiddump($dom,'.',1,'.','.', |
|
$crs,undef,undef,'.'); |
|
$chome = &Apache::lonnet::homeserver($crs,$dom); |
|
} |
|
} |
|
if ($name eq 'description' && defined($value)) { |
|
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.description' => $value}); |
|
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
|
$crsinfo{$env{'request.course.id'}}{'description'} = $value; |
|
my $putresult = |
|
&Apache::lonnet::courseidput($dom,\%crsinfo, |
|
$chome,'notime'); |
|
} |
|
} |
|
if (($name eq 'cloners') || ($name eq 'hidefromcat') || ($name eq 'categories')) { |
|
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
|
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.'.$name => $value}); |
|
$crsinfo{$env{'request.course.id'}}{$name} = $value; |
|
my $putresult = |
|
&Apache::lonnet::courseidput($dom,\%crsinfo, |
|
$chome,'notime'); |
|
} |
|
} |
|
} else { |
|
$setoutput.=&mt('Unable to set').' <b>'.$name.'</b> '.&mt('to'). |
|
' <b>'.$value.'</b> '.&mt('due to').' '.$put_result.'.<br />'; |
|
} |
|
if (($name eq 'cloners') && (keys(%failed_cloners) > 0)) { |
|
$setoutput.= &mt('Unable to include').': '; |
|
my @fails; |
|
my $num = 0; |
|
if (defined($failed_cloners{'format'})) { |
|
$fails[$num] .= '<b>'.$failed_cloners{'format'}. |
|
'</b>, '.&mt('reason').' - '. |
|
&mt('Invalid format'); |
|
$num ++; |
|
} |
|
if (defined($failed_cloners{'domain'})) { |
|
$fails[$num] .= '<b>'.$failed_cloners{'domain'}. |
|
'</b>, '.&mt('reason').' - '. |
|
&mt('Domain does not exist'); |
|
$num ++; |
|
} |
|
if (defined($failed_cloners{'newuser'})) { |
|
$fails[$num] .= '<b>'.$failed_cloners{'newuser'}. '</b>, '.&mt('reason').' - '. |
|
&mt('LON-CAPA user(s) do(es) not exist.'). |
|
'.<br />'.&mt('Please '). |
|
' <a href="/adm/createuser">'. |
|
&mt('add the user(s)').'</a>, '. |
|
&mt('and then return to the '). |
|
'<a href="/adm/parmset?action=crsenv">'. |
|
&mt('Course Parameters page').'</a> '. |
|
&mt('to add the new user(s) to the list of possible cloners'); |
|
} |
|
$setoutput .= join('; ',@fails).'.<br />'; |
|
} |
|
} |
|
} |
|
|
|
# ------------------------- Re-init course environment entries for this session |
|
|
|
&Apache::lonnet::coursedescription($env{'request.course.id'}, |
|
{'freshen_cache' => 1}); |
|
|
|
# -------------------------------------------------------- Get parameters again |
|
|
|
my %values=&Apache::lonnet::dump('environment',$dom,$crs); |
|
my $SelectStyleFile=&mt('Select Style File'); |
|
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
|
my $output=''; |
|
my $output_SB = ''; # will be replaced by "$output" when all changes are done |
|
my $can_categorize; |
|
my %lt=&Apache::lonlocal::texthash( |
|
'par' => 'Parameter', |
|
'val' => 'Value', |
|
'set' => 'Set?', |
|
'sav' => 'Save', |
|
); |
|
if (! exists($values{'con_lost'})) { |
|
my %descriptions= |
|
('url' => '<b>'.&mt('Top Level Map').'</b><br />'. |
|
'<a href="javascript:openbrowser'. |
|
"('envform','url','sequence')\">". |
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
|
&mt('Modification may make assessment data inaccessible!'). |
|
'</span>', |
|
'description' => '<b>'.&mt('Course Title').'</b>', |
|
'courseid' => '<b>'.&mt('Course ID or number'). |
|
'</b><br />'. |
|
'('.&mt('internal, optional').')', |
|
'cloners' => '<b>'.&mt('Users allowed to clone course').'</b><br />' |
|
.'("<tt>'.&mt('user:domain,user:domain,*:domain').'</tt>")<br />' |
|
.&mt('Users with active Course Coordinator role in this course are permitted to clone and need not be included.').'<br />' |
|
.&mt('Use [_1] to allow course to be cloned by anyone in the specified domain.','"<tt>*:domain</tt>"').'<br />' |
|
.&mt('Use [_1] to allow unrestricted cloning in all domains.','"<tt>*</tt>"'), |
|
'grading' => '<b>'.&mt('Grading').'</b><br />'. |
|
&mt('[_1], [_2], or [_3]','"<tt>standard</tt>"','"<tt>external</tt>"','"<tt>spreadsheet</tt>"').&Apache::loncommon::help_open_topic('GradingOptions'), |
|
'task_grading' => '<b>'.&mt('Bridge Task Grading').'</b><br />' |
|
.&mt('Instructors and TAs in sections, when grading bridge tasks, should be allowed to grade other sections.').'<br />' |
|
.'('.&mt('[_1]: they are allowed (this is the default). [_2]: no, they can only grade their own section.','"<tt>any</tt>"','"<tt>section</tt>"').')', |
|
'default_xml_style' => '<b>'.&mt('Default XML Style File').'</b><br />'. |
|
'<a href="javascript:openbrowser'. |
|
"('envform','default_xml_style'". |
|
",'sty')\">$SelectStyleFile</a><br />", |
|
'question.email' => '<b>'.&mt('Feedback Addresses for Resource Content Question').'</b><br />' |
|
.'("<tt>'.&mt('user:domain,user:domain(section;section;...;*;...),...').'</tt>")', |
|
'question.email.text' => '<b>'.&mt('Custom Text for Resource Content Question Option in Feedback').'</b>', |
|
'comment.email' => '<b>'.&mt('Feedback Addresses for Course Content Comments').'</b><br />' |
|
.'("<tt>'.&mt('user:domain,user:domain(section;section;...;*;...),...').'</tt>")', |
|
'comment.email.text' => '<b>'.&mt('Custom Text for Course Content Option in Feedback').'</b>', |
|
'policy.email' => '<b>'.&mt('Feedback Addresses for Course Policy').'</b><br />' |
|
.'("<tt>'.&mt('user:domain,user:domain(section;section;...;*;...),...').'</tt>")', |
|
'policy.email.text' => '<b>'.&mt('Custom Text for Course Policy Option in Feedback').'</b>', |
|
'hideemptyrows' => '<b>'.&mt('Hide Empty Rows in Spreadsheets').'</b><br />' |
|
.'('.&mt('[_1] for default hiding','"<tt>yes</tt>"').')', |
|
'pageseparators' => '<b>'.&mt('Visibly Separate Items on Pages').'</b><br />' |
|
.'('.&mt('[_1] for visible separation.','"<tt>yes</tt>"').' ' |
|
.&mt('Changes will not show until next login.').')', |
|
'student_classlist_view' => '<b>'.&mt('Allow students to view classlist.').'</b><br />' |
|
.'('.&mt('[_1]: students can view all sections. [_2]: students can only view their own section. blank or [_3] prevents student view.','"<tt>all</tt>"','"<tt>section</tt>"','"<tt>disabled</tt>"').')', |
|
'student_classlist_portfiles' => '<b>'.&mt('Include link to accessible portfolio files').'</b><br />' |
|
.'('.&mt("[_1] for link to each a listing of each student's files.",'"<tt>yes</tt>"').')', |
|
'student_classlist_opt_in' => '<b>'.&mt("Student's agreement needed for listing in student-viewable roster").'</b><br />' |
|
.'('.&mt('[_1] to require students to opt-in to listing in the roster (on the roster page).','"<tt>yes</tt>"').')', |
|
'plc.roles.denied'=> '<b>'.&mt('Disallow chat room use for Roles').'</b><br />' |
|
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"').')<br />' |
|
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
|
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
|
'plc.users.denied' => |
|
'<b>'.&mt('Disallow chat room use for Users').'</b><br />'. |
|
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
|
|
|
'pch.roles.denied'=> '<b>'.&mt('Disallow Resource Discussion for Roles').'</b><br />' |
|
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"') |
|
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
|
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
|
'pch.users.denied' => |
|
'<b>'.&mt('Disallow Resource Discussion for Users').'</b><br />'. |
|
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
|
'spreadsheet_default_classcalc' |
|
=> '<b>'.&mt('Default Course Spreadsheet').'</b> '. |
|
'<a href="javascript:openbrowser'. |
|
"('envform','spreadsheet_default_classcalc'". |
|
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
|
'spreadsheet_default_studentcalc' |
|
=> '<b>'.&mt('Default Student Spreadsheet').'</b><br />'. |
|
'<a href="javascript:openbrowser'. |
|
"('envform','spreadsheet_default_calc'". |
|
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
|
'spreadsheet_default_assesscalc' |
|
=> '<b>'.&mt('Default Assessment Spreadsheet').'</b> '. |
|
'<a href="javascript:openbrowser'. |
|
"('envform','spreadsheet_default_assesscalc'". |
|
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
|
'allow_limited_html_in_feedback' |
|
=> '<b>'.&mt('Allow limited HTML in discussion posts').'</b><br />'. |
|
'('.&mt('Set value to [_1] to allow.','"<tt>yes</tt>"').')', |
|
'allow_discussion_post_editing' |
|
=> '<b>'.&mt('Allow users with specified roles to edit/delete their own discussion posts').'</b><br />' |
|
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"').')<br />' |
|
.'('.&mt('Set value to [_1] to allow all roles.','"<tt>yes</tt>"').')' |
|
.'("<tt>'.&mt('role:section,role:section,...').'</tt>")<br />' |
|
.'('.&mt('Example: "<tt>st:001,st:002,in,cc</tt>" would permit students in sections 001 and 002 and instructors in any section, and course coordinators to edit their own posts.').')', |
|
'rndseed' |
|
=> '<b>'.&mt('Randomization algorithm used').'</b><br />' |
|
.'<span class="LC_error">' |
|
.&mt('Modifying this will make problems have different numbers and answers!') |
|
.'</span>', |
|
'receiptalg' |
|
=> '<b>'.&mt('Receipt algorithm used').'</b> <br />'. |
|
&mt('This controls how receipt numbers are generated.'), |
|
'suppress_tries' |
|
=> '<b>'.&mt('Suppress number of tries in printing').'</b><br />'. |
|
' ('.&mt('[_1] to suppress, anything else to not suppress','"<tt>yes</tt>"').')', |
|
'problem_stream_switch' |
|
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
|
' ('.&mt('[_1] if allowed, anything else if not','"<tt>yes</tt>"').')', |
|
'default_paper_size' |
|
=> '<b>'.&mt('Default paper type').'</b><br />'. |
|
' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. |
|
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
|
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
|
'print_header_format' |
|
=> ' <b>'.&mt('Print header format').'</b><br />' |
|
.&mt('Substitutions:<br />[_1]: student name, [_2]: course id, [_3]: assignment note. Numbers after the <tt>%</tt> limit the field size.','"<tt>%n</tt>"','"<tt>%c</tt>"','"<tt>%a</tt>"'), |
|
'default_enrollment_start_date' => '<b>'.&mt('Default beginning date for student access.').'</b>', |
|
'default_enrollment_end_date' => '<b>'.&mt('Default ending date for student access.').'</b>', |
|
'nothideprivileged' => '<b>'.&mt('Privileged users that should not be hidden on staff listings').'</b><br />' |
|
.'("<tt>'.&mt('user:domain,user:domain,*:domain').'</tt>")', |
|
'languages' => '<b>'.&mt('Languages used').'</b>', |
|
'disable_receipt_display' |
|
=> '<b>'.&mt('Disable display of problem receipts').'</b><br />'. |
|
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
|
'task_messages' |
|
=> '<b>'.&mt('Send message to student when clicking Done on Tasks').'</b><br /> ('.&mt('[_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>"').')', |
|
'disablesigfigs' |
|
=> '<b>'.&mt('Disable checking of Significant Figures').'</b><br />'. |
|
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
|
'disableexampointprint' |
|
=> '<b>'.&mt('Disable automatically printing point values onto exams.').'</b><br />'. |
|
' ('.&mt('"[_1]" to disable, anything else if not','<tt>yes</tt>').')', |
|
'externalsyllabus' |
|
=> '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>', |
|
'tthoptions' |
|
=> '<b>'.&mt('Default set of options to pass to tth/m when converting TeX').'</b>', |
|
|
|
'texengine' |
|
=> '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />' |
|
.'('.&mt("[_1], [_2] (Convert to Images), [_3] (TeX to HTML), or blank for student's preference",'"<tt>jsMath</tt>"','"<tt>mimetex</tt>"','"<tt>tth</tt>"').')', |
|
'timezone' |
|
=> '<b>'.&mt('Timezone in which the course takes place').'</b>', |
|
|
|
'suppress_embed_prompt' |
|
=> '<b>'.&mt('Suppress prompt to upload items referenced in a web page being uploaded to portfolio, when current role is student.').'</b><br />'. |
|
' ('.&mt('[_1] to suppress, anything else to not suppress','"<tt>yes</tt>"').')', |
|
'hidefromcat' |
|
=> '<b>'.&mt('Exclude from course catalog').'</b><br />'. |
|
' ('.&mt('[_1] to exclude, anything else to include - included if assigned an institutional code, or manually catagorized','"<tt>yes</tt>"').')', |
|
'categories' |
|
=> '<b>'.&mt('Categorize course').'</b> <a href="javascript:catsbrowser()">'. |
|
&mt('Display Categories').'</a>', |
|
'datelocale' |
|
=> '<b>'.&mt('Locale used for course calendar').'</b>', |
|
'rolenames' |
|
=> '<b>'.&mt('Replacement titles for standard course roles').'</b><br />'. |
|
'('.&mt('To replace the standard title for a course role, enter the title you wish to use, otherwise leave blank.').')', |
|
); |
|
|
|
|
|
# ---------------------------------------------------------------- |
|
# Begin: New Version with Parameter Categories |
|
|
|
sub parameter_row { |
|
# Create parameter row for course environment screen |
|
|
|
my ($parameter, $description) = @_; |
|
|
|
# Start Parameter Row |
|
my $output = &Apache::loncommon::start_data_table_row(); |
|
|
|
# Column 1/3: Descriptive text of current parameter |
|
$output .= '<td>'.$description.'</td>'; |
|
|
|
# Column 2/3: Input field (Sometimes special field(s), depending on parameter) |
|
|
|
# onchange is javascript to automatically check the 'Set' button. |
|
my $onchange = 'onFocus="javascript:window.document.forms' |
|
."['envform'].elements['".$parameter."_setparmval']" |
|
.'.checked=true;"'; |
|
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
|
$output .= '<td>'. |
|
&Apache::lonhtmlcommon::date_setter('envform', |
|
$parameter.'_value', |
|
$values{$parameter}, |
|
$onchange). |
|
'</td>'; |
|
} elsif ($parameter eq 'timezone') { |
|
my $includeempty = 1; |
|
my $timezone = &Apache::lonlocal::gettimezone(); |
|
$output .= '<td>'. |
|
&Apache::loncommon::select_timezone($parameter.'_value', |
|
$timezone, |
|
$onchange,$includeempty).'</td>'; |
|
} elsif ($parameter eq 'datelocale') { |
|
my $includeempty = 1; |
|
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
|
my $currdatelocale; |
|
if (ref($locale_obj)) { |
|
$currdatelocale = $locale_obj->id(); |
|
} |
|
$output .= '<td>'. |
|
&Apache::loncommon::select_datelocale($parameter.'_value', |
|
$currdatelocale, |
|
$onchange,$includeempty).'</td>'; |
|
} elsif ($parameter eq 'rolenames') { |
|
$output.= '<td><table>'; |
|
foreach my $role ('cc','in','ta','ep','ad','st') { |
|
my $onchange = 'onFocus="javascript:window.document.forms'. |
|
"['envform'].elements['". |
|
$parameter.'_'.$role."_setparmval']". |
|
'.checked=true;"'; |
|
$output.= '<tr><td>'.&Apache::lonnet::plaintext($role,$crstype,undef,1). |
|
'</td><td>'. |
|
&Apache::lonhtmlcommon::textbox($parameter.'_'.$role.'_value', |
|
$values{$role.'.plaintext'}, |
|
15,$onchange). |
|
'</td></tr>'; |
|
} |
|
$output .= '</table></td><td><table>'; |
|
foreach my $role ('cc','in','ta','ep','ad','st') { |
|
$output .= '<tr><td>'.&Apache::lonhtmlcommon::checkbox($parameter.'_'.$role.'_setparmval'). |
|
'</td></tr>'; |
|
} |
|
$output .= '</table></td>'; |
|
} elsif ($parameter eq 'categories') { |
|
my $catdisplay; |
|
if ($values{'categories'} ne '') { |
|
my @curritems = split(/\&/,$values{'categories'}); |
|
foreach my $item (@curritems) { |
|
my ($name,$parent,$pos) = split(/:/,$item); |
|
$catdisplay .= &unescape($name).'&'; |
|
} |
|
$catdisplay =~ s/\&$//; |
|
} |
|
$output .= '<td>'. |
|
'<input type="hidden" name="categories_value" value="'. |
|
$values{'categories'}.'" />'. |
|
'<input type="textbox" name="categories_display" value="'. |
|
$catdisplay.'" readonly="readonly" size="40" /></td>'; |
|
} else { # Display default textbox in all other cases |
|
$output .= '<td>' |
|
.&Apache::lonhtmlcommon::textbox($parameter.'_value', |
|
$values{$parameter}, |
|
40, |
|
$onchange) |
|
.'</td>'; |
|
} |
|
|
|
# Column 3/3: Check Box (in most cases) |
|
unless ($parameter eq 'rolenames') { |
|
$output .= '<td>' |
|
.&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval') |
|
.'</td>'; |
|
} |
|
|
|
# End Parameter Row |
|
$output .= &Apache::loncommon::end_data_table_row(); |
|
|
|
return $output; |
|
} # End sub parameter_row |
|
|
|
|
|
# Parameter Category Names |
|
my %parm_cat_names = &Apache::lonlocal::texthash ( |
|
'cat_0' => 'Parameter Category Zero', |
|
'cat_1' => 'Parameter Category One', |
|
'cat_2' => 'Parameter Category Two', |
|
'cat_3' => 'Parameter Category Three', |
|
'cat_4' => 'Parameter Category Four', |
|
'cat_5' => 'Parameter Category Five', |
|
'cat_6' => 'Parameter Category Six', |
|
'cat_7' => 'Parameter Category Seven', |
|
'cat_can' => 'Parameter Category Can', |
|
'cat_custom' => 'Parameter Category Custom', |
|
); |
|
|
|
# Display Order of Parameter Categories |
|
my @Display_Order = ( |
|
'cat_0', |
|
'cat_1', |
|
'cat_2', |
|
'cat_3', |
|
'cat_4', |
|
'cat_5', |
|
'cat_6', |
|
'cat_7', |
|
'cat_can', |
|
'cat_custom', |
|
); |
|
|
|
# Link Parameter Categories with Parameters |
|
# Order of parameters is display order |
|
my %parm_cat_parms = ( |
|
'cat_0' => [ |
|
'url', |
|
'description', |
|
'courseid', |
|
'cloners' |
|
], |
|
'cat_1' => [ |
|
'grading', |
|
'externalsyllabus', |
|
'default_xml_style', |
|
'pageseparators' |
|
], |
|
'cat_2' => [ |
|
'question.email', |
|
'question.email.text', |
|
'comment.email', |
|
'comment.email.text', |
|
'policy.email', |
|
'policy.email.text', |
|
], |
|
'cat_3' => [ |
|
'student_classlist_view', |
|
'student_classlist_opt_in', |
|
'student_classlist_portfiles', |
|
'plc.roles.denied', |
|
'plc.users.denied', |
|
'pch.roles.denied', |
|
'pch.users.denied', |
|
'allow_limited_html_in_feedback', |
|
'allow_discussion_post_editing', |
|
], |
|
'cat_4' => [ |
|
'languages', |
|
'timezone', |
|
'datelocale', |
|
'rolenames', |
|
'nothideprivileged', |
|
'rndseed', |
|
'receiptalg', |
|
'problem_stream_switch', |
|
'suppress_tries', |
|
'suppress_embed_prompt', |
|
'default_paper_size', |
|
'print_header_format', |
|
'disable_receipt_display', |
|
], |
|
'cat_5' => [ |
|
'spreadsheet_default_classcalc', |
|
'spreadsheet_default_studentcalc', |
|
'spreadsheet_default_assesscalc', |
|
'hideemptyrows', |
|
], |
|
'cat_6' => [ |
|
'default_enrollment_start_date', |
|
'default_enrollment_end_date', |
|
], |
|
'cat_7' => [ |
|
'tthoptions', |
|
'texengine', |
|
'disablesigfigs', |
|
'disableexampointprint', |
|
'task_messages', |
|
'task_grading', |
|
], |
|
); |
|
|
|
# Add special parameters depending on special context to parameter categories hash |
|
my @can_cats; |
|
(my $can_toggle_cat,$can_categorize) = &can_modify_catsettings($dom); |
|
if ($can_toggle_cat) { |
|
push(@can_cats,'hidefromcat'); |
|
} |
|
if ($can_categorize) { |
|
push(@can_cats,'categories'); |
|
} |
|
$parm_cat_parms{'cat_can'} = [@can_cats]; |
|
|
|
# Add custom parameters to custom parameter category |
|
my @custom_cats; |
|
foreach my $parameter (sort(keys(%values))) { |
|
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./) || |
|
($parameter =~ m/^selfenroll_/) || ($parameter =~ /_selfenroll$/) |
|
|| ($parameter eq 'type') || |
|
($parameter =~ m/^(cc|in|ta|ep|ad|st)\.plaintext$/)) { |
|
if (! $descriptions{$parameter}) { |
|
$descriptions{$parameter}=$parameter; |
|
push(@custom_cats,$parameter); |
|
} |
|
} |
|
} |
|
$parm_cat_parms{'cat_custom'} = [@custom_cats]; |
|
|
|
|
|
# Display Course Parameter Overview |
|
# Provide hyperlinks to detailed parameter settings |
|
$output_SB .= '<a name="parmlist" />' |
|
.'<div class="LC_ContentBoxSpecial">' |
|
.'<h2 class="LC_hcell">'.&mt('Course Parameter Overview').'</h2>' |
|
.'<ul>'; |
|
foreach my $catkey (@Display_Order) { |
|
if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories |
|
$output_SB .= '<li>' |
|
.'<a href="#parmlist_'.$catkey.'">' |
|
.$parm_cat_names{$catkey} |
|
.'</a>' |
|
.'</li>'; |
|
} |
|
$output_SB .= '</ul>' |
|
.'</div>'; |
|
|
|
|
|
my $buttons='<div align="right">' |
|
.'<input type="submit" name="crsenv" value="'.&mt('Save All').'" />' |
|
.'<br /><a href="#parmlist">'.&mt('Back to Course Parameter Overview').'</a>' |
|
.'</div>'; |
|
|
|
# Display all Parameters grouped by categories |
|
$output_SB .= '<h2>'.&mt('Course Parameters').'</h2>'; |
|
|
|
foreach my $catkey (@Display_Order) { |
|
if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories |
|
$output_SB .= &Apache::loncommon::start_data_table(); |
|
$output_SB .= &Apache::loncommon::start_data_table_empty_row() |
|
.'<td colspan="3">' |
|
.'<a name="parmlist_'.$catkey.'" />' |
|
.'<h3>'.$parm_cat_names{$catkey}.'</h3>' |
|
.'</td>' |
|
.&Apache::loncommon::end_data_table_empty_row |
|
.&Apache::loncommon::start_data_table_header_row() |
|
.'<th>'.$lt{'par'}.'</th><th>'.$lt{'val'}.'</th><th>'.$lt{'set'}.'</th>' |
|
.&Apache::loncommon::end_data_table_header_row(); |
|
|
|
foreach my $parameter (@{$parm_cat_parms{$catkey}}) { |
|
my $description = $descriptions{$parameter}; |
|
$output_SB .= ¶meter_row($parameter, $description); |
|
} |
|
# Add special row to custom category |
|
# Offer possibilty to create a new environment variable |
|
if ($catkey eq 'cat_custom') { |
|
my $onchange = 'onFocus="javascript:window.document.forms' |
|
.'[\'envform\'].elements[\'newp_setparmval\']' |
|
.'.checked=true;"'; |
|
$output_SB .= &Apache::loncommon::start_data_table_row() |
|
.'<td>' |
|
.'<i>'.&mt('Create New Environment Variable').'</i><br />' |
|
.'<input type="text" size="40" name="newp_name" '.$onchange.' />' |
|
.'</td><td>' |
|
.'<input type="text" size="40" name="newp_value" '.$onchange.' />' |
|
.'</td><td>' |
|
.'<input type="checkbox" name="newp_setparmval" /></td>' |
|
.&Apache::loncommon::end_data_table_row(); |
|
} |
|
# Add buttons row at end of each category |
|
$output_SB .= &Apache::loncommon::start_data_table_empty_row() |
|
.'<td colspan="3">' |
|
.$buttons |
|
.'</td>' |
|
.&Apache::loncommon::end_data_table_empty_row; |
|
|
|
$output_SB .= &Apache::loncommon::end_data_table() |
|
. '<br />'; |
|
} |
|
|
|
# End: New Version with Parameter Categories |
|
# ---------------------------------------------------------------- |
|
|
|
|
|
} |
|
|
|
my ($jscript,$categorize_js); |
|
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset'); |
|
if ($can_categorize) { |
|
$categorize_js = <<ENDSCRIPT; |
|
function catsbrowser() { |
|
var catswin = null; |
|
var url = '/adm/parmset?action=categorizecourse'; |
|
if (!catswin || catswin.closed) { |
|
catswin=window.open(url,'categorieswin','height=480,width=600,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); |
|
} else { |
|
catswin.focus(); |
|
} |
|
} |
|
ENDSCRIPT |
|
} |
|
$jscript = '<script type="text/javascript" language="Javascript">'."\n". |
|
$browse_js."\n".$categorize_js."\n".'</script>'; |
|
my $start_page = |
|
&Apache::loncommon::start_page('Set Course Environment', |
|
$jscript); |
|
my $end_page = |
|
&Apache::loncommon::end_page(); |
|
$r->print(<<ENDENV); |
|
$start_page |
|
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
|
$setoutput |
|
$output_SB |
|
</form> |
|
$end_page |
|
ENDENV |
|
} |
|
|
|
sub can_modify_catsettings { |
|
my ($dom) = @_; |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$dom); |
|
my ($can_toggle_cat,$can_categorize); |
|
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
|
if ($domconf{'coursecategories'}{'togglecats'} eq 'crs') { |
|
$can_toggle_cat = 1; |
|
} |
|
if ($domconf{'coursecategories'}{'categorize'} eq 'crs') { |
|
$can_categorize = 1; |
|
} |
|
} |
|
return ($can_toggle_cat,$can_categorize); |
|
} |
|
|
|
sub assign_course_categories { |
|
my ($r) = @_; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $hascats = 0; |
|
my $cathash; |
|
my %domconf = &Apache::lonnet::get_dom('configuration',['coursecategories'],$cdom); |
|
if (ref($domconf{'coursecategories'}) eq 'HASH') { |
|
$cathash = $domconf{'coursecategories'}{'cats'}; |
|
if (ref($cathash) eq 'HASH') { |
|
$hascats = 1; |
|
} |
|
} |
|
my $catwin_js; |
|
if ($hascats) { |
|
my $alert = &mt('Use \"Save\" in the main window to save course categories'); |
|
$catwin_js = <<ENDSCRIPT; |
|
<script type="text/javascript"> |
|
|
|
function updateCategories() { |
|
var newcategories = ''; |
|
var unescapedcats = ''; |
|
if (document.chgcats.usecategory.length) { |
|
for (var i=0; i<document.chgcats.usecategory.length; i++) { |
|
if (document.chgcats.usecategory[i].checked == true) { |
|
newcategories = newcategories + document.chgcats.usecategory[i].value + '&'; |
|
unescapedcats = unescapedcats + document.chgcats.catname[i].value + ' & '; |
|
} |
|
} |
|
if (newcategories.length > 0) { |
|
newcategories = newcategories.slice(0,-1); |
|
} |
|
if (unescapedcats.length > 0) { |
|
unescapedcats = unescapedcats.slice(0,-3); |
|
} |
|
} else { |
|
if (document.chgcats.usecategory.checked == true) { |
|
newcategories = document.chgcats.usecategory.value; |
|
unescapedcats = document.chgcats.catname.value; |
|
} |
|
} |
|
opener.document.envform.categories_value.value = newcategories; |
|
opener.document.envform.categories_display.value = unescapedcats; |
|
opener.document.envform.categories_setparmval.checked = true; |
|
alert("$alert"); |
|
self.close(); |
|
return; |
|
} |
|
|
|
</script> |
|
ENDSCRIPT |
|
} else { |
|
my $onload; |
|
} |
|
my $start_page = |
|
&Apache::loncommon::start_page('Course Categories',$catwin_js, |
|
{'only_body' => 1,}); |
|
my $end_page = &Apache::loncommon::end_page(); |
|
my $categoriesform = '<h3>'.&mt('Categorize Course').'</h3>'; |
|
if ($hascats) { |
|
my %currsettings = |
|
&Apache::lonnet::get('environment',['hidefromcat','categories'],$cdom,$cnum); |
|
$categoriesform .= &mt('Assign one or more categories to this course.').'<br /><br />'. |
|
'<form name="chgcats" action="/adm/parmset" method="post">'."\n" |
|
.&Apache::loncommon::assign_categories_table($cathash, |
|
$currsettings{'categories'})."\n" |
|
.'<br /><input type="button" name="changes" value="' |
|
.&mt('Copy to main window').'" ' |
|
.'onclick="javascript:updateCategories()" /></form><br />'; |
|
} else { |
|
$categoriesform .= &mt('No categories defined for this domain'); |
|
} |
|
$r->print($start_page.$categoriesform.$end_page); |
|
return; |
|
} |
|
|
################################################## |
################################################## |
# Overview mode |
# Overview mode |
################################################## |
################################################## |
Line 2540 sub listdata {
|
Line 3374 sub listdata {
|
# |
# |
# Ready to print |
# Ready to print |
# |
# |
my $parmitem = &standard_parameter_names($name); |
|
|
|
$r->print(&tablestart(). |
$r->print(&tablestart(). |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><b>'.&mt($parmitem). |
'<td><b>'.&standard_parameter_names($name). |
'</b></td><td><input type="checkbox" name="del_'. |
'</b></td><td><input type="checkbox" name="del_'. |
$thiskey.'" /></td><td>'); |
$thiskey.'" /></td><td>'); |
$foundkeys++; |
$foundkeys++; |
Line 2694 sub newoverview {
|
Line 3526 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'}; |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
|
text=>"Overview Mode"}); |
my $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $start_page = &Apache::loncommon::start_page('Set Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
Line 2854 sub overview {
|
Line 3688 sub overview {
|
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'}; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
|
text=>"Overview Mode"}); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $start_page=&Apache::loncommon::start_page('Modify Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview'); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
Line 2888 sub clean_parameters {
|
Line 3724 sub clean_parameters {
|
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'}; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=cleanparameters', |
|
text=>"Clean Parameters"}); |
my $start_page=&Apache::loncommon::start_page('Clean Parameters'); |
my $start_page=&Apache::loncommon::start_page('Clean Parameters'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Clean'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Clean'); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
Line 2931 ENDOVER
|
Line 3769 ENDOVER
|
$display_value = |
$display_value = |
&Apache::lonlocal::locallocaltime($display_value); |
&Apache::lonlocal::locallocaltime($display_value); |
} |
} |
my $parmitem = &standard_parameter_names($data{'parameter_name'}); |
|
$parmitem = &mt($parmitem); |
|
$r->print(&mt('Parameter: "[_1]" with value: "[_2]"', |
$r->print(&mt('Parameter: "[_1]" with value: "[_2]"', |
$parmitem,$resourcedata->{$thiskey})); |
&standard_parameter_names($data{'parameter_name'}), |
|
$resourcedata->{$thiskey})); |
$r->print('<br />'); |
$r->print('<br />'); |
if ($data{'scope_type'} eq 'all') { |
if ($data{'scope_type'} eq 'all') { |
$r->print(&mt('All users')); |
$r->print(&mt('All users')); |
Line 2972 sub date_shift_one {
|
Line 3809 sub date_shift_one {
|
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'}; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
|
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(<<ENDOVER); |
$r->print(<<ENDOVER); |
Line 2997 sub date_shift_two {
|
Line 3836 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'}; |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
|
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(<<ENDOVER); |
$r->print(<<ENDOVER); |
Line 3051 sub parse_key {
|
Line 3892 sub parse_key {
|
return %data; |
return %data; |
} |
} |
|
|
|
|
|
|
sub extract_cloners { |
sub extract_cloners { |
my ($clonelist,$allowclone) = @_; |
my ($clonelist,$allowclone) = @_; |
if ($clonelist =~ /,/) { |
if ($clonelist =~ /,/) { |
Line 3166 sub change_clone {
|
Line 4009 sub change_clone {
|
} |
} |
|
|
|
|
|
|
sub header { |
sub header { |
return &Apache::loncommon::start_page('Parameter Manager'); |
return &Apache::loncommon::start_page('Parameter Manager'); |
} |
} |
|
|
|
|
|
|
sub print_main_menu { |
sub print_main_menu { |
my ($r,$parm_permission)=@_; |
my ($r,$parm_permission)=@_; |
# |
# |
|
$r->print(&header()); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Manager')); |
$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 3183 ENDMAINFORMHEAD
|
Line 4031 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 @menu = |
my @menu = |
( { divider=>'Settings for Your Course', |
( { categorytitle=>'Settings for this Course', |
}, |
items => [ |
{ text => 'Edit course configuration', |
{ linktext => 'Course Environment', |
url => '/adm/courseprefs?origin=params', |
url => '/adm/parmset?action=crsenv', |
permission => $parm_permission, |
permission => $parm_permission, |
help => 'Course_Environment', |
linktitle =>'Edit environment settings for this course.' , |
}, |
icon => 'preferences-desktop-remote-desktop.png' , |
{ text => 'Set Portfolio Metadata', |
#help => 'Course_Environment', |
action => 'setrestrictmeta', |
}, |
permission => $parm_permission, |
{ linktext => 'Portfolio Metadata', |
}, |
url => '/adm/parmset?action=setrestrictmeta', |
{ text => 'Manage Course Slots', |
permission => $parm_permission, |
url => '/adm/slotrequest?command=showslots', |
linktitle => 'Restrict metadata for this course.' , |
permission => $vgr, |
icon =>'contact-new.png' , |
}, |
}, |
{ text => 'Reset Student Access Times', |
{ linktext => 'Manage Course Slots', |
url => '/adm/helper/resettimes.helper', |
url => '/adm/slotrequest?command=showslots', |
permission => $mgr, |
permission => $vgr, |
}, |
linktitle =>'Manage slots for this course.' , |
|
icon => 'format-justify-fill.png' , |
{ text => 'Set Parameter Setting Default Actions', |
}, |
action => 'setdefaults', |
{ linktext => 'Reset Student Access Times', |
permission => $parm_permission, |
url => '/adm/helper/resettimes.helper', |
}, |
permission => $mgr, |
{ divider => 'New and Existing Parameter Settings for Your Resources', |
linktitle =>'Reset access times for folders/maps, resources or the course.' , |
}, |
icon => 'start-here.png' , |
{ text => 'Set/Modify Resource Parameters - Helper Mode', |
}, |
url => '/adm/helper/parameter.helper', |
|
permission => $parm_permission, |
{ linktext => 'Set Parameter Setting Default Actions', |
help => 'Parameter_Helper', |
url => '/adm/parmset?action=setdefaults', |
}, |
permission => $parm_permission, |
{ text => 'Set/Modify Resource Parameters - Overview Mode', |
linktitle =>'Set default actions for parameters.' , |
action => 'newoverview', |
icon => 'folder-new.png' , |
permission => $parm_permission, |
}]}, |
help => 'Parameter_Overview', |
{ categorytitle => 'New and Existing Parameter Settings for Resources', |
}, |
items => [ |
{ text => 'Set/Modify Resource Parameters - Table Mode', |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
action => 'settable', |
url => '/adm/helper/parameter.helper', |
permission => $parm_permission, |
permission => $parm_permission, |
help => 'Table_Mode', |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
}, |
icon => 'dialog-information.png' , |
{ divider => 'Existing Parameter Settings for Your Resources', |
#help => 'Parameter_Helper', |
}, |
}, |
{ text => 'Modify Resource Parameters - Overview Mode', |
{ linktext => 'Edit Resource Parameters - Overview Mode', |
action => 'setoverview', |
url => '/adm/parmset?action=newoverview', |
permission => $parm_permission, |
permission => $parm_permission, |
help => 'Parameter_Overview', |
linktitle =>'Set/Modify resource parameters in overview mode.' , |
}, |
icon => 'edit-find.png' , |
{ text => 'Parameter Change Log and Course Blog Posting/User Notification', |
#help => 'Parameter_Overview', |
action => 'parameterchangelog', |
}, |
permission => $parm_permission, |
{ linktext => 'Edit Resource Parameters - Table Mode', |
}, |
url => '/adm/parmset?action=settable', |
|
permission => $parm_permission, |
|
linktitle =>'Set/Modify resource parameters in table mode.' , |
|
icon => 'edit-copy.png' , |
|
#help => 'Table_Mode', |
|
}]}, |
|
{ categorytitle => 'Existing Parameter Settings for Resources', |
|
items => [ |
|
{ linktext => 'Modify Resource Parameters - Overview Mode', |
|
url => '/adm/parmset?action=setoverview', |
|
permission => $parm_permission, |
|
linktitle =>'Set/Modify existing resource parameters in overview mode.' , |
|
icon => 'preferences-desktop-wallpaper.png' , |
|
#help => 'Parameter_Overview', |
|
}, |
|
{ linktext => 'Change Log', |
|
url => '/adm/parmset?action=parameterchangelog', |
|
permission => $parm_permission, |
|
linktitle =>'View parameter and course blog posting/user notification change log.' , |
|
icon => 'emblem-system.png' , |
|
}]} |
); |
); |
my $menu_html = ''; |
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu)); |
foreach my $menu_item (@menu) { |
|
if ($menu_item->{'divider'}) { |
|
$menu_html .= '<h3>'.&mt($menu_item->{'divider'}).'</h3>'; |
|
next; |
|
} |
|
next if (! $menu_item->{'permission'}); |
|
$menu_html.='<p>'; |
|
$menu_html.='<span class="LC_parm_menu_item">'; |
|
if (exists($menu_item->{'url'})) { |
|
$menu_html.=qq{<a href="$menu_item->{'url'}">}; |
|
} else { |
|
$menu_html.= |
|
qq{<a href="/adm/parmset?action=$menu_item->{'action'}">}; |
|
} |
|
$menu_html.= &mt($menu_item->{'text'}).'</a></span>'; |
|
if (exists($menu_item->{'help'})) { |
|
$menu_html.= |
|
&Apache::loncommon::help_open_topic($menu_item->{'help'}); |
|
} |
|
$menu_html.='</p>'.$/; |
|
} |
|
$r->print($menu_html); |
|
return; |
return; |
} |
} |
### Set portfolio metadata |
|
|
|
|
|
sub output_row { |
sub output_row { |
my ($r, $field_name, $field_text, $added_flag) = @_; |
my ($r, $field_name, $field_text, $added_flag) = @_; |
my $output; |
my $output; |
Line 3298 sub output_row {
|
Line 4147 sub output_row {
|
my $multiple_checked; |
my $multiple_checked; |
my $single_checked; |
my $single_checked; |
if ($options =~ m/onlyone/) { |
if ($options =~ m/onlyone/) { |
$multiple_checked = ""; |
$multiple_checked = ''; |
$single_checked = ' checked="checked"'; |
$single_checked = ' checked="checked"'; |
} else { |
} else { |
$multiple_checked = ' checked="checked"'; |
$multiple_checked = ' checked="checked"'; |
$single_checked = ""; |
$single_checked = ''; |
} |
} |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
<input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked.' />'. |
<input type="radio" name="'.$field_name.'_onlyone" value="multiple"'.$multiple_checked .' /> |
&mt('Student may select multiple choices from list').'</span></td>'; |
'.&mt('Student may select multiple choices from list').'</span></td>'; |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= &Apache::loncommon::continue_data_table_row(); |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
$output .= '<td>'.(' ' x 10).'<span class="LC_metadata"> |
<input type="radio" name="'.$field_name.'_onlyone" value="single"'.$single_checked.' />'. |
<input type="radio" name="'.$field_name.'_onlyone" value="single"'.$single_checked.' /> |
&mt('Student may select only one choice from list').'</span></td>'; |
'.&mt('Student may select only one choice from list').'</span></td>'; |
$output .= &Apache::loncommon::end_data_table_row(); |
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
return ($output); |
return ($output); |
} |
} |
|
|
|
|
|
|
sub order_meta_fields { |
sub order_meta_fields { |
my ($r)=@_; |
my ($r)=@_; |
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'}; |
$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', |
|
text=>"Add Metadata Field"}); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"/adm/parmset?action=setrestrictmeta", |
({href=>"/adm/parmset?action=setrestrictmeta", |
text=>"Restrict Metadata"}, |
text=>"Restrict Metadata"}, |
Line 3399 sub order_meta_fields {
|
Line 4253 sub order_meta_fields {
|
$r->print('</table>'); |
$r->print('</table>'); |
return 'ok'; |
return 'ok'; |
} |
} |
|
|
|
|
sub continue { |
sub continue { |
my $output; |
my $output; |
$output .= '<form action="" method="post">'; |
$output .= '<form action="" method="post">'; |
Line 3406 sub continue {
|
Line 4262 sub continue {
|
$output .= '<input type="submit" value="Continue" />'; |
$output .= '<input type="submit" value="Continue" />'; |
return ($output); |
return ($output); |
} |
} |
|
|
|
|
sub addmetafield { |
sub addmetafield { |
my ($r)=@_; |
my ($r)=@_; |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
|
text=>"Add Metadata Field"}); |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
$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'}; |
Line 3452 sub addmetafield {
|
Line 4312 sub addmetafield {
|
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
|
|
|
|
|
|
sub setrestrictmeta { |
sub setrestrictmeta { |
my ($r)=@_; |
my ($r)=@_; |
my $next_meta; |
my $next_meta; |
my $output; |
my $output; |
my $item_num; |
my $item_num; |
my $put_result; |
my $put_result; |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta', |
|
text=>"Restrict Metadata"}); |
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$r->print(&Apache::loncommon::start_page('Restrict Metadata')); |
$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'}; |
Line 3535 ENDenv
|
Line 4400 ENDenv
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return 'ok'; |
return 'ok'; |
} |
} |
################################################## |
|
|
|
|
|
sub get_added_meta_fieldnames { |
sub get_added_meta_fieldnames { |
my ($cid) = @_; |
my ($cid) = @_; |
my %fields; |
my %fields; |
Line 3548 sub get_added_meta_fieldnames {
|
Line 4415 sub get_added_meta_fieldnames {
|
} |
} |
return \%fields; |
return \%fields; |
} |
} |
|
|
|
|
|
|
sub get_deleted_meta_fieldnames { |
sub get_deleted_meta_fieldnames { |
my ($cid) = @_; |
my ($cid) = @_; |
my %fields; |
my %fields; |
Line 3565 sub get_deleted_meta_fieldnames {
|
Line 4435 sub get_deleted_meta_fieldnames {
|
sub defaultsetter { |
sub defaultsetter { |
my ($r) = @_; |
my ($r) = @_; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
|
text=>"Set Defaults"}); |
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'); |
Line 3703 ENDINPUTDATE
|
Line 4575 ENDINPUTDATE
|
} elsif ($defkeytype{$tempkey} eq 'string_yesno') { |
} elsif ($defkeytype{$tempkey} eq 'string_yesno') { |
my $yeschecked=''; |
my $yeschecked=''; |
my $nochecked=''; |
my $nochecked=''; |
if (&rulescache($tempkey.'_value') eq 'yes') { $yeschecked=' checked="checked"'; } |
if (&rulescache($tempkey.'_value') eq 'yes') { $yeschecked='checked="checked"'; } |
if (&rulescache($tempkey.'_value') eq 'no') { $nochecked=' checked="checked"'; } |
if (&rulescache($tempkey.'_value') eq 'no') { $nochecked='checked="checked"'; } |
|
|
$r->print(<<ENDYESNO); |
$r->print(<<ENDYESNO); |
<label><input type="radio" name="$tempkey\_value" value="yes"$yeschecked /> $lt{'yes'}</label><br /> |
<label><input type="radio" name="$tempkey\_value" value="yes" $yeschecked /> $lt{'yes'}</label><br /> |
<label><input type="radio" name="$tempkey\_value" value="no"$nochecked /> $lt{'no'}</label> |
<label><input type="radio" name="$tempkey\_value" value="no" $nochecked /> $lt{'no'}</label> |
ENDYESNO |
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').'" />'); |
Line 3761 sub components {
|
Line 4633 sub components {
|
} |
} |
|
|
my %standard_parms; |
my %standard_parms; |
|
|
|
|
sub load_parameter_names { |
sub load_parameter_names { |
open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab"); |
open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab"); |
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
Line 3775 sub load_parameter_names {
|
Line 4649 sub load_parameter_names {
|
close($config); |
close($config); |
$standard_parms{'int_pos'} = 'Positive Integer'; |
$standard_parms{'int_pos'} = 'Positive Integer'; |
$standard_parms{'int_zero_pos'} = 'Positive Integer or Zero'; |
$standard_parms{'int_zero_pos'} = 'Positive Integer or Zero'; |
|
%standard_parms=&Apache::lonlocal::texthash(%standard_parms); |
} |
} |
|
|
sub standard_parameter_names { |
sub standard_parameter_names { |
Line 3789 sub standard_parameter_names {
|
Line 4664 sub standard_parameter_names {
|
} |
} |
} |
} |
|
|
# |
|
# Parameter Change Log |
|
# |
|
|
|
|
|
sub parm_change_log { |
sub parm_change_log { |
my ($r)=@_; |
my ($r)=@_; |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Parameter Change Log"}); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log')); |
$r->print(&Apache::loncommon::start_page('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log')); |
|
|
Line 3888 sub parm_change_log {
|
Line 4762 sub parm_change_log {
|
} else { |
} else { |
$makenewrow=1; |
$makenewrow=1; |
} |
} |
my $parmitem = &standard_parameter_names($parmname); |
|
$output .='<td>'.$realm.'</td><td>'.$section.'</td><td>'. |
$output .='<td>'.$realm.'</td><td>'.$section.'</td><td>'. |
&mt($parmitem).'</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}{'delflag'}) { |
if ($parmlog{$id}{'delflag'}) { |
$output .= &mt('Deleted'); |
$output .= &mt('Deleted'); |
} else { |
} else { |
if ($typeflag) { |
if ($typeflag) { |
my $parmitem = &standard_parameter_names($value); |
$output .= &mt('Type: [_1]',&standard_parameter_names($value)); |
$parmitem = &mt($parmitem); |
|
$output .= &mt('Type: [_1]',$parmitem); |
|
} else { |
} else { |
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what), |
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what), |
$uname,$udom,$issection,$issection,$courseopt); |
$uname,$udom,$issection,$issection,$courseopt); |
Line 3917 sub parm_change_log {
|
Line 4788 sub parm_change_log {
|
} |
} |
$output .= '</td><td>'; |
$output .= '</td><td>'; |
if ($stillactive) { |
if ($stillactive) { |
my $parmitem = &standard_parameter_names($parmname); |
my $title=&mt('Changed [_1]',&standard_parameter_names($parmname)); |
$parmitem = &mt($parmitem); |
my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription, |
my $title=&mt('Changed [_1]',$parmitem); |
|
my $description=&mt('Changed [_1] for [_2] to [_3]', |
|
$parmitem,$realmdescription, |
|
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
if (($uname) && ($udom)) { |
if (($uname) && ($udom)) { |
$output .= |
$output .= |
Line 4051 sub check_for_course_info {
|
Line 4919 sub check_for_course_info {
|
return 0; |
return 0; |
} |
} |
|
|
|
|
sub handler { |
sub handler { |
my $r=shift; |
my $r=shift; |
|
|
&reset_caches(); |
&reset_caches(); |
|
|
if ($r->header_only) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK; |
|
} |
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','state', |
['action','state', |
'pres_marker', |
'pres_marker', |
Line 4074 sub handler {
|
Line 4942 sub handler {
|
text=>"Parameter Manager", |
text=>"Parameter Manager", |
faq=>10, |
faq=>10, |
bug=>'Instructor Interface', |
bug=>'Instructor Interface', |
help => 'Parameter_Manager'}); |
help => |
|
'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 = |
my $parm_permission = |
Line 4084 sub handler {
|
Line 4953 sub handler {
|
my $exists = &check_for_course_info(); |
my $exists = &check_for_course_info(); |
|
|
if ($env{'request.course.id'} && $parm_permission && $exists) { |
if ($env{'request.course.id'} && $parm_permission && $exists) { |
|
|
# Start Page |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
|
|
|
# |
# |
# Main switch on form.action and form.state, as appropriate |
# Main switch on form.action and form.state, as appropriate |
# |
# |
Line 4097 sub handler {
|
Line 4960 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(&Apache::lonhtmlcommon::breadcrumbs('Parameter Manager')); |
|
&print_main_menu($r,$parm_permission); |
&print_main_menu($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'setoverview' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'crsenv') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
&crsenv($r); |
text=>"Overview Mode"}); |
} elsif ($env{'form.action'} eq 'setoverview') { |
&overview($r); |
&overview($r); |
} elsif ($env{'form.action'} eq 'addmetadata' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'addmetadata') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
|
text=>"Add Metadata Field"}); |
|
&addmetafield($r); |
&addmetafield($r); |
} elsif ($env{'form.action'} eq 'ordermetadata' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
|
text=>"Add Metadata Field"}); |
|
&order_meta_fields($r); |
&order_meta_fields($r); |
} elsif ($env{'form.action'} eq 'setrestrictmeta' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta', |
|
text=>"Restrict Metadata"}); |
|
&setrestrictmeta($r); |
&setrestrictmeta($r); |
} elsif ($env{'form.action'} eq 'newoverview' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'newoverview') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
|
text=>"Overview Mode"}); |
|
&newoverview($r); |
&newoverview($r); |
} elsif ($env{'form.action'} eq 'setdefaults' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'setdefaults') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
|
text=>"Set Defaults"}); |
|
&defaultsetter($r); |
&defaultsetter($r); |
} elsif ($env{'form.action'} eq 'settable' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'settable') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Table Mode", |
|
help => 'Course_Setting_Parameters'}); |
|
&assessparms($r); |
&assessparms($r); |
} elsif ($env{'form.action'} eq 'parameterchangelog' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Parameter Change Log"}); |
|
&parm_change_log($r); |
&parm_change_log($r); |
} elsif ($env{'form.action'} eq 'cleanparameters' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=cleanparameters', |
|
text=>"Clean Parameters"}); |
|
&clean_parameters($r); |
&clean_parameters($r); |
} elsif ($env{'form.action'} eq 'dateshift1' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'dateshift1') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
|
text=>"Shifting Dates"}); |
|
&date_shift_one($r); |
&date_shift_one($r); |
} elsif ($env{'form.action'} eq 'dateshift2' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'dateshift2') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'}, |
|
text=>"Shifting Dates"}); |
|
&date_shift_two($r); |
&date_shift_two($r); |
} elsif ($env{'form.action'} eq 'categorizecourse' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'categorizecourse') { |
&assign_course_categories($r); |
&assign_course_categories($r); |
} |
} |
} else { |
} else { |
Line 4172 sub handler {
|
Line 5009 sub handler {
|
1; |
1; |
__END__ |
__END__ |
|
|
|
|