version 1.413, 2008/10/23 14:26:17
|
version 1.433, 2009/02/16 02:09:15
|
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 |
|
|
=cut |
|
|
|
################################################################### |
|
################################################################### |
|
|
|
package Apache::lonparmset; |
|
|
|
use strict; |
|
use Apache::lonnet; |
|
use Apache::Constants qw(:common :http REDIRECT); |
|
use Apache::lonhtmlcommon(); |
|
use Apache::loncommon; |
|
use GDBM_File; |
|
use Apache::lonhomework; |
|
use Apache::lonxml; |
|
use Apache::lonlocal; |
|
use Apache::lonnavmaps; |
|
use Apache::longroup; |
|
use Apache::lonrss; |
|
use LONCAPA qw(:DEFAULT :match); |
|
|
|
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
=pod |
|
|
=item parmval |
=item parmval() |
|
|
Figure out a cascading parameter. |
Figure out a cascading parameter. |
|
|
Line 98 Returns: A list, the first item is the
|
Line 73 Returns: A list, the first item is the
|
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 reset_caches() |
|
|
|
=item cacheparmhash() |
|
|
|
=item parmhash() |
|
|
|
=item symbcache() |
|
|
|
=item preset_defaults() |
|
|
|
=item date_sanity_info() |
|
|
|
=item storeparm() |
|
|
|
Store a parameter by symb |
|
|
|
Takes |
|
- symb |
|
- name of parameter |
|
- level |
|
- new value |
|
- new type |
|
- username |
|
- userdomain |
|
|
|
=item log_parmset() |
|
|
|
=item storeparm_by_symb_inner() |
|
|
|
=item valout() |
|
|
|
Format a value for output. |
|
|
|
Inputs: $value, $type, $editable |
|
|
|
Returns: $value, formatted for output. If $type indicates it is a date, |
|
localtime($value) is returned. |
|
$editable will return an icon to click on |
|
|
|
=item plink() |
|
|
|
Produces a link anchor. |
|
|
|
Inputs: $type,$dis,$value,$marker,$return,$call |
|
|
|
Returns: scalar with html code for a link which will envoke the |
|
javascript function 'pjump'. |
|
|
|
=item page_js() |
|
|
|
=item startpage() |
|
|
|
=item print_row() |
|
|
|
=item print_td() |
|
|
|
=item print_usergroups() |
|
|
|
=item parm_control_group() |
|
|
|
=item extractResourceInformation() : |
|
|
|
Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. |
|
|
|
Input: See list below: |
|
|
|
=item * B<ids> : An array that will contain all of the ids in the course. |
|
|
|
=item * B<typep> : hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>. |
|
|
|
=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<allparts> : hash, part identification->text representation of part, where the text representation is "[Part $part]" |
|
|
|
=item * B<allkeys> : hash, full key to part->display value (what's display value?) |
|
|
|
=item * B<allmaps> : hash, ??? |
|
|
|
=item * B<fcat> : ??? |
|
|
|
=item * B<defp> : hash, ??? |
|
|
|
=item * B<mapp> : ?? |
|
|
|
=item * B<symbp> : hash, id->full sym? |
|
|
|
|
|
|
|
=item isdateparm() |
|
|
|
=item parmmenu() |
|
|
|
=item partmenu() |
|
|
|
=item usermenu() |
|
|
|
=item displaymenu() |
|
|
|
=item mapmenu() |
|
|
|
=item levelmenu() |
|
|
|
=item sectionmenu() |
|
|
|
=item keysplit() |
|
|
|
=item keysinorder() |
|
|
|
=item keysinorder_bytype() |
|
|
|
=item keysindisplayorder() |
|
|
|
=item standardkeyorder() |
|
|
|
=item assessparms() : |
|
|
|
Show assessment data and parameters. This is a large routine that should |
|
be simplified and shortened... someday. |
|
|
|
Inputs: $r |
|
|
|
Returns: nothing |
|
|
|
Variables used (guessed by Jeremy): |
|
|
|
=item * B<pscat>: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. |
|
|
|
=item * B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
|
|
|
=item * B<@catmarker> contains list of all possible parameters including part #s |
|
|
|
=item * B<$fullkeyp> contains the full part/id # for the extraction of proper parameters |
|
|
|
=item * B<$tempkeyp> contains part 0 only (no ids - ie, subparts) |
|
When storing information, store as part 0 |
|
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 tableend() |
|
|
|
=item extractuser() |
|
|
|
=item parse_listdata_key() |
|
|
|
=item listdata() |
|
|
|
=item date_interval_selector() |
|
|
|
=item get_date_interval_from_form() |
|
|
|
=item default_selector() |
|
|
|
=item string_selector() |
|
|
|
=item dateshift() |
|
|
|
=item newoverview() |
|
|
|
=item secgroup_lister() |
|
|
|
=item overview() |
|
|
|
=item clean_parameters() |
|
|
|
=item date_shift_one() |
|
|
|
=item date_shift_two() |
|
|
|
=item parse_key() |
|
|
|
=item check_cloners() : |
|
|
|
Checks if new users included in list of allowed cloners |
|
are valid users. Replaces supplied list with |
|
cleaned list containing only users with valid usernames |
|
and domains. |
|
|
|
Inputs: $clonelist, $oldcloner |
|
where $clonelist is ref to array of requested cloners, |
|
and $oldcloner is ref to array of currently allowed |
|
cloners. |
|
|
|
Returns: string - comma separated list of requested |
|
cloners (username:domain) who do not exist in system. |
|
|
|
=item change_clone() : |
|
|
|
Modifies the list of courses a user can clone (stored |
|
in the user's environment.db file), called when a |
|
change is made to the list of users allowed to clone |
|
a course. |
|
|
|
Inputs: $action,$cloner |
|
where $action is add or drop, and $cloner is identity of |
|
user for whom cloning ability is to be changed in course. |
|
|
|
|
|
=item check_cloners() |
|
|
|
=item change_clone() |
|
|
|
=item header() |
|
|
|
Output html header for page |
|
|
|
=item print_main_menu() |
|
|
|
=item output_row() |
|
|
|
Set portfolio metadata |
|
|
|
=item order_meta_fields() |
|
|
|
=item addmetafield() |
|
|
|
=item setrestrictmeta() |
|
|
|
=item get_added_meta_fieldnames() |
|
|
|
=item get_deleted_meta_fieldnames() |
|
|
|
=item defaultsetter() |
|
|
|
=item components() |
|
|
|
=item load_parameter_names() |
|
|
|
=item parm_change_log() |
|
|
|
=item handler() : |
|
|
|
Main handler. Calls &assessparms and &crsenv subroutines. |
|
|
|
|
|
=back |
|
|
=cut |
=cut |
|
|
################################################## |
################################################################### |
|
################################################################### |
|
|
|
package Apache::lonparmset; |
|
|
|
use strict; |
|
use Apache::lonnet; |
|
use Apache::Constants qw(:common :http REDIRECT); |
|
use Apache::lonhtmlcommon(); |
|
use Apache::loncommon; |
|
use GDBM_File; |
|
use Apache::lonhomework; |
|
use Apache::lonxml; |
|
use Apache::lonlocal; |
|
use Apache::lonnavmaps; |
|
use Apache::longroup; |
|
use Apache::lonrss; |
|
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 302 sub reset_caches {
|
Line 550 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 316 sub preset_defaults {
|
Line 566 sub preset_defaults {
|
} |
} |
} |
} |
|
|
################################################## |
|
|
|
|
|
sub date_sanity_info { |
sub date_sanity_info { |
my $checkdate=shift; |
my $checkdate=shift; |
Line 371 sub storeparm {
|
Line 622 sub storeparm {
|
&storeparm_by_symb(&symbcache($sresid),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,'',$cgroup); |
&storeparm_by_symb(&symbcache($sresid),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,'',$cgroup); |
} |
} |
|
|
# |
|
# Store a parameter by symb |
|
# |
|
# Takes |
|
# - symb |
|
# - name of parameter |
|
# - level |
|
# - new value |
|
# - new type |
|
# - username |
|
# - userdomain |
|
my %recstack; |
my %recstack; |
sub storeparm_by_symb { |
sub storeparm_by_symb { |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$recflag,$cgroup)=@_; |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$recflag,$cgroup)=@_; |
Line 536 sub storeparm_by_symb_inner {
|
Line 776 sub storeparm_by_symb_inner {
|
return ''; |
return ''; |
} |
} |
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item valout |
|
|
|
Format a value for output. |
|
|
|
Inputs: $value, $type, $editable |
|
|
|
Returns: $value, formatted for output. If $type indicates it is a date, |
|
localtime($value) is returned. |
|
$editable will return an icon to click on |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
sub valout { |
sub valout { |
my ($value,$type,$editable)=@_; |
my ($value,$type,$editable)=@_; |
my $result = ''; |
my $result = ''; |
Line 611 sub valout {
|
Line 833 sub valout {
|
return $result; |
return $result; |
} |
} |
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item plink |
|
|
|
Produces a link anchor. |
|
|
|
Inputs: $type,$dis,$value,$marker,$return,$call |
|
|
|
Returns: scalar with html code for a link which will envoke the |
|
javascript function 'pjump'. |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
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 643 sub plink {
|
Line 848 sub plink {
|
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
my ($hour,$min,$sec,$val)=&preset_defaults($parmname); |
unless (defined($winvalue)) { $winvalue=$val; } |
unless (defined($winvalue)) { $winvalue=$val; } |
my $valout = &valout($value,$type,1); |
my $valout = &valout($value,$type,1); |
|
my $unencmarker = $marker; |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
foreach my $item (\$type, \$dis, \$winvalue, \$marker, \$return, \$call, |
\$hour, \$min, \$sec) { |
\$hour, \$min, \$sec) { |
$$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."','" |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
.$marker."','".$return."','".$call."','".$hour."','".$min."','".$sec."'".');">'. |
$valout.'</a></td></tr></table>'; |
$valout.'</a></td></tr></table>'; |
Line 711 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 721 sub startpage {
|
Line 936 sub startpage {
|
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<input type="hidden" value='' name="pres_value" /> |
<input type="hidden" value="" name="pres_value" /> |
<input type="hidden" value='' name="pres_type" /> |
<input type="hidden" value="" name="pres_type" /> |
<input type="hidden" value='' name="pres_marker" /> |
<input type="hidden" value="" name="pres_marker" /> |
<input type="hidden" value='1' name="prevvisit" /> |
<input type="hidden" value="1" name="prevvisit" /> |
ENDHEAD |
ENDHEAD |
} |
} |
|
|
Line 756 sub print_row {
|
Line 971 sub print_row {
|
my $parm=$$display{$which}; |
my $parm=$$display{$which}; |
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
$r->print('<td bgcolor='.$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'); |
if ($automatic) { |
if ($automatic) { |
$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>'; |
$parm.='<span class="LC_warning"><br />'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'</span>'; |
} |
} |
$r->print('<td bgcolor='.$defbgone.'>'.$parm.'</td>'); |
$r->print('<td>'.$parm.'</td>'); |
|
|
my $thismarker=$which; |
my $thismarker=$which; |
$thismarker=~s/^parameter\_//; |
$thismarker=~s/^parameter\_//; |
Line 842 sub print_row {
|
Line 1057 sub print_row {
|
} |
} |
|
|
} # end of $parmlev if/else |
} # end of $parmlev if/else |
$r->print('<td bgcolor="#CCCCFF" align="center">'.$effective_parm.'</td>'); |
$r->print('<td style="background-color:#CCCCFF;" align="center">'.$effective_parm.'</td>'); |
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. |
my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. |
'.'.$$name{$which},$$symbp{$rid}); |
'.'.$$name{$which},$$symbp{$rid}); |
my $sessionvaltype=$typeoutpar[$result]; |
my $sessionvaltype=$typeoutpar[$result]; |
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } |
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } |
$r->print('<td bgcolor="#999999" align="center"><font color="#FFFFFF">'. |
$r->print('<td style="background-color:#999999;" align="center"><font color="#FFFFFF">'. |
&valout($sessionval,$sessionvaltype).' '. |
&valout($sessionval,$sessionvaltype).' '. |
'</font></td>'); |
'</font></td>'); |
} |
} |
Line 859 sub print_row {
|
Line 1074 sub print_row {
|
|
|
sub print_td { |
sub print_td { |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; |
$r->print('<td bgcolor='.(($result==$which)?'"#AAFFAA"':$defbg). |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
' align="center">'); |
';" align="center">'); |
if ($which<11 || $which > 12) { |
if ($which<11 || $which > 12) { |
$r->print(&plink($$typeoutpar[$which], |
$r->print(&plink($$typeoutpar[$which], |
$$display{$value},$$outpar[$which], |
$$display{$value},$$outpar[$which], |
Line 886 sub print_usergroups {
|
Line 1101 sub print_usergroups {
|
my $grp_parm; |
my $grp_parm; |
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if (($coursereply) && ($cgroup ne $resultgroup)) { |
if ($result > 3) { |
if ($result > 3) { |
$bgcolor = '"#AAFFAA"'; |
$bgcolor = '#AAFFAA'; |
$grp_parm = &valout($coursereply,$resulttype); |
$grp_parm = &valout($coursereply,$resulttype); |
} |
} |
$grp_parm = &valout($coursereply,$resulttype); |
$grp_parm = &valout($coursereply,$resulttype); |
$output = '<td bgcolor='.$bgcolor.' align="center">'; |
$output = '<td style="background-color:'.$bgcolor.';" align="center">'; |
if ($resultgroup && $resultlevel) { |
if ($resultgroup && $resultlevel) { |
$output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm; |
$output .= '<small><b>'.$resultgroup.'</b> ('.$resultlevel.'): </small>'.$grp_parm; |
} else { |
} else { |
Line 898 sub print_usergroups {
|
Line 1113 sub print_usergroups {
|
} |
} |
$output .= '</td>'; |
$output .= '</td>'; |
} else { |
} else { |
$output .= '<td bgcolor='.$bgcolor.'> </td>'; |
$output .= '<td style="background-color:'.$bgcolor.';"> </td>'; |
} |
} |
return ($coursereply,$output,$grp_parm,$resultgroup); |
return ($coursereply,$output,$grp_parm,$resultgroup); |
} |
} |
Line 927 sub parm_control_group {
|
Line 1142 sub parm_control_group {
|
return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype); |
return($coursereply,$resultitem,$resultgroup,$resultlevel,$resulttype); |
} |
} |
|
|
=pod |
|
|
|
=item B<extractResourceInformation>: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes. |
|
|
|
Input: See list below: |
|
|
|
=over 4 |
|
|
|
=item B<ids>: An array that will contain all of the ids in the course. |
|
|
|
=item B<typep>: hash, id->type, where "type" contains the extension of the file, thus, I<problem exam quiz assess survey form>. |
|
|
|
=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<allparts>: hash, part identification->text representation of part, where the text representation is "[Part $part]" |
|
|
|
=item B<allkeys>: hash, full key to part->display value (what's display value?) |
|
|
|
=item B<allmaps>: hash, ??? |
|
|
|
=item B<fcat>: ??? |
|
|
|
=item B<defp>: hash, ??? |
|
|
|
=item B<mapp>: ?? |
|
|
|
=item B<symbp>: hash, id->full sym? |
|
|
|
=back |
|
|
|
=cut |
|
|
|
sub extractResourceInformation { |
sub extractResourceInformation { |
my $ids = shift; |
my $ids = shift; |
Line 999 sub extractResourceInformation {
|
Line 1182 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= &Apache::lonnet::metadata($srcf,$key.'.display'); |
my ($display,$parmdis); |
my $parmdis = $display; |
$display = &standard_parameter_names($name); |
$parmdis =~ s/\s*\[Part.*$//g; |
if ($display eq '') { |
|
$display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
|
$parmdis = $display; |
|
$parmdis =~ s/\s*\[Part.*$//g; |
|
} else { |
|
$parmdis = $display; |
|
} |
$$allparms{$name}=$parmdis; |
$$allparms{$name}=$parmdis; |
if (ref($defkeytype)) { |
if (ref($defkeytype)) { |
$$defkeytype{$name}= |
$$defkeytype{$name}= |
Line 1053 sub extractResourceInformation {
|
Line 1242 sub extractResourceInformation {
|
} |
} |
|
|
|
|
################################################## |
|
################################################## |
|
|
|
sub isdateparm { |
sub isdateparm { |
my $type=shift; |
my $type=shift; |
Line 1127 sub parmmenu {
|
Line 1314 sub parmmenu {
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
$r->print(); |
$r->print(); |
$r->print("\n<table id=\"LC_parm_overview_parm_menu\"><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><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="checked"'); |
} |
} |
$r->print('>'.($$allparms{$tempkey}=~/\S/ ? &mt($$allparms{$tempkey}) |
$r->print(' />'.($$allparms{$tempkey}=~/\S/ ? $$allparms{$tempkey} |
: &mt($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 1145 ENDSCRIPT
|
Line 1332 ENDSCRIPT
|
} |
} |
} |
} |
$r->print('</tr>' |
$r->print('</tr>' |
.'<tr id=\"LC_parm_overview_parm_menu_selectors\">' |
.'<tr id="LC_parm_overview_parm_menu_selectors">' |
.'<td valign="top">' |
.'<td valign="top">' |
.'<fieldset><legend><b>'.&mt('Parameter Selection').'</b></legend>' |
.'<fieldset><legend><b>'.&mt('Parameter Selection').'</b></legend>' |
.'<span class="LC_nobreak">' |
.'<span class="LC_nobreak">' |
Line 1188 ENDSCRIPT
|
Line 1375 ENDSCRIPT
|
|
|
sub partmenu { |
sub partmenu { |
my ($r,$allparts,$psprt)=@_; |
my ($r,$allparts,$psprt)=@_; |
$r->print('<select multiple name="psprt" size="8">'); |
$r->print('<select multiple="multiple" name="psprt" size="8">'); |
$r->print('<option value="all"'); |
$r->print('<option value="all"'); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print('>'.&mt('All Parts').'</option>'); |
$r->print('>'.&mt('All Parts').'</option>'); |
Line 1352 sub sectionmenu {
|
Line 1539 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="true" 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 1371 sub groupmenu {
|
Line 1558 sub groupmenu {
|
my %grouphash = &Apache::longroup::coursegroups(); |
my %grouphash = &Apache::longroup::coursegroups(); |
return if (!%grouphash); |
return if (!%grouphash); |
|
|
$r->print('<select name="Group" multiple="true" 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 1421 sub sortmenu {
|
Line 1608 sub sortmenu {
|
my ($r,$sortorder)=@_; |
my ($r,$sortorder)=@_; |
$r->print('<br /><label><input type="radio" name="sortorder" value="realmstudent"'); |
$r->print('<br /><label><input type="radio" name="sortorder" value="realmstudent"'); |
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
$r->print(' checked="on"'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print(' />'.&mt('Sort by realm first, then student (group/section)')); |
$r->print(' />'.&mt('Sort by realm first, then student (group/section)')); |
$r->print('</label><br /><label><input type="radio" name="sortorder" value="studentrealm"'); |
$r->print('</label><br /><label><input type="radio" name="sortorder" value="studentrealm"'); |
if ($sortorder eq 'studentrealm') { |
if ($sortorder eq 'studentrealm') { |
$r->print(' checked="on"'); |
$r->print(' checked="checked"'); |
} |
} |
$r->print(' />'.&mt('Sort by student (group/section) first, then realm'). |
$r->print(' />'.&mt('Sort by student (group/section) first, then realm'). |
'</label>'); |
'</label>'); |
Line 1455 sub standardkeyorder {
|
Line 1642 sub standardkeyorder {
|
'parameter_0_discusshide' => 20); |
'parameter_0_discusshide' => 20); |
} |
} |
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item assessparms |
|
|
|
Show assessment data and parameters. This is a large routine that should |
|
be simplified and shortened... someday. |
|
|
|
Inputs: $r |
|
|
|
Returns: nothing |
|
|
|
Variables used (guessed by Jeremy): |
|
|
|
=over 4 |
|
|
|
=item B<pscat>: ParameterS CATegories? ends up a list of the types of parameters that exist, e.g., tol, weight, acc, opendate, duedate, answerdate, sig, maxtries, type. |
|
|
|
=item B<psprt>: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? |
|
|
|
=item B<allmaps>: |
|
|
|
=back |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
sub assessparms { |
sub assessparms { |
|
|
my $r=shift; |
my $r=shift; |
Line 1665 sub assessparms {
|
Line 1823 sub assessparms {
|
if (!$pssymb) { |
if (!$pssymb) { |
$r->print('<table border="1"><tr><td>'); |
$r->print('<table border="1"><tr><td>'); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
|
$r->print('</td>'); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print('<td>'); |
$r->print('<td>'); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
$r->print('</td>'); |
$r->print('</td>'); |
} |
} |
$r->print('</td></tr></table>'); |
$r->print('</tr></table>'); |
&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); |
Line 1707 sub assessparms {
|
Line 1866 sub assessparms {
|
$coursespan += 3; |
$coursespan += 3; |
} |
} |
|
|
$r->print('<p><table border=2>'); |
$r->print('<p><table border="2">'); |
$r->print('<tr><td colspan=5></td>'); |
$r->print('<tr><td colspan="5"></td>'); |
$r->print('<th colspan='.($coursespan).'>'.&mt('Any User').'</th>'); |
$r->print('<th colspan="'.($coursespan).'">'.&mt('Any User').'</th>'); |
if ($uname) { |
if ($uname) { |
if (@usersgroups > 1) { |
if (@usersgroups > 1) { |
$userspan ++; |
$userspan ++; |
Line 1735 sub assessparms {
|
Line 1894 sub assessparms {
|
'fr' => 'for Resource' |
'fr' => 'for Resource' |
); |
); |
$r->print(<<ENDTABLETWO); |
$r->print(<<ENDTABLETWO); |
<th rowspan=3>$lt{'pie'}</th> |
<th rowspan="3">$lt{'pie'}</th> |
<th rowspan=3>$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th> |
<th rowspan="3">$lt{'csv'}<br />($csuname $lt{'at'} $csudom)</th> |
</tr><tr><td colspan=5></td><th colspan=2>$lt{'ic'}</th><th colspan=2>$lt{'rl'}</th> |
</tr><tr><td colspan="5"></td><th colspan="2">$lt{'ic'}</th><th colspan="2">$lt{'rl'}</th> |
<th colspan=1>$lt{'ic'}</th> |
<th colspan="1">$lt{'ic'}</th> |
|
|
ENDTABLETWO |
ENDTABLETWO |
if ($csec) { |
if ($csec) { |
$r->print("<th colspan=3>". |
$r->print('<th colspan="3">'. |
&mt("in Section")." $csec</th>"); |
&mt("in Section")." $csec</th>"); |
} |
} |
if ($cgroup) { |
if ($cgroup) { |
$r->print("<th colspan=3>". |
$r->print('<th colspan="3">'. |
&mt("in Group")." $cgroup</th>"); |
&mt("in Group")." $cgroup</th>"); |
} |
} |
$r->print(<<ENDTABLEHEADFOUR); |
$r->print(<<ENDTABLEHEADFOUR); |
Line 1787 ENDTABLEHEADFOUR
|
Line 1946 ENDTABLEHEADFOUR
|
|| |
|| |
($pssymb && $pssymb eq $symbp{$rid})) { |
($pssymb && $pssymb eq $symbp{$rid})) { |
# ------------------------------------------------------ Entry for one resource |
# ------------------------------------------------------ Entry for one resource |
if ($defbgone eq '"#E0E099"') { |
if ($defbgone eq '#E0E099') { |
$defbgone='"#E0E0DD"'; |
$defbgone='#E0E0DD'; |
} else { |
} else { |
$defbgone='"#E0E099"'; |
$defbgone='#E0E099'; |
} |
} |
if ($defbgtwo eq '"#FFFF99"') { |
if ($defbgtwo eq '#FFFF99') { |
$defbgtwo='"#FFFFDD"'; |
$defbgtwo='#FFFFDD'; |
} else { |
} else { |
$defbgtwo='"#FFFF99"'; |
$defbgtwo='#FFFF99'; |
} |
} |
if ($defbgthree eq '"#FFBB99"') { |
if ($defbgthree eq '#FFBB99') { |
$defbgthree='"#FFBBDD"'; |
$defbgthree='#FFBBDD'; |
} else { |
} else { |
$defbgthree='"#FFBB99"'; |
$defbgthree='#FFBB99'; |
} |
} |
|
|
my $thistitle=''; |
my $thistitle=''; |
Line 1817 ENDTABLEHEADFOUR
|
Line 1976 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'); |
$display{$_}=&Apache::lonnet::metadata($uri,$_.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$_.'.display'); |
|
if ($allparms{$name{$_}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$_} = $allparms{$name{$_}}.$identifier; |
|
} else { |
|
$display{$_} = $parmdis; |
|
} |
unless ($display{$_}) { $display{$_}=''; } |
unless ($display{$_}) { $display{$_}=''; } |
$display{$_}.=' ('.$name{$_}.')'; |
$display{$_}.=' ('.$name{$_}.')'; |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
$default{$_}=&Apache::lonnet::metadata($uri,$_); |
Line 1829 ENDTABLEHEADFOUR
|
Line 1997 ENDTABLEHEADFOUR
|
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 bgcolor='.$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 1844 ENDTABLEHEADFOUR
|
Line 2012 ENDTABLEHEADFOUR
|
$r->print(' ('.$thistitle.')'); |
$r->print(' ('.$thistitle.')'); |
} |
} |
$r->print('</a></b></td>'); |
$r->print('</a></b></td>'); |
$r->print('<td bgcolor='.$defbgtwo. |
$r->print('<td style="background-color:'.$defbgtwo.';"'. |
' rowspan='.$totalparms.'>'.$typep{$rid}. |
' rowspan='.$totalparms.'>'.$typep{$rid}. |
'</td>'); |
'</td>'); |
|
|
$r->print('<td bgcolor='.$defbgone. |
$r->print('<td style="background-color:'.$defbgone.';"'. |
' rowspan='.$totalparms. |
' rowspan='.$totalparms. |
'>'.$maptitles{$mapp{$rid}}.'</td>'); |
'>'.$maptitles{$mapp{$rid}}.'</td>'); |
|
|
Line 1871 ENDTABLEHEADFOUR
|
Line 2039 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 1924 ENDTABLEHEADFOUR
|
Line 2092 ENDTABLEHEADFOUR
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
|
if ($allparms{$name{$tempkeyp}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier; |
|
} else { |
|
$display{$tempkeyp} = $parmdis; |
|
} |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
Line 1961 ENDTABLEHEADFOUR
|
Line 2138 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><table border="2">'); |
$r->print('<p>'.&Apache::loncommon::start_data_table() |
$r->print('<tr><th>'.&mt('Parameter Name').'</th>'); |
.&Apache::loncommon::start_data_table_header_row() |
$r->print('<th>'.&mt('Default Value').'</th>'); |
.'<th>'.&mt('Parameter Name').'</th>' |
$r->print('<th>'.&mt('Parameter in Effect').'</th></tr>'); |
.'<th>'.&mt('Default Value').'</th>' |
|
.'<th>'.&mt('Parameter in Effect').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
); |
|
|
foreach (&keysinorder(\%name,\%keyorder)) { |
foreach (&keysinorder(\%name,\%keyorder)) { |
$r->print('<tr>'); |
$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("</table></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 2012 ENDTABLEHEADFOUR
|
Line 2194 ENDTABLEHEADFOUR
|
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { |
$part{$tempkeyp}="0"; |
$part{$tempkeyp}="0"; |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); |
$display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
my $parmdis=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); |
|
if ($allparms{$name{$tempkeyp}} ne '') { |
|
my $identifier; |
|
if ($parmdis =~ /(\s*\[Part.*)$/) { |
|
$identifier = $1; |
|
} |
|
$display{$tempkeyp} = $allparms{$name{$tempkeyp}}.$identifier; |
|
} else { |
|
$display{$tempkeyp} = $parmdis; |
|
} |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
$display{$tempkeyp} =~ s/_\w+_/_0_/; |
Line 2025 ENDTABLEHEADFOUR
|
Line 2216 ENDTABLEHEADFOUR
|
#---------------------------------------------------- print header information |
#---------------------------------------------------- print header information |
my $setdef=&mt("Set Defaults for All Resources in Course"); |
my $setdef=&mt("Set Defaults for All Resources in Course"); |
$r->print(<<ENDMAPONE); |
$r->print(<<ENDMAPONE); |
<center><h4>$setdef |
<center> |
|
<h4>$setdef |
<font color="red"><i>$coursename</i></font><br /> |
<font color="red"><i>$coursename</i></font><br /> |
ENDMAPONE |
ENDMAPONE |
if ($uname) { |
if ($uname) { |
Line 2039 ENDMAPONE
|
Line 2231 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><table border="2">'); |
$r->print('<p>'.&Apache::loncommon::start_data_table() |
$r->print('<tr><th>'.&mt('Parameter Name').'</th>'); |
.&Apache::loncommon::start_data_table_header_row() |
$r->print('<th>'.&mt('Default Value').'</th>'); |
.'<th>'.&mt('Parameter Name').'</th>' |
$r->print('<th>'.&mt('Parameter in Effect').'</th></tr>'); |
.'<th>'.&mt('Default Value').'</th>' |
|
.'<th>'.&mt('Parameter in Effect').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
); |
|
|
foreach (&keysinorder(\%name,\%keyorder)) { |
foreach (&keysinorder(\%name,\%keyorder)) { |
$r->print('<tr>'); |
$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("</table></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 |
|
|
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=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 |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
sub crsenv { |
sub crsenv { |
my $r=shift; |
my $r=shift; |
my $setoutput=''; |
my $setoutput=''; |
|
|
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::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'}; |
Line 2145 sub crsenv {
|
Line 2328 sub crsenv {
|
my ($name,$domain) = split(':',$user); |
my ($name,$domain) = split(':',$user); |
if (!defined($user) || !defined($domain)) { |
if (!defined($user) || !defined($domain)) { |
$setoutput.= '<br /> <span class="LC_error">'. |
$setoutput.= '<br /> <span class="LC_error">'. |
&mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user). |
&mt("Invalid e-mail address specified, address must be of the form username:domain what was specified was ([_1])",$user). |
'</span>'; |
'</span>'; |
undef($value); |
undef($value); |
} elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') { |
} elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') { |
$setoutput.= '<br /> <span class="LC_error">'. |
$setoutput.= '<br /> <span class="LC_error">'. |
&mt("Invalid email address specified, user [_1] is unknown.",$name). |
&mt("Invalid e-mail address specified, user [_1] is unknown.",$name). |
'</span>'; |
'</span>'; |
undef($value); |
undef($value); |
} |
} |
Line 2314 sub crsenv {
|
Line 2497 sub crsenv {
|
'student_classlist_view' => '<b>'.&mt('Allow students to view classlist.').'</b><br />' |
'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>"').')', |
.'('.&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 />' |
'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>"').')', |
.'('.&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 />' |
'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>"').')', |
.'('.&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 live chatroom use for Roles').'</b><br />' |
'plc.roles.denied'=> '<b>'.&mt('Disallow live chatroom use for Roles').'</b><br />' |
Line 2401 sub crsenv {
|
Line 2584 sub crsenv {
|
|
|
'texengine' |
'texengine' |
=> '<b>'.&mt('Force all students in the course to use a specific math rendering engine.').'</b><br />' |
=> '<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>"').')', |
.'('.&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' |
'timezone' |
=> '<b>'.&mt('Timezone in which the course takes place').'</b>', |
=> '<b>'.&mt('Timezone in which the course takes place').'</b>', |
|
|
Line 2535 sub crsenv {
|
Line 2718 sub crsenv {
|
'.checked=true;"'; |
'.checked=true;"'; |
$output.=&Apache::loncommon::start_data_table_row(). |
$output.=&Apache::loncommon::start_data_table_row(). |
'<td><i>'.&mt('Create New Environment Variable').'</i><br />'. |
'<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>'. |
'<input type="checkbox" name="newp_setparmval" /></td>'. |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
Line 2957 sub listdata {
|
Line 3140 sub listdata {
|
} |
} |
if ($part ne $oldpart) { |
if ($part ne $oldpart) { |
$r->print(&tableend(). |
$r->print(&tableend(). |
"\n<span class=\"LC_parm_part\">".&mt('Part').": $part</span>"); |
"\n".'<span class="LC_parm_part">'.&mt('Part').": $part</span>"); |
$oldpart=$part; |
$oldpart=$part; |
} |
} |
# |
# |
Line 2992 sub listdata {
|
Line 3175 sub listdata {
|
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
$r->print(&default_selector($thiskey,$$resourcedata{$thiskey})); |
} |
} |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$r->print('<input type="hidden" name="typeof_'.$thiskey.'" value="'. |
$thistype.'">'); |
$thistype.'" />'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
Line 3115 sub newoverview {
|
Line 3298 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 3275 sub overview {
|
Line 3460 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 3300 ENDOVER
|
Line 3487 ENDOVER
|
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder); |
|
|
$r->print(&tableend().'<p>'. |
$r->print(&tableend().'<p>'. |
($foundkeys?'<input type="submit" value="'.&mt('Modify Parameters').'" />':&mt('There are no parameters.')).'</p></form>'. |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':&mt('There are no parameters.')).'</p></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3309 sub clean_parameters {
|
Line 3496 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 3329 ENDOVER
|
Line 3518 ENDOVER
|
$r->print('<h3>'. |
$r->print('<h3>'. |
&mt('These parameters refer to resources that do not exist.'). |
&mt('These parameters refer to resources that do not exist.'). |
'</h3>'. |
'</h3>'. |
'<input type="submit" value="'.&mt('Delete Checked Parameters').'" />'.'<br />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'.'<br />'. |
'<br />'); |
'<br />'); |
$r->print(&Apache::loncommon::start_data_table(). |
$r->print(&Apache::loncommon::start_data_table(). |
'<tr>'. |
'<tr>'. |
Line 3382 ENDOVER
|
Line 3571 ENDOVER
|
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
$r->print(&Apache::loncommon::end_data_table().'<p>'. |
'<input type="submit" value="'.&mt('Delete Checked Parameters').'" />'. |
'<input type="submit" value="'.&mt('Delete Selected').'" />'. |
'</p></form>'. |
'</p></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
Line 3392 sub date_shift_one {
|
Line 3581 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 3417 sub date_shift_two {
|
Line 3608 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 3471 sub parse_key {
|
Line 3664 sub parse_key {
|
return %data; |
return %data; |
} |
} |
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item check_cloners |
|
|
|
Checks if new users included in list of allowed cloners |
|
are valid users. Replaces supplied list with |
|
cleaned list containing only users with valid usernames |
|
and domains. |
|
|
|
Inputs: $clonelist, $oldcloner |
|
where $clonelist is ref to array of requested cloners, |
|
and $oldcloner is ref to array of currently allowed |
|
cloners. |
|
|
|
Returns: string - comma separated list of requested |
|
cloners (username:domain) who do not exist in system. |
|
|
|
=item change_clone |
|
|
|
Modifies the list of courses a user can clone (stored |
|
in the user's environment.db file), called when a |
|
change is made to the list of users allowed to clone |
|
a course. |
|
|
|
Inputs: $action,$cloner |
|
where $action is add or drop, and $cloner is identity of |
|
user for whom cloning ability is to be changed in course. |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
|
|
sub extract_cloners { |
sub extract_cloners { |
my ($clonelist,$allowclone) = @_; |
my ($clonelist,$allowclone) = @_; |
Line 3622 sub change_clone {
|
Line 3781 sub change_clone {
|
} |
} |
|
|
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item * header |
|
|
|
Output html header for page |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
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 3653 ENDMAINFORMHEAD
|
Line 3803 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 => 'Set Course Environment', |
{ linktext => 'Course Environment', |
action => 'crsenv', |
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 3744 sub output_row {
|
Line 3895 sub output_row {
|
} |
} |
if (!($options =~ /deleted/)) { |
if (!($options =~ /deleted/)) { |
my @options= ( ['active', 'Show to student'], |
my @options= ( ['active', 'Show to student'], |
['stuadd', 'Provide text area for students to type catalog information'], |
['stuadd', 'Provide text area for students to type metadata'], |
['choices','Provide choices for students to select from']); |
['choices','Provide choices for students to select from']); |
# ['onlyone','Student may select only one choice']); |
# ['onlyone','Student may select only one choice']); |
if ($added_flag) { |
if ($added_flag) { |
Line 3768 sub output_row {
|
Line 3919 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 "; |
$single_checked = ' checked="checked"'; |
} else { |
} else { |
$multiple_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 .' /> |
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.' /> |
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 3869 sub order_meta_fields {
|
Line 4025 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 3876 sub continue {
|
Line 4034 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 3922 sub addmetafield {
|
Line 4084 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 4005 ENDenv
|
Line 4172 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 4018 sub get_added_meta_fieldnames {
|
Line 4187 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 4035 sub get_deleted_meta_fieldnames {
|
Line 4207 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 4186 ENDYESNO
|
Line 4360 ENDYESNO
|
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
"\n<input type='submit' name='storerules' value='". |
"\n".'<input type="submit" name="storerules" value="'. |
&mt('Save Rules')."' /></form>\n". |
&mt('Save').'" /></form>'."\n". |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
Line 4231 sub components {
|
Line 4405 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 4260 sub standard_parameter_names {
|
Line 4436 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 4428 sub check_for_course_info {
|
Line 4603 sub check_for_course_info {
|
return 0; |
return 0; |
} |
} |
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item * handler |
|
|
|
Main handler. Calls &assessparms and &crsenv subroutines. |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
|
|
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 4475 sub handler {
|
Line 4636 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 4488 sub handler {
|
Line 4643 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 'crsenv' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'crsenv') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
|
&crsenv($r); |
&crsenv($r); |
} elsif ($env{'form.action'} eq 'setoverview' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'setoverview') { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
|
text=>"Overview Mode"}); |
|
&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 4567 sub handler {
|
Line 4692 sub handler {
|
1; |
1; |
__END__ |
__END__ |
|
|
=pod |
|
|
|
=back |
|
|
|
=cut |
|
|
|
|
|
|
|