version 1.395, 2008/05/28 23:05:07
|
version 1.446, 2009/05/12 10:54:11
|
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 118 sub parmval_by_symb {
|
Line 366 sub parmval_by_symb {
|
my $result=''; |
my $result=''; |
my @outpar=(); |
my @outpar=(); |
# ----------------------------------------------------- Cascading lookup scheme |
# ----------------------------------------------------- Cascading lookup scheme |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
$map = &Apache::lonnet::deversion($map); |
$map = &Apache::lonnet::deversion($map); |
|
|
my $symbparm=$symb.'.'.$what; |
my $symbparm=$symb.'.'.$what; |
Line 220 sub parmval_by_symb {
|
Line 468 sub parmval_by_symb {
|
|
|
# --- Caches local to lonparmset |
# --- Caches local to lonparmset |
|
|
|
|
sub reset_caches { |
sub reset_caches { |
&resetparmhash(); |
&resetparmhash(); |
&resetsymbcache(); |
&resetsymbcache(); |
Line 234 sub reset_caches {
|
Line 482 sub reset_caches {
|
undef($parmhashid); |
undef($parmhashid); |
undef(%parmhash); |
undef(%parmhash); |
} |
} |
|
|
sub cacheparmhash { |
sub cacheparmhash { |
if ($parmhashid eq $env{'request.course.fn'}) { return; } |
if ($parmhashid eq $env{'request.course.fn'}) { return; } |
my %parmhashfile; |
my %parmhashfile; |
Line 245 sub reset_caches {
|
Line 493 sub reset_caches {
|
$parmhashid=$env{'request.course.fn'}; |
$parmhashid=$env{'request.course.fn'}; |
} |
} |
} |
} |
|
|
sub parmhash { |
sub parmhash { |
my ($id) = @_; |
my ($id) = @_; |
&cacheparmhash(); |
&cacheparmhash(); |
Line 253 sub reset_caches {
|
Line 501 sub reset_caches {
|
} |
} |
} |
} |
|
|
{ |
{ |
my $symbsid; |
my $symbsid; |
my %symbs; |
my %symbs; |
sub resetsymbcache { |
sub resetsymbcache { |
undef($symbsid); |
undef($symbsid); |
undef(%symbs); |
undef(%symbs); |
} |
} |
|
|
sub symbcache { |
sub symbcache { |
my $id=shift; |
my $id=shift; |
if ($symbsid ne $env{'request.course.id'}) { |
if ($symbsid ne $env{'request.course.id'}) { |
Line 281 sub reset_caches {
|
Line 529 sub reset_caches {
|
} |
} |
} |
} |
|
|
{ |
{ |
my $rulesid; |
my $rulesid; |
my %rules; |
my %rules; |
sub resetrulescache { |
sub resetrulescache { |
undef($rulesid); |
undef($rulesid); |
undef(%rules); |
undef(%rules); |
} |
} |
|
|
sub rulescache { |
sub rulescache { |
my $id=shift; |
my $id=shift; |
if ($rulesid ne $env{'request.course.id'} |
if ($rulesid ne $env{'request.course.id'} |
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 325 sub date_sanity_info {
|
Line 576 sub date_sanity_info {
|
my $crsprefix='course.'.$env{'request.course.id'}.'.'; |
my $crsprefix='course.'.$env{'request.course.id'}.'.'; |
if ($env{$crsprefix.'default_enrollment_end_date'}) { |
if ($env{$crsprefix.'default_enrollment_end_date'}) { |
if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { |
if ($checkdate>$env{$crsprefix.'default_enrollment_end_date'}) { |
$result.='<br />'.&mt('After course enrollment end!'); |
$result.='<div class="LC_warning">' |
|
.&mt('After course enrollment end!') |
|
.'</div>'; |
} |
} |
} |
} |
if ($env{$crsprefix.'default_enrollment_start_date'}) { |
if ($env{$crsprefix.'default_enrollment_start_date'}) { |
if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { |
if ($checkdate<$env{$crsprefix.'default_enrollment_start_date'}) { |
$result.='<br />'.&mt('Before course enrollment start!'); |
$result.='<div class="LC_warning">' |
|
.&mt('Before course enrollment start!') |
|
.'</div>'; |
} |
} |
} |
} |
|
# Preparation for additional warnings about dates in the past/future. |
|
# An improved, more context sensitive version is recommended, |
|
# e.g. warn for due and answer dates which are defined before the corresponding open date, etc. |
|
# if ($checkdate<time) { |
|
# $result.='<div class="LC_info">' |
|
# .'('.&mt('in the past').')' |
|
# .'</div>'; |
|
# } |
|
# if ($checkdate>time) { |
|
# $result.='<div class="LC_info">' |
|
# .'('.&mt('in the future').')' |
|
# .'</div>'; |
|
# } |
return $result; |
return $result; |
} |
} |
################################################## |
################################################## |
Line 354 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 426 sub storeparm_by_symb_inner {
|
Line 683 sub storeparm_by_symb_inner {
|
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
# ---------------------------------------------------------- Construct prefixes |
# ---------------------------------------------------------- Construct prefixes |
$spnam=~s/\_([^\_]+)$/\.$1/; |
$spnam=~s/\_([^\_]+)$/\.$1/; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
$map = &Apache::lonnet::deversion($map); |
$map = &Apache::lonnet::deversion($map); |
|
|
my $symbparm=$symb.'.'.$spnam; |
my $symbparm=$symb.'.'.$spnam; |
Line 439 sub storeparm_by_symb_inner {
|
Line 696 sub storeparm_by_symb_inner {
|
my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam; |
my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam; |
my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm; |
my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm; |
my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm; |
my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm; |
|
|
my $courselevel=$env{'request.course.id'}.'.'.$spnam; |
my $courselevel=$env{'request.course.id'}.'.'.$spnam; |
my $courselevelr=$env{'request.course.id'}.'.'.$symbparm; |
my $courselevelr=$env{'request.course.id'}.'.'.$symbparm; |
my $courselevelm=$env{'request.course.id'}.'.'.$mapparm; |
my $courselevelm=$env{'request.course.id'}.'.'.$mapparm; |
|
|
my $storeunder=''; |
my $storeunder=''; |
if (($snum==14) || ($snum==3)) { $storeunder=$courselevel; } |
if (($snum==14) || ($snum==3)) { $storeunder=$courselevel; } |
if (($snum==13) || ($snum==2)) { $storeunder=$courselevelm; } |
if (($snum==13) || ($snum==2)) { $storeunder=$courselevelm; } |
Line 455 sub storeparm_by_symb_inner {
|
Line 712 sub storeparm_by_symb_inner {
|
if ($snum==5) { $storeunder=$grplevelm; } |
if ($snum==5) { $storeunder=$grplevelm; } |
if ($snum==4) { $storeunder=$grplevelr; } |
if ($snum==4) { $storeunder=$grplevelr; } |
|
|
|
|
my $delete; |
my $delete; |
if ($nval eq '') { $delete=1;} |
if ($nval eq '') { $delete=1;} |
my %storecontent = ($storeunder => $nval, |
my %storecontent = ($storeunder => $nval, |
Line 512 sub storeparm_by_symb_inner {
|
Line 769 sub storeparm_by_symb_inner {
|
} |
} |
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
} |
} |
|
|
if ($reply=~/^error\:(.*)/) { |
if ($reply=~/^error\:(.*)/) { |
return "<span class=\"LC_error\">Write Error: $1</span>"; |
return "<span class=\"LC_error\">Write Error: $1</span>"; |
} |
} |
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 551 sub valout {
|
Line 790 sub valout {
|
} else { |
} else { |
if ($type eq 'date_interval') { |
if ($type eq 'date_interval') { |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); |
|
my @timer; |
$year=$year-70; |
$year=$year-70; |
$mday--; |
$mday--; |
if ($year) { |
if ($year) { |
$result.=$year.' yrs '; |
# $result.=&mt('[quant,_1,yr]',$year).' '; |
|
push(@timer,&mt('[quant,_1,yr]',$year)); |
} |
} |
if ($mon) { |
if ($mon) { |
$result.=$mon.' mths '; |
# $result.=&mt('[quant,_1,mth]',$mon).' '; |
|
push(@timer,&mt('[quant,_1,mth]',$mon)); |
} |
} |
if ($mday) { |
if ($mday) { |
$result.=$mday.' days '; |
# $result.=&mt('[quant,_1,day]',$mday).' '; |
|
push(@timer,&mt('[quant,_1,day]',$mday)); |
} |
} |
if ($hour) { |
if ($hour) { |
$result.=$hour.' hrs '; |
# $result.=&mt('[quant,_1,hr]',$hour).' '; |
|
push(@timer,&mt('[quant,_1,hr]',$hour)); |
} |
} |
if ($min) { |
if ($min) { |
$result.=$min.' mins '; |
# $result.=&mt('[quant,_1,min]',$min).' '; |
|
push(@timer,&mt('[quant,_1,min]',$min)); |
} |
} |
if ($sec) { |
if ($sec) { |
$result.=$sec.' secs '; |
# $result.=&mt('[quant,_1,sec]',$sec).' '; |
|
push(@timer,&mt('[quant,_1,sec]',$sec)); |
} |
} |
$result=~s/\s+$//; |
# $result=~s/\s+$//; |
|
if (!@timer) { # Special case: all entries 0 -> display "0 secs" intead of empty field to keep this field editable |
|
push(@timer,&mt('[quant,_1,sec]',0)); |
|
} |
|
$result.=join(", ",@timer); |
} elsif (&isdateparm($type)) { |
} elsif (&isdateparm($type)) { |
$result = &Apache::lonlocal::locallocaltime($value). |
$result = &Apache::lonlocal::locallocaltime($value). |
&date_sanity_info($value); |
&date_sanity_info($value); |
Line 583 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 615 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 683 sub startpage {
|
Line 917 sub startpage {
|
my %loaditems = ('onunload' => "pclose()", |
my %loaditems = ('onunload' => "pclose()", |
'onload' => "group_or_section('cgroup')",); |
'onload' => "group_or_section('cgroup')",); |
|
|
my $start_page = |
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 = |
&Apache::loncommon::start_page('Set/Modify Course Parameters', |
&Apache::loncommon::start_page('Set/Modify Course Parameters', |
&page_js(), |
&page_js(), |
{'add_entries' => \%loaditems,}); |
{'add_entries' => \%loaditems,}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
$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 719 sub print_row {
|
Line 962 sub print_row {
|
# cascade down manually |
# cascade down manually |
my $cascadetype=$$defaulttype{$which}; |
my $cascadetype=$$defaulttype{$which}; |
for (my $i=14;$i>0;$i--) { |
for (my $i=14;$i>0;$i--) { |
if ($typeoutpar[$i]) { |
if ($typeoutpar[$i]) { |
$cascadetype=$typeoutpar[$i]; |
$cascadetype=$typeoutpar[$i]; |
} else { |
} else { |
$typeoutpar[$i]=$cascadetype; |
$typeoutpar[$i]=$cascadetype; |
Line 728 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\_//; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
my $mprefix=$rid.'&'.$thismarker.'&'; |
Line 752 sub print_row {
|
Line 995 sub print_row {
|
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} elsif ($parmlev eq 'map') { |
} elsif ($parmlev eq 'map') { |
|
|
Line 791 sub print_row {
|
Line 1034 sub print_row {
|
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
if ($csec) { |
if ($csec) { |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
Line 803 sub print_row {
|
Line 1046 sub print_row {
|
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
|
|
if ($uname) { |
if ($uname) { |
if ($othergrp) { |
if ($othergrp) { |
$r->print($othergrp); |
$r->print($othergrp); |
Line 814 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 831 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) { |
my $nolink = 0; |
$r->print(&plink($$typeoutpar[$which], |
if ($which == 11 || $which == 12) { |
$$display{$value},$$outpar[$which], |
$nolink = 1; |
$mprefix."$which",'parmform.pres','psub')); |
} elsif ($mprefix =~ /availablestudent\&$/) { |
|
if ($which > 3) { |
|
$nolink = 1; |
|
} |
|
} |
|
if ($nolink) { |
|
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
} else { |
} else { |
$r->print(&valout($$outpar[$which],$$typeoutpar[$which])); |
$r->print(&plink($$typeoutpar[$which], |
|
$$display{$value},$$outpar[$which], |
|
$mprefix."$which",'parmform.pres','psub')); |
} |
} |
$r->print('</td>'."\n"); |
$r->print('</td>'."\n"); |
} |
} |
Line 856 sub print_usergroups {
|
Line 1107 sub print_usergroups {
|
$courseopt); |
$courseopt); |
my $bgcolor = $defbg; |
my $bgcolor = $defbg; |
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 870 sub print_usergroups {
|
Line 1121 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 899 sub parm_control_group {
|
Line 1150 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 971 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= &Apache::lonnet::metadata($srcf,$key.'.display'); |
my ($display,$parmdis); |
my $parmdis = $display; |
$display = &standard_parameter_names($name); |
$parmdis =~ 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 985 sub extractResourceInformation {
|
Line 1210 sub extractResourceInformation {
|
# allparts is a hash of all parts |
# allparts is a hash of all parts |
# |
# |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
$$allparts{$part} = "Part: $part"; |
$$allparts{$part} = &mt('Part: [_1]',$part); |
# |
# |
# Remember all keys going with this resource |
# Remember all keys going with this resource |
# |
# |
Line 996 sub extractResourceInformation {
|
Line 1221 sub extractResourceInformation {
|
} |
} |
# |
# |
# Put in order |
# Put in order |
# |
# |
unless ($$keyorder{$key}) { |
unless ($$keyorder{$key}) { |
$$keyorder{$key}=$keyordercnt; |
$$keyorder{$key}=$keyordercnt; |
$keyordercnt++; |
$keyordercnt++; |
} |
} |
} |
} |
|
|
|
|
if (!exists($$mapp{$mapid})) { |
if (!exists($$mapp{$mapid})) { |
$$mapp{$id}= |
$$mapp{$id}= |
&Apache::lonnet::declutter($resource->enclosing_map_src()); |
&Apache::lonnet::declutter($resource->enclosing_map_src()); |
$$mapp{$mapid}=$$mapp{$id}; |
$$mapp{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
$$allmaps{$mapid}=$$mapp{$id}; |
if ($mapid eq '1') { |
if ($mapid eq '1') { |
$$maptitles{$mapid}='Main Course Documents'; |
$$maptitles{$mapid}=&mt('Main Course Documents'); |
} else { |
} else { |
$$maptitles{$mapid}= |
$$maptitles{$mapid}= |
&Apache::lonnet::gettitle($$mapp{$id}); |
&Apache::lonnet::gettitle($$mapp{$id}); |
} |
} |
$$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; |
$$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; |
$$symbp{$mapid}=$$mapp{$id}.'___(all)'; |
$$symbp{$mapid}=$$mapp{$id}.'___(all)'; |
Line 1025 sub extractResourceInformation {
|
Line 1250 sub extractResourceInformation {
|
} |
} |
|
|
|
|
################################################## |
|
################################################## |
|
|
|
sub isdateparm { |
sub isdateparm { |
my $type=shift; |
my $type=shift; |
Line 1073 sub parmmenu {
|
Line 1296 sub parmmenu {
|
checkthis('contentopen','pscat'); |
checkthis('contentopen','pscat'); |
checkthis('contentclose','pscat'); |
checkthis('contentclose','pscat'); |
} |
} |
|
|
|
|
function checkvisi() { |
function checkvisi() { |
checkthis('hiddenresource','pscat'); |
checkthis('hiddenresource','pscat'); |
Line 1099 sub parmmenu {
|
Line 1322 sub parmmenu {
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
$r->print(); |
$r->print(); |
$r->print("\n<table id=\"LC_parm_overview_parm_menu\"><tr>"); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); |
|
$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/ ? $$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>"); |
$cnt=0; |
$cnt=0; |
} |
} |
} |
} |
$r->print(' |
$r->print('</tr>' |
</tr><tr id=\"LC_parm_overview_parm_menu_selectors\"><td> |
.'<tr id="LC_parm_overview_parm_menu_selectors">' |
<a href="javascript:checkall(true, \'pscat\')">Select All</a><br /> |
.'<td valign="top">' |
<a href="javascript:checkstandard()">Select Common Only</a> |
.'<fieldset><legend><b>'.&mt('Parameter Selection').'</b></legend>' |
</td><td> |
.'<span class="LC_nobreak">' |
<a href="javascript:checkdates()">Add Problem Dates</a> |
.'• <a href="javascript:checkall(true, \'pscat\')">'.&mt('Select All').'</a>' |
<a href="javascript:checkcontdates()">Add Content Dates</a><br /> |
.'</span>' |
<a href="javascript:checkdisset()">Add Discussion Settings</a> |
.'<br />' |
<a href="javascript:checkvisi()">Add Visibilities</a><br /> |
.'<span class="LC_nobreak">' |
<a href="javascript:checkparts()">Add Part Parameters</a> |
.'• <a href="javascript:checkstandard()">'.&mt('Select Common Only').'</a>' |
</td><td> |
.'</span>' |
<a href="javascript:checkall(false, \'pscat\')">Unselect All</a> |
.'<br />' |
</td> |
.'<span class="LC_nobreak">' |
'); |
.'• <a href="javascript:checkall(false, \'pscat\')">'.&mt('Unselect All').'</a>' |
$r->print('</tr></table>'); |
.'</span>' |
|
.'</fieldset>' |
|
.'</td>' |
|
.'<td colspan="2" valign="top">' |
|
.'<fieldset><legend><b>'.&mt('Add Selection for...').'</b></legend>' |
|
.'<span class="LC_nobreak">' |
|
.'• <a href="javascript:checkdates()">'.&mt('Problem Dates').'</a>' |
|
.'</span>' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkcontdates()">'.&mt('Content Dates').'</a>' |
|
.'</span>' |
|
# .'<br />' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkdisset()">'.&mt('Discussion Settings').'</a>' |
|
.'</span>' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkvisi()">'.&mt('Visibilities').'</a>' |
|
.'</span>' |
|
# .'<br />' |
|
.'<span class="LC_nobreak">' |
|
.' • <a href="javascript:checkparts()">'.&mt('Part Parameters').'</a>' |
|
.'</span>' |
|
.'</fieldset>' |
|
.'</td>' |
|
.'</tr></table>' |
|
); |
} |
} |
|
|
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') unless (@{$psprt}); |
$r->print(' selected="selected"') unless (@{$psprt}); |
$r->print('>'.&mt('All Parts').'</option>'); |
$r->print('>'.&mt('All Parts').'</option>'); |
my %temphash=(); |
my %temphash=(); |
foreach (@{$psprt}) { $temphash{$_}=1; } |
foreach (@{$psprt}) { $temphash{$_}=1; } |
Line 1147 sub partmenu {
|
Line 1397 sub partmenu {
|
unless ($tempkey =~ /\./) { |
unless ($tempkey =~ /\./) { |
$r->print('<option value="'.$tempkey.'"'); |
$r->print('<option value="'.$tempkey.'"'); |
if ($$psprt[0] eq "all" || $temphash{$tempkey}) { |
if ($$psprt[0] eq "all" || $temphash{$tempkey}) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
} |
} |
$r->print('>'.$$allparts{$tempkey}.'</option>'); |
$r->print('>'.$$allparts{$tempkey}.'</option>'); |
} |
} |
Line 1160 sub usermenu {
|
Line 1410 sub usermenu {
|
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '. |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
&Apache::loncommon::selectstudent_link('parmform','uname','udom'); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
my %lt=&Apache::lonlocal::texthash( |
|
'se' => "Section", |
|
'gr' => "Group", |
|
'fu' => "For User", |
|
'oi' => "or ID", |
|
'ad' => "at Domain" |
|
); |
|
my $sections=''; |
my $sections=''; |
my %sectionhash = &Apache::loncommon::get_sections(); |
my %sectionhash = &Apache::loncommon::get_sections(); |
|
|
my $groups; |
my $groups; |
my %grouphash = &Apache::longroup::coursegroups(); |
my %grouphash = &Apache::longroup::coursegroups(); |
|
|
|
my $g_s_header=''; |
|
my $g_s_footer=''; |
|
|
if (%sectionhash) { |
if (%sectionhash) { |
$sections=$lt{'se'}.': <select name="csec"'; |
$sections=&mt('Section:').' <select name="csec"'; |
if (%grouphash && $parmlev ne 'full') { |
if (%grouphash && $parmlev ne 'full') { |
$sections .= qq| onchange="group_or_section('csec')" |; |
$sections .= qq| onchange="group_or_section('csec')" |; |
} |
} |
Line 1186 sub usermenu {
|
Line 1433 sub usermenu {
|
} |
} |
$sections.='</select>'; |
$sections.='</select>'; |
} |
} |
|
|
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
if (%sectionhash && %grouphash && $parmlev ne 'full') { |
$sections .= ' or '; |
$sections .= ' '.&mt('or').' '; |
$sections .= qq| |
$sections .= qq| |
<script type="text/javascript"> |
<script type="text/javascript"> |
function group_or_section(caller) { |
function group_or_section(caller) { |
Line 1211 function group_or_section(caller) {
|
Line 1459 function group_or_section(caller) {
|
} |
} |
</script> |
</script> |
|; |
|; |
} |
} |
|
|
if (%grouphash) { |
if (%grouphash) { |
$groups=$lt{'gr'}.': <select name="cgroup"'; |
$groups=&mt('Group:').' <select name="cgroup"'; |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
if (%sectionhash && $env{'form.action'} eq 'settable') { |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
$groups .= qq| onchange="group_or_section('cgroup')" |; |
} |
} |
Line 1236 function group_or_section(caller) {
|
Line 1484 function group_or_section(caller) {
|
} |
} |
$groups.='</select>'; |
$groups.='</select>'; |
} |
} |
$r->print(<<ENDMENU); |
|
<b> |
if (%sectionhash || %grouphash) { |
$sections |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Group/Section'))); |
$groups |
$r->print($sections.$groups); |
<br /> |
} |
$lt{'fu'} |
|
<input type="text" value="$uname" size="12" name="uname" /> |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('User'))); |
$lt{'oi'} |
$r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' |
<input type="text" value="$id" size="12" name="id" /> |
,'<input type="text" value="'.$uname.'" size="12" name="uname" />' |
$lt{'ad'} |
,'<input type="text" value="'.$id.'" size="12" name="id" /> ' |
$chooseopt |
,$chooseopt)); |
</b> |
|
ENDMENU |
|
} |
} |
|
|
sub displaymenu { |
sub displaymenu { |
my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_; |
my ($r,$allparms,$allparts,$pscat,$psprt,$keyorder)=@_; |
$r->print('<table border="1"><tr><th>'.&mt('Select Parameters to View').'</th><th>'. |
$r->print('<div class="LC_ContentBoxSpecial">'); |
&mt('Select Parts to View').'</th></tr><tr><td>'); |
$r->print('<h2 class="LC_hcell">Step 2</h2>'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
|
&parmmenu($r,$allparms,$pscat,$keyorder); |
&parmmenu($r,$allparms,$pscat,$keyorder); |
$r->print('</td><td>'); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
&partmenu($r,$allparts,$psprt); |
&partmenu($r,$allparts,$psprt); |
$r->print('</td></tr></table>'); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('</div></div>'); |
} |
} |
|
|
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles)=@_; |
my ($r,$allmaps,$pschp,$maptitles)=@_; |
$r->print('<b>'.&mt('Select Enclosing Map or Folder').'</b> '); |
|
|
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'))); |
$r->print('<select name="pschp">'); |
$r->print('<select name="pschp">'); |
$r->print('<option value="all">'.&mt('All Maps or Folders').'</option>'); |
$r->print('<option value="all">'.&mt('All Maps or Folders').'</option>'); |
foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) { |
foreach (sort {$$allmaps{$a} cmp $$allmaps{$b}} keys %{$allmaps}) { |
$r->print('<option value="'.$_.'"'); |
$r->print('<option value="'.$_.'"'); |
if (($pschp eq $_)) { $r->print(' selected'); } |
if (($pschp eq $_)) { $r->print(' selected="selected"'); } |
$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>'); |
$r->print('>'.$$maptitles{$_}.($$allmaps{$_}!~/^uploaded/?' ['.$$allmaps{$_}.']':'').'</option>'); |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
|
|
} |
} |
|
|
sub levelmenu { |
sub levelmenu { |
my ($r,$alllevs,$parmlev)=@_; |
my ($r,$alllevs,$parmlev)=@_; |
$r->print('<b>'.&mt('Select Parameter Level'). |
|
&Apache::loncommon::help_open_topic('Course_Parameter_Levels').'</b> '); |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameter Level').&Apache::loncommon::help_open_topic('Course_Parameter_Levels'))); |
$r->print('<select name="parmlev">'); |
$r->print('<select name="parmlev">'); |
foreach (reverse sort keys %{$alllevs}) { |
foreach (reverse sort keys %{$alllevs}) { |
$r->print('<option value="'.$$alllevs{$_}.'"'); |
$r->print('<option value="'.$$alllevs{$_}.'"'); |
if ($parmlev eq $$alllevs{$_}) { |
if ($parmlev eq $$alllevs{$_}) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
} |
} |
$r->print('>'.$_.'</option>'); |
$r->print('>'.&mt($_).'</option>'); |
} |
} |
$r->print("</select>"); |
$r->print("</select>"); |
} |
} |
Line 1295 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="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}) { |
if ($s eq $_) { |
if ($s eq $_) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
last; |
last; |
} |
} |
} |
} |
Line 1314 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="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}) { |
if ($group eq $_) { |
if ($group eq $_) { |
$r->print(' selected'); |
$r->print(' selected="selected"'); |
last; |
last; |
} |
} |
} |
} |
Line 1364 sub sortmenu {
|
Line 1616 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 1398 sub standardkeyorder {
|
Line 1650 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 1451 sub assessparms {
|
Line 1674 sub assessparms {
|
my $csec; |
my $csec; |
my $cgroup; |
my $cgroup; |
my @usersgroups = (); |
my @usersgroups = (); |
|
|
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
|
|
$alllevs{'Resource Level'}='full'; |
$alllevs{'Resource Level'}='full'; |
Line 1488 sub assessparms {
|
Line 1711 sub assessparms {
|
|
|
my $pssymb=''; |
my $pssymb=''; |
my $parmlev=''; |
my $parmlev=''; |
|
|
unless ($env{'form.parmlev'}) { |
unless ($env{'form.parmlev'}) { |
$parmlev = 'map'; |
$parmlev = 'map'; |
} else { |
} else { |
Line 1539 sub assessparms {
|
Line 1762 sub assessparms {
|
} else { |
} else { |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$env{'request.course.id'}); |
$env{'request.course.id'}); |
|
|
if ($csec eq '-1') { |
if ($csec eq '-1') { |
$message='<span class="LC_error">'. |
$message='<span class="LC_error">'. |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
Line 1569 sub assessparms {
|
Line 1792 sub assessparms {
|
unless ($cgroup) { $cgroup=''; } |
unless ($cgroup) { $cgroup=''; } |
|
|
# --------------------------------------------------------- Get all assessments |
# --------------------------------------------------------- Get all assessments |
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%keyorder); |
\%keyorder); |
|
|
Line 1582 sub assessparms {
|
Line 1805 sub assessparms {
|
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
for (my $i=0;$i<=$#markers;$i++) { |
for (my $i=0;$i<=$#markers;$i++) { |
|
if ($markers[$i] =~ /^[\d.]+\&0_availablestudent\&(1|2|3)$/) { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my (@ok_slots,@fail_slots,@del_slots); |
|
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
|
my ($level,@all) = |
|
&parmval_by_symb('0.availablestudent',$pssymb,'',$uname,$udom, |
|
$csec,$cgroup,$courseopt); |
|
foreach my $slot_name (split(/:/,$values[$i])) { |
|
next if ($slot_name eq ''); |
|
if (&update_slots($slot_name,$cdom,$cnum,$pssymb,$uname,$udom) eq 'ok') { |
|
push(@ok_slots,$slot_name); |
|
|
|
} else { |
|
push(@fail_slots,$slot_name); |
|
} |
|
} |
|
if (@ok_slots) { |
|
$values[$i] = join(':',@ok_slots); |
|
} else { |
|
$values[$i] = ''; |
|
} |
|
if ($all[$level] ne '') { |
|
my @existing = split(/:/,$all[$level]); |
|
foreach my $slot_name (@existing) { |
|
if (!grep(/^\Q$slot_name\E$/,split(/:/,$values[$i]))) { |
|
if (&delete_slots($slot_name,$cdom,$cnum,$uname,$udom,$pssymb) eq 'ok') { |
|
push(@del_slots,$slot_name); |
|
} |
|
} |
|
} |
|
} |
|
} |
$message.=&storeparm(split(/\&/,$markers[$i]), |
$message.=&storeparm(split(/\&/,$markers[$i]), |
$values[$i], |
$values[$i], |
$types[$i], |
$types[$i], |
Line 1592 sub assessparms {
|
Line 1848 sub assessparms {
|
} |
} |
#----------------------------------------------- if all selected, fill in array |
#----------------------------------------------- if all selected, fill in array |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if ($pscat[0] eq "all") {@pscat = (keys %allparms);} |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; |
if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} |
# ------------------------------------------------------------------ Start page |
# ------------------------------------------------------------------ Start page |
|
|
Line 1604 sub assessparms {
|
Line 1860 sub assessparms {
|
&HTML::Entities::encode($env{'form.recent_'.$_},'"&<>'). |
&HTML::Entities::encode($env{'form.recent_'.$_},'"&<>'). |
'" name="recent_'.$_.'" />'); |
'" name="recent_'.$_.'" />'); |
} |
} |
|
|
if (!$pssymb) { |
if (!$pssymb) { |
$r->print('<table border="1"><tr><td>'); |
|
|
$r->print('<div class="LC_ContentBoxSpecial">'); |
|
$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
|
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
|
|
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print('<td>'); |
|
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
$r->print('</td>'); |
|
} |
} |
$r->print('</td></tr></table>'); |
|
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('</div></div>'); |
|
|
&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 1623 sub assessparms {
|
Line 1886 sub assessparms {
|
'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
'<br /><label><b>'.&mt('Show all parts').': <input type="checkbox" name="psprt" value="all"'. |
($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />'); |
($env{'form.psprt'}?' checked="checked"':'').' /></b></label><br />'); |
} |
} |
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
$r->print('<div class="LC_ContentBoxSpecial">'); |
|
$r->print('<h2 class="LC_hcell">Step 3</h2>'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
|
&usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); |
|
|
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('</div></div>'); |
|
|
$r->print('<p>'.$message.'</p>'); |
$r->print('<p>'.$message.'</p>'); |
|
|
Line 1648 sub assessparms {
|
Line 1918 sub assessparms {
|
my $userspan=3; |
my $userspan=3; |
if ($cgroup ne '') { |
if ($cgroup ne '') { |
$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 1678 sub assessparms {
|
Line 1948 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 1725 ENDTABLEHEADFOUR
|
Line 1995 ENDTABLEHEADFOUR
|
my $rid=$_; |
my $rid=$_; |
my ($inmapid)=($rid=~/\.(\d+)$/); |
my ($inmapid)=($rid=~/\.(\d+)$/); |
|
|
if ((!$pssymb && |
if ((!$pssymb && |
(($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}))) |
(($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}))) |
|| |
|| |
($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 1760 ENDTABLEHEADFOUR
|
Line 2030 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 1772 ENDTABLEHEADFOUR
|
Line 2051 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 1787 ENDTABLEHEADFOUR
|
Line 2066 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 1814 ENDTABLEHEADFOUR
|
Line 2093 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; |
|
|
if ($pschp eq 'all') { |
if ($pschp eq 'all') { |
%maplist = %allmaps; |
%maplist = %allmaps; |
} else { |
} else { |
%maplist = ($pschp => $mapp{$pschp}); |
%maplist = ($pschp => $mapp{$pschp}); |
} |
} |
Line 1841 ENDTABLEHEADFOUR
|
Line 2120 ENDTABLEHEADFOUR
|
my $map = 0; |
my $map = 0; |
|
|
# $r->print("Catmarker: @catmarker<br />\n"); |
# $r->print("Catmarker: @catmarker<br />\n"); |
|
|
foreach (@ids) { |
foreach (@ids) { |
($map)=(/([\d]*?)\./); |
($map)=(/([\d]*?)\./); |
my $rid = $_; |
my $rid = $_; |
|
|
# $r->print("$mapid:$map: $rid <br /> \n"); |
# $r->print("$mapid:$map: $rid <br /> \n"); |
|
|
if ($map eq $mapid) { |
if ($map eq $mapid) { |
Line 1863 ENDTABLEHEADFOUR
|
Line 2142 ENDTABLEHEADFOUR
|
my $tempkeyp = $_; |
my $tempkeyp = $_; |
my $fullkeyp = $tempkeyp; |
my $fullkeyp = $tempkeyp; |
$tempkeyp =~ s/_\w+_/_0_/; |
$tempkeyp =~ s/_\w+_/_0_/; |
|
|
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 1877 ENDTABLEHEADFOUR
|
Line 2165 ENDTABLEHEADFOUR
|
} # end loop through keys |
} # end loop through keys |
} |
} |
} # end loop through ids |
} # end loop through ids |
|
|
#---------------------------------------------------- print header information |
#---------------------------------------------------- print header information |
my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map'); |
my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map'); |
my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); |
my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); |
$r->print(<<ENDMAPONE); |
my $tmp=""; |
<center><h4> |
|
Set Defaults for All Resources in $foldermap<br /> |
|
<font color="red"><i>$showtitle</i></font><br /> |
|
Specifically for |
|
ENDMAPONE |
|
if ($uname) { |
if ($uname) { |
my $person=&Apache::loncommon::plainname($uname,$udom); |
my $person=&Apache::loncommon::plainname($uname,$udom); |
$r->print(&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ". |
$tmp.=&mt("User")." <font color=\"red\"><i>$uname \($person\) </i></font> ". |
&mt('in')." \n"); |
&mt('in')." \n"; |
} else { |
} else { |
$r->print("<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n"); |
$tmp.="<font color=\"red\"><i>".&mt('all').'</i></font> '.&mt('users in')." \n"; |
} |
} |
if ($cgroup) { |
if ($cgroup) { |
$r->print(&mt("Group")." <font color=\"red\"><i>$cgroup". |
$tmp.=&mt("Group")." <font color=\"red\"><i>$cgroup". |
"</i></font> ".&mt('of')." \n"); |
"</i></font> ".&mt('of')." \n"; |
$csec = ''; |
$csec = ''; |
} elsif ($csec) { |
} elsif ($csec) { |
$r->print(&mt("Section")." <font color=\"red\"><i>$csec". |
$tmp.=&mt("Section")." <font color=\"red\"><i>$csec". |
"</i></font> ".&mt('of')." \n"); |
"</i></font> ".&mt('of')." \n"; |
} |
} |
$r->print("<font color=\"red\"><i>$coursename</i></font><br />"); |
$r->print('<div align="center"><h4>' |
$r->print("</h4>\n"); |
.&mt('Set Defaults for All Resources in [_1]Specifically for [_2][_3]' |
|
,$foldermap.'<br /><font color="red"><i>'.$showtitle.'</i></font><br />' |
|
,$tmp |
|
,'<font color="red"><i>'.$coursename.'</i></font>' |
|
) |
|
."<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></center>"); |
$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 1934 ENDMAPONE
|
Line 2228 ENDMAPONE
|
my %display = (); |
my %display = (); |
my %type = (); |
my %type = (); |
my %default = (); |
my %default = (); |
|
|
foreach (@ids) { |
foreach (@ids) { |
my $rid = $_; |
my $rid = $_; |
|
|
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
Line 1954 ENDMAPONE
|
Line 2248 ENDMAPONE
|
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 1963 ENDMAPONE
|
Line 2266 ENDMAPONE
|
} |
} |
} # end loop through keys |
} # end loop through keys |
} # end loop through ids |
} # end loop through ids |
|
|
#---------------------------------------------------- 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 1976 ENDMAPONE
|
Line 2280 ENDMAPONE
|
} else { |
} else { |
$r->print("<i><font color=\"red\"> ".&mt("ALL")."</i> ".&mt("USERS")."</font> \n"); |
$r->print("<i><font color=\"red\"> ".&mt("ALL")."</i> ".&mt("USERS")."</font> \n"); |
} |
} |
|
|
if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")}; |
if ($csec) {$r->print(&mt("Section")."<font color=\"red\"> <i>$csec</i></font>\n")}; |
if ($cgroup) {$r->print(&mt("Group")."<font color=\"red\"> <i>$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=''; |
|
|
my $breadcrumbs = |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
|
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'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
my (%crsinfo,$chome); |
my (%crsinfo,$chome); |
|
my $crstype = &Apache::loncommon::course_type(); |
|
|
# |
# |
# Go through list of changes |
# Go through list of changes |
Line 2037 sub crsenv {
|
Line 2333 sub crsenv {
|
if ($name eq 'newp') { |
if ($name eq 'newp') { |
$name = $env{'form.newp_name'}; |
$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') { |
if ($name eq 'url') { |
$value=~s/^\/res\///; |
$value=~s/^\/res\///; |
my $bkuptime=time; |
my $bkuptime=time; |
Line 2054 sub crsenv {
|
Line 2367 sub crsenv {
|
if ($name =~ /^spreadsheet_default_(classcalc| |
if ($name =~ /^spreadsheet_default_(classcalc| |
studentcalc| |
studentcalc| |
assesscalc)$/x) { |
assesscalc)$/x) { |
my $sheettype = $1; |
my $sheettype = $1; |
if ($sheettype eq 'classcalc') { |
if ($sheettype eq 'classcalc') { |
# no need to do anything since viewing the sheet will |
# no need to do anything since viewing the sheet will |
# cause it to be updated. |
# cause it to be updated. |
} elsif ($sheettype eq 'studentcalc') { |
} elsif ($sheettype eq 'studentcalc') { |
# expire all the student spreadsheets |
# expire all the student spreadsheets |
&Apache::lonnet::expirespread('','','studentcalc'); |
&Apache::lonnet::expirespread('','','studentcalc'); |
} else { |
} else { |
# expire all the assessment spreadsheets |
# expire all the assessment spreadsheets |
# this includes non-default spreadsheets, but better to |
# this includes non-default spreadsheets, but better to |
# be safe than sorry. |
# be safe than sorry. |
&Apache::lonnet::expirespread('','','assesscalc'); |
&Apache::lonnet::expirespread('','','assesscalc'); |
Line 2087 sub crsenv {
|
Line 2400 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 2125 sub crsenv {
|
Line 2438 sub crsenv {
|
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'; |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
$setoutput .= &Apache::lonlocal::locallocaltime($value); |
|
} elsif ($name eq 'categories') { |
|
$setoutput .= $env{'form.categories_display'}; |
} else { |
} else { |
$setoutput .= $value; |
$setoutput .= $value; |
} |
} |
Line 2133 sub crsenv {
|
Line 2448 sub crsenv {
|
&change_clone($value,\@oldcloner); |
&change_clone($value,\@oldcloner); |
} |
} |
# Update environment and nohist_courseids.db |
# Update environment and nohist_courseids.db |
if ($name eq 'description' || $name eq 'cloners') { |
if (($name eq 'description') || ($name eq 'cloners') || |
|
($name eq 'hidefromcat') || ($name eq 'categories')) { |
if ($chome eq '') { |
if ($chome eq '') { |
%crsinfo = |
%crsinfo = |
&Apache::lonnet::courseiddump($dom,'.',1,'.','.', |
&Apache::lonnet::courseiddump($dom,'.',1,'.','.', |
$crs,undef,undef,'Course'); |
$crs,undef,undef,'.'); |
$chome = &Apache::lonnet::homeserver($crs,$dom); |
$chome = &Apache::lonnet::homeserver($crs,$dom); |
} |
} |
} |
} |
if ($name eq 'description' && defined($value)) { |
if ($name eq 'description' && defined($value)) { |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.description' => $value}); |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.description' => $value}); |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
$crsinfo{$env{'request.course.id'}}{'description'} = $value; |
$crsinfo{$env{'request.course.id'}}{'description'} = $value; |
my $putresult = |
my $putresult = |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
$chome,'notime'); |
$chome,'notime'); |
} |
} |
} |
} |
if ($name eq 'cloners') { |
if (($name eq 'cloners') || ($name eq 'hidefromcat') || ($name eq 'categories')) { |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { |
$crsinfo{$env{'request.course.id'}}{'cloners'} = $value; |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.'.$name => $value}); |
|
$crsinfo{$env{'request.course.id'}}{$name} = $value; |
my $putresult = |
my $putresult = |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
&Apache::lonnet::courseidput($dom,\%crsinfo, |
$chome,'notime'); |
$chome,'notime'); |
Line 2194 sub crsenv {
|
Line 2511 sub crsenv {
|
} |
} |
} |
} |
|
|
my $start_table =&Apache::loncommon::start_data_table(); |
|
my $start_header_row=&Apache::loncommon::start_data_table_header_row(); |
|
my $end_header_row =&Apache::loncommon::end_data_table_header_row(); |
|
# ------------------------- Re-init course environment entries for this session |
# ------------------------- Re-init course environment entries for this session |
|
|
&Apache::lonnet::coursedescription($env{'request.course.id'}, |
&Apache::lonnet::coursedescription($env{'request.course.id'}, |
Line 2208 sub crsenv {
|
Line 2522 sub crsenv {
|
my $SelectStyleFile=&mt('Select Style File'); |
my $SelectStyleFile=&mt('Select Style File'); |
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
my $SelectSpreadsheetFile=&mt('Select Spreadsheet File'); |
my $output=''; |
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'})) { |
if (! exists($values{'con_lost'})) { |
my %descriptions= |
my %descriptions= |
('url' => '<b>'.&mt('Top Level Map').'</b><br />'. |
('url' => '<b>'.&mt('Top Level Map').'</b><br />'. |
Line 2216 sub crsenv {
|
Line 2538 sub crsenv {
|
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
&mt('Select Map').'</a><br /><span class="LC_warning"> '. |
&mt('Modification may make assessment data inaccessible!'). |
&mt('Modification may make assessment data inaccessible!'). |
'</span>', |
'</span>', |
'description' => '<b>'.&mt('Course Description').'</b>', |
'description' => '<b>'.&mt('Course Title').'</b>', |
'courseid' => '<b>'.&mt('Course ID or number'). |
'courseid' => '<b>'.&mt('Course ID or number'). |
'</b><br />'. |
'</b><br />'. |
'('.&mt('internal, optional').')', |
'('.&mt('internal, optional').')', |
Line 2251 sub crsenv {
|
Line 2573 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 chat room use for Roles').'</b><br />' |
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"').')<br />' |
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"').')<br />' |
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
'plc.users.denied' => |
'plc.users.denied' => |
'<b>'.&mt('Disallow live chatroom use for Users').'</b><br />'. |
'<b>'.&mt('Disallow chat room use for Users').'</b><br />'. |
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
|
|
'pch.roles.denied'=> '<b>'.&mt('Disallow Resource Discussion for Roles').'</b><br />' |
'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>"') |
.'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"<tt>st</tt>"','"<tt>ta</tt>"','"<tt>in</tt>"') |
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
.'("<tt>'.&mt('role,role,...').'</tt>") ' |
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
.Apache::loncommon::help_open_topic("Course_Disable_Discussion"), |
'pch.users.denied' => |
'pch.users.denied' => |
'<b>'.&mt('Disallow Resource Discussion for Users').'</b><br />'. |
'<b>'.&mt('Disallow Resource Discussion for Users').'</b><br />'. |
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
'("<tt>'.&mt('user:domain,user:domain,...').'</tt>")', |
'spreadsheet_default_classcalc' |
'spreadsheet_default_classcalc' |
=> '<b>'.&mt('Default Course Spreadsheet').'</b> '. |
=> '<b>'.&mt('Default Course Spreadsheet').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_classcalc'". |
"('envform','spreadsheet_default_classcalc'". |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'spreadsheet_default_studentcalc' |
'spreadsheet_default_studentcalc' |
=> '<b>'.&mt('Default Student Spreadsheet').'</b><br />'. |
=> '<b>'.&mt('Default Student Spreadsheet').'</b><br />'. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_calc'". |
"('envform','spreadsheet_default_calc'". |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
",'spreadsheet')\">$SelectSpreadsheetFile</a><br />", |
'spreadsheet_default_assesscalc' |
'spreadsheet_default_assesscalc' |
=> '<b>'.&mt('Default Assessment Spreadsheet').'</b> '. |
=> '<b>'.&mt('Default Assessment Spreadsheet').'</b> '. |
'<a href="javascript:openbrowser'. |
'<a href="javascript:openbrowser'. |
"('envform','spreadsheet_default_assesscalc'". |
"('envform','spreadsheet_default_assesscalc'". |
Line 2307 sub crsenv {
|
Line 2629 sub crsenv {
|
'problem_stream_switch' |
'problem_stream_switch' |
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
=> '<b>'.&mt('Allow problems to be split over pages').'</b><br />'. |
' ('.&mt('[_1] if allowed, anything else if not','"<tt>yes</tt>"').')', |
' ('.&mt('[_1] if allowed, anything else if not','"<tt>yes</tt>"').')', |
'default_paper_size' |
'default_paper_size' |
=> '<b>'.&mt('Default paper type').'</b><br />'. |
=> '<b>'.&mt('Default paper type').'</b><br />'. |
' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. |
' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. |
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
'print_header_format' |
'print_header_format' |
=> ' <b>'.&mt('Print header format').'</b><br />' |
=> ' <b>'.&mt('Print header format').'</b><br />' |
Line 2334 sub crsenv {
|
Line 2656 sub crsenv {
|
'externalsyllabus' |
'externalsyllabus' |
=> '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>', |
=> '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>', |
'tthoptions' |
'tthoptions' |
=> '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>', |
=> '<b>'.&mt('Default set of options to pass to tth/m when converting TeX').'</b>', |
|
|
'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' |
|
=> '<b>'.&mt('Timezone in which the course takes place').'</b>', |
|
|
); |
'suppress_embed_prompt' |
my @Display_Order = ('url','description','courseid','cloners','grading', |
=> '<b>'.&mt('Suppress prompt to upload items referenced in a web page being uploaded to portfolio, when current role is student.').'</b><br />'. |
'externalsyllabus', |
' ('.&mt('[_1] to suppress, anything else to not suppress','"<tt>yes</tt>"').')', |
'default_xml_style','pageseparators', |
'hidefromcat' |
'question.email','question.email.text','comment.email','comment.email.text','policy.email','policy.email.text', |
=> '<b>'.&mt('Exclude from course catalog').'</b><br />'. |
'student_classlist_view', |
' ('.&mt('[_1] to exclude, anything else to include - included if assigned an institutional code, or manually catagorized','"<tt>yes</tt>"').')', |
'student_classlist_opt_in', |
'categories' |
'student_classlist_portfiles', |
=> '<b>'.&mt('Categorize course').'</b> <a href="javascript:catsbrowser()">'. |
'plc.roles.denied','plc.users.denied', |
&mt('Display Categories').'</a>', |
'pch.roles.denied','pch.users.denied', |
'datelocale' |
'allow_limited_html_in_feedback', |
=> '<b>'.&mt('Locale used for course calendar').'</b>', |
'allow_discussion_post_editing', |
'rolenames' |
'languages', |
=> '<b>'.&mt('Replacement titles for standard course roles').'</b><br />'. |
'nothideprivileged', |
'('.&mt('To replace the standard title for a course role, enter the title you wish to use, otherwise leave blank.').')', |
'rndseed', |
); |
'receiptalg', |
|
'problem_stream_switch', |
|
'suppress_tries', |
# ---------------------------------------------------------------- |
'default_paper_size', |
# Begin: New Version with Parameter Categories |
'print_header_format', |
|
'disable_receipt_display', |
sub parameter_row { |
'spreadsheet_default_classcalc', |
# Create parameter row for course environment screen |
'spreadsheet_default_studentcalc', |
|
'spreadsheet_default_assesscalc', |
my ($parameter, $description) = @_; |
'hideemptyrows', |
|
'default_enrollment_start_date', |
# Start Parameter Row |
'default_enrollment_end_date', |
my $output = &Apache::loncommon::start_data_table_row(); |
'tthoptions', |
|
'texengine', |
# Column 1/3: Descriptive text of current parameter |
'disablesigfigs', |
$output .= '<td>'.$description.'</td>'; |
'disableexampointprint', |
|
'task_messages','task_grading', |
# Column 2/3: Input field (Sometimes special field(s), depending on parameter) |
); |
|
foreach my $parameter (sort(keys(%values))) { |
# onchange is javascript to automatically check the 'Set' button. |
unless (($parameter =~ m/^internal\./)||($parameter =~ m/^metadata\./)) { |
my $onchange = 'onFocus="javascript:window.document.forms' |
if (! $descriptions{$parameter}) { |
."['envform'].elements['".$parameter."_setparmval']" |
$descriptions{$parameter}=$parameter; |
.'.checked=true;"'; |
push(@Display_Order,$parameter); |
|
} |
|
} |
|
} |
|
|
|
foreach my $parameter (@Display_Order) { |
|
my $description = $descriptions{$parameter}; |
|
# onchange is javascript to automatically check the 'Set' button. |
|
my $onchange = 'onFocus="javascript:window.document.forms'. |
|
"['envform'].elements['".$parameter."_setparmval']". |
|
'.checked=true;"'; |
|
$output .= &Apache::loncommon::start_data_table_row(). |
|
'<td>'.$description.'</td>'; |
|
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
if ($parameter =~ /^default_enrollment_(start|end)_date$/) { |
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::date_setter('envform', |
&Apache::lonhtmlcommon::date_setter('envform', |
Line 2397 sub crsenv {
|
Line 2708 sub crsenv {
|
$values{$parameter}, |
$values{$parameter}, |
$onchange). |
$onchange). |
'</td>'; |
'</td>'; |
} else { |
} elsif ($parameter eq 'timezone') { |
|
my $includeempty = 1; |
|
my $timezone = &Apache::lonlocal::gettimezone(); |
$output .= '<td>'. |
$output .= '<td>'. |
&Apache::lonhtmlcommon::textbox($parameter.'_value', |
&Apache::loncommon::select_timezone($parameter.'_value', |
$values{$parameter}, |
$timezone, |
40,$onchange).'</td>'; |
$onchange,$includeempty).'</td>'; |
} |
} elsif ($parameter eq 'datelocale') { |
$output .= '<td>'. |
my $includeempty = 1; |
&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
my $locale_obj = &Apache::lonlocal::getdatelocale(); |
'</td>'; |
my $currdatelocale; |
$output .= &Apache::loncommon::end_data_table_row()."\n"; |
if (ref($locale_obj)) { |
} |
$currdatelocale = $locale_obj->id(); |
my $onchange = 'onFocus="javascript:window.document.forms'. |
} |
'[\'envform\'].elements[\'newp_setparmval\']'. |
$output .= '<td>'. |
'.checked=true;"'; |
&Apache::loncommon::select_datelocale($parameter.'_value', |
$output.=&Apache::loncommon::start_data_table_row(). |
$currdatelocale, |
'<td><i>'.&mt('Create New Environment Variable').'</i><br />'. |
$onchange,$includeempty).'</td>'; |
'<input type="text" size=40 name="newp_name" '. |
} elsif ($parameter eq 'rolenames') { |
$onchange.' /></td><td>'. |
$output.= '<td><table>'; |
'<input type="text" size=40 name="newp_value" '. |
foreach my $role ('cc','in','ta','ep','ad','st') { |
$onchange.' /></td><td>'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
'<input type="checkbox" name="newp_setparmval" /></td>'. |
"['envform'].elements['". |
&Apache::loncommon::end_data_table_row()."\n"; |
$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); |
|
} |
|
} |
} |
} |
my %lt=&Apache::lonlocal::texthash( |
$parm_cat_parms{'cat_custom'} = [@custom_cats]; |
'par' => 'Parameter', |
|
'val' => 'Value', |
|
'set' => 'Set?', |
# Display Course Parameter Overview |
'sav' => 'Save' |
# Provide hyperlinks to detailed parameter settings |
); |
$output_SB .= '<a name="parmlist" />' |
|
.'<div class="LC_ContentBoxSpecial">' |
my $Parameter=&mt('Parameter'); |
.'<h2 class="LC_hcell">'.&mt('Course Parameter Overview').'</h2>' |
my $Value=&mt('Value'); |
.'<ul>'; |
my $Set=&mt('Set'); |
foreach my $catkey (@Display_Order) { |
my $browse_js= |
if (!@{$parm_cat_parms{$catkey}}) { next; } # Only display non-empty categories |
'<script type="text/javascript" language="Javascript">'. |
$output_SB .= '<li>' |
&Apache::loncommon::browser_and_searcher_javascript('parmset'). |
.'<a href="#parmlist_'.$catkey.'">' |
'</script>'; |
.$parm_cat_names{$catkey} |
|
.'</a>' |
my $start_page = |
.'</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', |
&Apache::loncommon::start_page('Set Course Environment', |
$browse_js); |
$jscript); |
my $end_page = |
my $end_page = |
&Apache::loncommon::end_page(); |
&Apache::loncommon::end_page(); |
my $end_table=&Apache::loncommon::end_data_table(); |
|
$r->print(<<ENDENV); |
$r->print(<<ENDENV); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
$setoutput |
$setoutput |
<div><input type="submit" name="crsenv" value="$lt{'sav'}" /></div> |
$output_SB |
$start_table |
|
$start_header_row |
|
<th>$lt{'par'}</th><th>$lt{'val'}</th><th>$lt{'set'}</th> |
|
$end_header_row |
|
$output |
|
$end_table |
|
<input type="submit" name="crsenv" value="$lt{'sav'}" /> |
|
</form> |
</form> |
$end_page |
$end_page |
ENDENV |
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 2541 sub storedata {
|
Line 3191 sub storedata {
|
$typeof=$env{'form.typeof_'.$thiskey}; |
$typeof=$env{'form.typeof_'.$thiskey}; |
$text = &mt('Saved modified date for'); |
$text = &mt('Saved modified date for'); |
} |
} |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if (defined($data) and $$olddata{$thiskey} ne $data) { |
if ($tuname) { |
if ($tuname) { |
if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, |
if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, |
$tkey.'.type' => $typeof}, |
$tkey.'.type' => $typeof}, |
Line 2556 sub storedata {
|
Line 3206 sub storedata {
|
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
&Apache::lonnet::devalidateuserresdata($tuname,$tudom); |
} else { |
} else { |
$newdata{$thiskey}=$data; |
$newdata{$thiskey}=$data; |
$newdata{$thiskey.'.type'}=$typeof; |
$newdata{$thiskey.'.type'}=$typeof; |
} |
} |
} |
} |
} elsif ($cmd eq 'del') { |
} elsif ($cmd eq 'del') { |
if ($tuname) { |
if ($tuname) { |
Line 2611 sub parse_listdata_key {
|
Line 3261 sub parse_listdata_key {
|
my ($key,$listdata) = @_; |
my ($key,$listdata) = @_; |
# split into student/section affected, and |
# split into student/section affected, and |
# the realm (folder/resource part and parameter |
# the realm (folder/resource part and parameter |
my ($student,$realm) = |
my ($student,$realm) = |
($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/); |
($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/); |
# if course wide student would be undefined |
# if course wide student would be undefined |
if (!defined($student)) { |
if (!defined($student)) { |
Line 2652 sub listdata {
|
Line 3302 sub listdata {
|
if ($sortorder eq 'realmstudent') { |
if ($sortorder eq 'realmstudent') { |
if ($ares ne $bres ) { |
if ($ares ne $bres ) { |
$result = ($ares cmp $bres); |
$result = ($ares cmp $bres); |
} elsif ($astudent ne $bstudent) { |
} elsif ($astudent ne $bstudent) { |
$result = ($astudent cmp $bstudent); |
$result = ($astudent cmp $bstudent); |
} elsif ($apart ne $bpart ) { |
} elsif ($apart ne $bpart ) { |
$result = ($apart cmp $bpart); |
$result = ($apart cmp $bpart); |
} |
} |
} else { |
} else { |
if ($astudent ne $bstudent) { |
if ($astudent ne $bstudent) { |
$result = ($astudent cmp $bstudent); |
$result = ($astudent cmp $bstudent); |
} elsif ($ares ne $bres ) { |
} elsif ($ares ne $bres ) { |
$result = ($ares cmp $bres); |
$result = ($ares cmp $bres); |
Line 2666 sub listdata {
|
Line 3316 sub listdata {
|
$result = ($apart cmp $bpart); |
$result = ($apart cmp $bpart); |
} |
} |
} |
} |
|
|
if (!$result) { |
if (!$result) { |
if (defined($aparm) && defined($bparm)) { |
if (defined($aparm) && defined($bparm)) { |
$result = ($aparm <=> $bparm); |
$result = ($aparm <=> $bparm); |
Line 2731 sub listdata {
|
Line 3381 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 2752 sub listdata {
|
Line 3402 sub listdata {
|
$$resourcedata{$thiskey}, |
$$resourcedata{$thiskey}, |
'',1,'',''). |
'',1,'',''). |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'. |
(($$resourcedata{$thiskey}!=0)?'<a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
(($$resourcedata{$thiskey}!=0)?'<span class="LC_nobreak"><a href="/adm/parmset?&action=dateshift1&timebase='.$$resourcedata{$thiskey}.'">'. |
&mt('Shift all dates based on this date').'</a>':''). |
&mt('Shift all dates based on this date').'</a></span>':''). |
&date_sanity_info($$resourcedata{$thiskey}) |
&date_sanity_info($$resourcedata{$thiskey}) |
); |
); |
} elsif ($thistype eq 'date_interval') { |
} elsif ($thistype eq 'date_interval') { |
Line 2766 sub listdata {
|
Line 3416 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 2816 sub default_selector {
|
Line 3466 sub default_selector {
|
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'" />'; |
return '<input type="text" name="set_'.$thiskey.'" value="'.$showval.'" />'; |
} |
} |
|
|
my %strings = |
my %strings = |
( |
( |
'string_yesno' |
'string_yesno' |
=> [[ 'yes', 'Yes' ], |
=> [[ 'yes', 'Yes' ], |
Line 2831 my %strings =
|
Line 3481 my %strings =
|
|
|
sub string_selector { |
sub string_selector { |
my ($thistype, $thiskey, $showval) = @_; |
my ($thistype, $thiskey, $showval) = @_; |
|
|
if (!exists($strings{$thistype})) { |
if (!exists($strings{$thistype})) { |
return &default_selector($thiskey,$showval); |
return &default_selector($thiskey,$showval); |
} |
} |
Line 2889 sub newoverview {
|
Line 3539 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 2922 ENDOVER
|
Line 3574 ENDOVER
|
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); |
if (!@psprt) { $psprt[0]='0'; } |
if (!@psprt) { $psprt[0]='0'; } |
|
|
my @selected_sections = |
my @selected_sections = |
&Apache::loncommon::get_env_multiple('form.Section'); |
&Apache::loncommon::get_env_multiple('form.Section'); |
@selected_sections = ('all') if (! @selected_sections); |
@selected_sections = ('all') if (! @selected_sections); |
foreach my $sec (@selected_sections) { |
foreach my $sec (@selected_sections) { |
Line 2935 ENDOVER
|
Line 3587 ENDOVER
|
|
|
my $pssymb=''; |
my $pssymb=''; |
my $parmlev=''; |
my $parmlev=''; |
|
|
unless ($env{'form.parmlev'}) { |
unless ($env{'form.parmlev'}) { |
$parmlev = 'map'; |
$parmlev = 'map'; |
} else { |
} else { |
$parmlev = $env{'form.parmlev'}; |
$parmlev = $env{'form.parmlev'}; |
} |
} |
|
|
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%keyorder,\%defkeytype); |
\%keyorder,\%defkeytype); |
|
|
Line 2951 ENDOVER
|
Line 3603 ENDOVER
|
} |
} |
# Menu to select levels, etc |
# Menu to select levels, etc |
|
|
$r->print('<table id="LC_parm_overview_scope"> |
#$r->print('<table id="LC_parm_overview_scope"> |
<tr><td class="LC_parm_overview_level_menu">'); |
# <tr><td class="LC_parm_overview_level_menu">'); |
|
$r->print('<div class="LC_ContentBoxSpecial">'); |
|
#$r->print('<h2 class="LC_hcell">Step 1</h2>'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&levelmenu($r,\%alllevs,$parmlev); |
&levelmenu($r,\%alllevs,$parmlev); |
if ($parmlev ne 'general') { |
if ($parmlev ne 'general') { |
$r->print('<td class="LC_parm_overview_map_menu">'); |
#$r->print('<td class="LC_parm_overview_map_menu">'); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
&mapmenu($r,\%allmaps,$pschp,\%maptitles); |
$r->print('</td>'); |
#$r->print('</td>'); |
} |
} |
$r->print('</td></tr></table>'); |
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('</div></div>'); |
$r->print('<table id="LC_parm_overview_controls"> |
#$r->print('</td></tr></table>'); |
<tr><td class="LC_parm_overview_parm_selectors">'); |
|
|
#$r->print('<table id="LC_parm_overview_controls"> |
|
# <tr><td class="LC_parm_overview_parm_selectors">'); |
|
$r->print('<div class="LC_ContentBoxSpecial">'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
|
$r->print(&Apache::lonhtmlcommon::start_pick_box()); |
&parmmenu($r,\%allparms,\@pscat,\%keyorder); |
&parmmenu($r,\%allparms,\@pscat,\%keyorder); |
$r->print('</td><td class="LC_parm_overview_restrictions"> |
|
<table class="LC_parm_overview_restrictions">'. |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); |
|
#$r->print('</td><td class="LC_parm_overview_restrictions">'. |
|
$r->print('<table>'. |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
'<tr><th>'.&mt('Parts').'</th><th>'.&mt('Section(s)'). |
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
'</th><th>'.&mt('Group(s)').'</th></tr><tr><td>'); |
&partmenu($r,\%allparts,\@psprt); |
&partmenu($r,\%allparts,\@psprt); |
Line 2974 ENDOVER
|
Line 3637 ENDOVER
|
$r->print('</td><td>'); |
$r->print('</td><td>'); |
&groupmenu($r,\@selected_groups); |
&groupmenu($r,\@selected_groups); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
$r->print('</td></tr></table>'); |
#$r->print('</td></tr></table>'); |
|
$r->print(&Apache::lonhtmlcommon::end_pick_box()); |
|
$r->print('</div></div>'); |
|
|
|
$r->print('<div class="LC_ContentBoxSpecial">'); |
|
$r->print('<div class="LC_BoxPadding">' ); |
my $sortorder=$env{'form.sortorder'}; |
my $sortorder=$env{'form.sortorder'}; |
unless ($sortorder) { $sortorder='realmstudent'; } |
unless ($sortorder) { $sortorder='realmstudent'; } |
&sortmenu($r,$sortorder); |
&sortmenu($r,$sortorder); |
|
$r->print('</div></div>'); |
|
|
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>'); |
$r->print('<p><input type="submit" name="dis" value="'.&mt('Display').'" /></p>'); |
|
|
Line 3049 sub overview {
|
Line 3717 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 3074 ENDOVER
|
Line 3744 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 3083 sub clean_parameters {
|
Line 3753 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 3103 ENDOVER
|
Line 3775 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 3119 ENDOVER
|
Line 3791 ENDOVER
|
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<tr>'. |
'<tr>'. |
'<td><input type="checkbox" name="del_'.$thiskey.'" /></td>' ); |
'<td><input type="checkbox" name="del_'.$thiskey.'" /></td>' ); |
|
|
$r->print('<td>'); |
$r->print('<td>'); |
my $display_value = $resourcedata->{$thiskey}; |
my $display_value = $resourcedata->{$thiskey}; |
if (&isdateparm($resourcedata->{$thiskey.'.type'})) { |
if (&isdateparm($resourcedata->{$thiskey.'.type'})) { |
$display_value = |
$display_value = |
&Apache::lonlocal::locallocaltime($display_value); |
&Apache::lonlocal::locallocaltime($display_value); |
} |
} |
$r->print(&mt('Parameter: "[_1]" with value: "[_2]"', |
$r->print(&mt('Parameter: "[_1]" with value: "[_2]"', |
Line 3152 ENDOVER
|
Line 3824 ENDOVER
|
} |
} |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print(' <br /> '.&mt('Part: [_1]',$data{'parameter_part'})); |
$r->print('</td></tr>'); |
$r->print('</td></tr>'); |
|
|
} |
} |
} |
} |
$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 3166 sub date_shift_one {
|
Line 3838 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 3191 sub date_shift_two {
|
Line 3865 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 3238 sub parse_key {
|
Line 3914 sub parse_key {
|
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'}); |
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'}); |
$data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url); |
$data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url); |
} |
} |
|
|
$data{'parameter_part'} = $part; |
$data{'parameter_part'} = $part; |
$data{'parameter_name'} = $name; |
$data{'parameter_name'} = $name; |
|
|
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 3312 sub check_cloners {
|
Line 3954 sub check_cloners {
|
$disallowed{'format'} .= $currclone.','; |
$disallowed{'format'} .= $currclone.','; |
} |
} |
} elsif ($currclone !~/^($match_username)\:($match_domain)$/) { |
} elsif ($currclone !~/^($match_username)\:($match_domain)$/) { |
$disallowed{'format'} .= $currclone.','; |
$disallowed{'format'} .= $currclone.','; |
} else { |
} else { |
if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
$disallowed{'newuser'} .= $currclone.','; |
$disallowed{'newuser'} .= $currclone.','; |
Line 3341 sub change_clone {
|
Line 3983 sub change_clone {
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $clone_crs = $cnum.':'.$cdom; |
my $clone_crs = $cnum.':'.$cdom; |
|
|
if ($cnum && $cdom) { |
if ($cnum && $cdom) { |
my @allowclone; |
my @allowclone; |
&extract_cloners($clonelist,\@allowclone); |
&extract_cloners($clonelist,\@allowclone); |
Line 3396 sub change_clone {
|
Line 4038 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 3427 ENDMAINFORMHEAD
|
Line 4060 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 3518 sub output_row {
|
Line 4152 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 3542 sub output_row {
|
Line 4176 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 3605 sub order_meta_fields {
|
Line 4244 sub order_meta_fields {
|
} |
} |
my $ordered_fields = join ",", @neworder; |
my $ordered_fields = join ",", @neworder; |
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields}); |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields}); |
} |
} |
my $fields = &get_added_meta_fieldnames($env{'request.course.id'}); |
my $fields = &get_added_meta_fieldnames($env{'request.course.id'}); |
Line 3618 sub order_meta_fields {
|
Line 4257 sub order_meta_fields {
|
$ordered_fields = join ",", @fields_in_order; |
$ordered_fields = join ",", @fields_in_order; |
} |
} |
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
} |
} |
$r->print('<table>'); |
$r->print('<table>'); |
my $num_fields = scalar(@fields_in_order); |
my $num_fields = scalar(@fields_in_order); |
foreach my $key (@fields_in_order) { |
foreach my $key (@fields_in_order) { |
Line 3643 sub order_meta_fields {
|
Line 4282 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 3650 sub continue {
|
Line 4291 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 3664 sub addmetafield {
|
Line 4309 sub addmetafield {
|
$options =~ s/,,/,/; |
$options =~ s/,,/,/; |
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{'metadata.'.$meta_field.'.options'=>$options},$dom,$crs); |
{'metadata.'.$meta_field.'.options'=>$options},$dom,$crs); |
|
|
$r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />'); |
$r->print('Undeleted Metadata Field <strong>'.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}."</strong> with result ".$put_result.'<br />'); |
} |
} |
$r->print(&continue()); |
$r->print(&continue()); |
Line 3696 sub addmetafield {
|
Line 4341 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 3718 sub setrestrictmeta {
|
Line 4368 sub setrestrictmeta {
|
$save_field = $meta_field; |
$save_field = $meta_field; |
if ($env{'form.'.$meta_field.'_stuadd'}) { |
if ($env{'form.'.$meta_field.'_stuadd'}) { |
$options.='stuadd,'; |
$options.='stuadd,'; |
} |
} |
if ($env{'form.'.$meta_field.'_choices'}) { |
if ($env{'form.'.$meta_field.'_choices'}) { |
$options.='choices,'; |
$options.='choices,'; |
} |
} |
if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') { |
if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') { |
$options.='onlyone,'; |
$options.='onlyone,'; |
} |
} |
if ($env{'form.'.$meta_field.'_active'}) { |
if ($env{'form.'.$meta_field.'_active'}) { |
$options.='active,'; |
$options.='active,'; |
} |
} |
Line 3770 ENDButtons
|
Line 4420 ENDButtons
|
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
} |
} |
$output .= &Apache::loncommon::end_data_table(); |
$output .= &Apache::loncommon::end_data_table(); |
$r->print(<<ENDenv); |
$r->print(<<ENDenv); |
<form method="post" action="/adm/parmset?action=setrestrictmeta" name="form"> |
<form method="post" action="/adm/parmset?action=setrestrictmeta" name="form"> |
$output |
$output |
$buttons |
$buttons |
Line 3779 ENDenv
|
Line 4429 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 3792 sub get_added_meta_fieldnames {
|
Line 4444 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 3809 sub get_deleted_meta_fieldnames {
|
Line 4464 sub get_deleted_meta_fieldnames {
|
sub defaultsetter { |
sub defaultsetter { |
my ($r) = @_; |
my ($r) = @_; |
|
|
my $start_page = |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', |
|
text=>"Set Defaults"}); |
|
my $start_page = |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
&Apache::loncommon::start_page('Parameter Setting Default Actions'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); |
$r->print(<<ENDDEFHEAD); |
$r->print(<<ENDDEFHEAD); |
Line 3833 ENDDEFHEAD
|
Line 4490 ENDDEFHEAD
|
my %keyorder=&standardkeyorder(); |
my %keyorder=&standardkeyorder(); |
my %defkeytype=(); |
my %defkeytype=(); |
|
|
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%mapp, \%symbp,\%maptitles,\%uris, |
\%keyorder,\%defkeytype); |
\%keyorder,\%defkeytype); |
if ($env{'form.storerules'}) { |
if ($env{'form.storerules'}) { |
Line 3896 ENDDEFHEAD
|
Line 4553 ENDDEFHEAD
|
push @datedisplay,&mt('Automatically set later than ').$tempkey; |
push @datedisplay,&mt('Automatically set later than ').$tempkey; |
push @dateoptions,'earlier_than_'.$tempkey; |
push @dateoptions,'earlier_than_'.$tempkey; |
push @datedisplay,&mt('Automatically set earlier than ').$tempkey; |
push @datedisplay,&mt('Automatically set earlier than ').$tempkey; |
} |
} |
} |
} |
$r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'. |
$r->print(&mt('Manual setting rules apply to all interfaces.').'<br />'. |
&mt('Automatic setting rules apply to table mode interfaces only.')); |
&mt('Automatic setting rules apply to table mode interfaces only.')); |
Line 3947 ENDINPUTDATE
|
Line 4604 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 3960 ENDYESNO
|
Line 4617 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 3990 sub components {
|
Line 4647 sub components {
|
$issection=''; |
$issection=''; |
} |
} |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
my $realm='<span class="LC_parm_scope_all">'.&mt('All Resources').'</span>'; |
my $realmdescription=&mt('all resources'); |
my $realmdescription=&mt('all resources'); |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
if ($middle=~/^(.+)\_\_\_\(all\)$/) { |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <span class="LC_parm_folder"><br />('.$1.')</span></span>'; |
$realm='<span class="LC_parm_scope_folder">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' <span class="LC_parm_folder"><br />('.$1.')</span></span>'; |
$realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1); |
$realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1); |
Line 4005 sub components {
|
Line 4662 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 4019 sub load_parameter_names {
|
Line 4678 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); |
%standard_parms=&Apache::lonlocal::texthash(%standard_parms); |
} |
} |
|
|
sub standard_parameter_names { |
sub standard_parameter_names { |
Line 4028 sub standard_parameter_names {
|
Line 4687 sub standard_parameter_names {
|
&load_parameter_names(); |
&load_parameter_names(); |
} |
} |
if ($standard_parms{$name}) { |
if ($standard_parms{$name}) { |
return $standard_parms{$name}; |
return $standard_parms{$name}; |
} else { |
} else { |
return $name; |
return $name; |
} |
} |
} |
} |
|
|
# |
|
# 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 4052 sub parm_change_log {
|
Line 4710 sub parm_change_log {
|
|
|
$r->print('<form action="/adm/parmset?action=parameterchangelog" |
$r->print('<form action="/adm/parmset?action=parameterchangelog" |
method="post" name="parameterlog">'); |
method="post" name="parameterlog">'); |
|
|
my %saveable_parameters = ('show' => 'scalar',); |
my %saveable_parameters = ('show' => 'scalar',); |
&Apache::loncommon::store_course_settings('parameter_log', |
&Apache::loncommon::store_course_settings('parameter_log', |
\%saveable_parameters); |
\%saveable_parameters); |
Line 4080 sub parm_change_log {
|
Line 4738 sub parm_change_log {
|
} |
} |
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } |
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } |
} |
} |
foreach my $id (sort |
foreach my $id (sort |
{ |
{ |
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { |
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { |
return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'} |
return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'} |
Line 4093 sub parm_change_log {
|
Line 4751 sub parm_change_log {
|
my $count = 0; |
my $count = 0; |
my $time = |
my $time = |
&Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'}); |
&Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'}); |
my $plainname = |
my $plainname = |
&Apache::loncommon::plainname($parmlog{$id}{'exe_uname'}, |
&Apache::loncommon::plainname($parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $about_me_link = |
my $about_me_link = |
&Apache::loncommon::aboutmewrapper($plainname, |
&Apache::loncommon::aboutmewrapper($plainname, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $send_msg_link=''; |
my $send_msg_link=''; |
if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) |
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
$send_msg_link ='<br />'. |
$send_msg_link ='<br />'. |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
Line 4124 sub parm_change_log {
|
Line 4782 sub parm_change_log {
|
} |
} |
} |
} |
if ($typeflag) { |
if ($typeflag) { |
$istype{$parmname}=$value; |
$istype{$parmname}=$value; |
if (!$env{'form.includetypes'}) { next; } |
if (!$env{'form.includetypes'}) { next; } |
} |
} |
$count++; |
$count++; |
if ($makenewrow) { |
if ($makenewrow) { |
Line 4163 sub parm_change_log {
|
Line 4821 sub parm_change_log {
|
my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription, |
my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$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 .= |
&Apache::loncommon::messagewrapper('Notify User', |
&Apache::loncommon::messagewrapper('Notify User', |
$uname,$udom,$title, |
$uname,$udom,$title, |
$description); |
$description); |
} else { |
} else { |
$output .= |
$output .= |
&Apache::lonrss::course_blog_link($id,$title, |
&Apache::lonrss::course_blog_link($id,$title, |
$description); |
$description); |
} |
} |
Line 4179 sub parm_change_log {
|
Line 4837 sub parm_change_log {
|
my $wholeentry=$about_me_link.':'. |
my $wholeentry=$about_me_link.':'. |
$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'. |
$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'. |
$output; |
$output; |
if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } |
if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } |
} |
} |
if ($count) { |
if ($count) { |
$r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td> |
$r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td> |
Line 4189 sub parm_change_log {
|
Line 4847 sub parm_change_log {
|
$send_msg_link.'</td>'.$output); |
$send_msg_link.'</td>'.$output); |
$shown++; |
$shown++; |
} |
} |
if (!($env{'form.show'} eq &mt('all') |
if (!($env{'form.show'} eq &mt('all') |
|| $shown<=$env{'form.show'})) { last; } |
|| $shown<=$env{'form.show'})) { last; } |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
|
sub update_slots { |
|
my ($slot_name,$cdom,$cnum,$symb,$uname,$udom) = @_; |
|
my %slot=&Apache::lonnet::get_slot($slot_name); |
|
if (!keys(%slot)) { |
|
return 'error: slot does not exist'; |
|
} |
|
my $max=$slot{'maxspace'}; |
|
if (!defined($max)) { $max=99999; } |
|
|
|
my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, |
|
"^$slot_name\0"); |
|
my ($tmp)=%consumed; |
|
if ($tmp=~/^error: 2 / ) { |
|
return 'error: unable to determine current slot status'; |
|
} |
|
my $last=0; |
|
foreach my $key (keys(%consumed)) { |
|
my $num=(split('\0',$key))[1]; |
|
if ($num > $last) { $last=$num; } |
|
if ($consumed{$key}->{'name'} eq $uname.':'.$udom) { |
|
return 'ok'; |
|
} |
|
} |
|
|
|
if (scalar(keys(%consumed)) >= $max) { |
|
return 'error: no space left in slot'; |
|
} |
|
my $wanted=$last+1; |
|
|
|
my %reservation=('name' => $uname.':'.$udom, |
|
'timestamp' => time, |
|
'symb' => $symb); |
|
|
|
my $success=&Apache::lonnet::newput('slot_reservations', |
|
{"$slot_name\0$wanted" => |
|
\%reservation}, |
|
$cdom, $cnum); |
|
if ($success eq 'ok') { |
|
my %storehash = ( |
|
symb => $symb, |
|
slot => $slot_name, |
|
action => 'reserve', |
|
context => 'parameter', |
|
); |
|
&Apache::lonnet::instructor_log('slotreservationslog',\%storehash, |
|
'',$uname,$udom,$cnum,$cdom); |
|
|
|
&Apache::lonnet::instructor_log($cdom.'_'.$cnum.'_slotlog',\%storehash, |
|
'',$uname,$udom,$uname,$udom); |
|
} |
|
return $success; |
|
} |
|
|
|
sub delete_slots { |
|
my ($slot_name,$cdom,$cnum,$uname,$udom,$symb) = @_; |
|
my $delresult; |
|
my %consumed = &Apache::lonnet::dump('slot_reservations',$cdom, |
|
$cnum, "^$slot_name\0"); |
|
if (&Apache::lonnet::error(%consumed)) { |
|
return 'error: unable to determine current slot status'; |
|
} |
|
my ($tmp)=%consumed; |
|
if ($tmp=~/^error: 2 /) { |
|
return 'error: unable to determine current slot status'; |
|
} |
|
foreach my $key (keys(%consumed)) { |
|
if ($consumed{$key}->{'name'} eq $uname.':'.$udom) { |
|
my $num=(split('\0',$key))[1]; |
|
my $entry = $slot_name.'\0'.$num; |
|
$delresult = &Apache::lonnet::del('slot_reservations',[$entry], |
|
$cdom,$cnum); |
|
if ($delresult eq 'ok') { |
|
my %storehash = ( |
|
symb => $symb, |
|
slot => $slot_name, |
|
action => 'release', |
|
context => 'parameter', |
|
); |
|
&Apache::lonnet::instructor_log('slotreservationslog',\%storehash, |
|
1,$uname,$udom,$cnum,$cdom); |
|
&Apache::lonnet::instructor_log($cdom.'_'.$cnum.'_slotlog',\%storehash, |
|
1,$uname,$udom,$uname,$udom); |
|
} |
|
} |
|
} |
|
return $delresult; |
|
} |
|
|
sub check_for_course_info { |
sub check_for_course_info { |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
return 1 if ($navmap); |
return 1 if ($navmap); |
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 4239 sub handler {
|
Line 4971 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 4249 sub handler {
|
Line 4982 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 4262 sub handler {
|
Line 4989 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', |
&crsenv($r); |
text=>"Course Environment"}); |
} elsif ($env{'form.action'} eq 'setoverview') { |
&crsenv($r); |
|
} elsif ($env{'form.action'} eq 'setoverview' && $parm_permission) { |
|
&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') { |
|
&assign_course_categories($r); |
|
} |
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |
if ($exists) { |
if ($exists) { |
Line 4339 sub handler {
|
Line 5038 sub handler {
|
1; |
1; |
__END__ |
__END__ |
|
|
=pod |
|
|
|
=back |
|
|
|
=cut |
|
|
|
|
|
|
|