--- loncom/interface/lonparmset.pm 2002/08/29 03:57:45 1.61.2.1 +++ loncom/interface/lonparmset.pm 2002/12/09 22:27:20 1.80 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.61.2.1 2002/08/29 03:57:45 albertel Exp $ +# $Id: lonparmset.pm,v 1.80 2002/12/09 22:27:20 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -87,9 +87,23 @@ my $coursename; Figure out a cascading parameter. -Inputs: $what $id $def - -Returns: I am not entirely sure. +Inputs: $what - a parameter spec (incluse part info and name I.E. 0.weight) + $id - a bighash Id number + $def - the resource's default value 'stupid emacs + +Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 11 possible levels + +11- resource default +10- map default +9 - General Course +8 - Map level in course +7 - resource level in course +6 - General for section +5 - Map level for section +4 - resource level in section +3 - General for specific student +2 - Map level for specific student +1 - resource level for specific student =cut @@ -123,32 +137,32 @@ sub parmval { # --------------------------------------------------------- third, check course - if ($courseopt{$courselevel}) { + if (defined($courseopt{$courselevel})) { $outpar[9]=$courseopt{$courselevel}; $result=9; } - if ($courseopt{$courselevelm}) { + if (defined($courseopt{$courselevelm})) { $outpar[8]=$courseopt{$courselevelm}; $result=8; } - if ($courseopt{$courselevelr}) { + if (defined($courseopt{$courselevelr})) { $outpar[7]=$courseopt{$courselevelr}; $result=7; } - if ($csec) { - if ($courseopt{$seclevel}) { + if (defined($csec)) { + if (defined($courseopt{$seclevel})) { $outpar[6]=$courseopt{$seclevel}; $result=6; } - if ($courseopt{$seclevelm}) { + if (defined($courseopt{$seclevelm})) { $outpar[5]=$courseopt{$seclevelm}; $result=5; } - if ($courseopt{$seclevelr}) { + if (defined($courseopt{$seclevelr})) { $outpar[4]=$courseopt{$seclevelr}; $result=4; } @@ -156,23 +170,22 @@ sub parmval { # ---------------------------------------------------------- fourth, check user - if ($uname) { - if ($useropt{$courselevel}) { + if (defined($uname)) { + if (defined($useropt{$courselevel})) { $outpar[3]=$useropt{$courselevel}; $result=3; } - if ($useropt{$courselevelm}) { + if (defined($useropt{$courselevelm})) { $outpar[2]=$useropt{$courselevelm}; $result=2; } - if ($useropt{$courselevelr}) { + if (defined($useropt{$courselevelr})) { $outpar[1]=$useropt{$courselevelr}; $result=1; } } - return ($result,@outpar); } @@ -199,9 +212,32 @@ sub valout { my $result = ''; # Values of zero are valid. if (! $value && $value ne '0') { - $result = '  '; + $result = '  '; } else { - if ($type=~/^date/) { + if ($type eq 'date_interval') { + my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value); + $year=$year-70; + $mday--; + if ($year) { + $result.=$year.' yrs '; + } + if ($mon) { + $result.=$mon.' mths '; + } + if ($mday) { + $result.=$mday.' days '; + } + if ($hour) { + $result.=$hour.' hrs '; + } + if ($min) { + $result.=$min.' mins '; + } + if ($sec) { + $result.=$sec.' secs '; + } + $result=~s/\s+$//; + } elsif ($type=~/^date/) { $result = localtime($value); } else { $result = $value; @@ -249,6 +285,9 @@ sub startpage { my ($r,$id,$udom,$csec,$uname)=@_; $r->content_type('text/html'); $r->send_http_header; + + my $bodytag=&Apache::loncommon::bodytag('Set Course Parameters','', + 'onUnload="pclose()"'); $r->print(< @@ -303,9 +342,7 @@ sub startpage { } - -

Set Course Parameters for Course: -$ENV{'course.'.$ENV{'request.course.id'}.'.description'}

+$bodytag

Course Environment

@@ -331,10 +368,27 @@ ENDHEAD } sub print_row { - my ($r,$which,$part,$name,$rid,$default,$type,$display,$defbgone, + my ($r,$which,$part,$name,$rid,$default,$defaulttype,$display,$defbgone, $defbgtwo,$parmlev)=@_; +# get the values for the parameter in cascading order +# empty levels will remain empty my ($result,@outpar)=&parmval($$part{$which}.'.'.$$name{$which}, $rid,$$default{$which}); +# get the type for the parameters +# problem: these may not be set for all levels + my ($typeresult,@typeoutpar)=&parmval($$part{$which}.'.'. + $$name{$which}.'.type', + $rid,$$defaulttype{$which}); +# cascade down manually + my $cascadetype=$defaulttype; + for (my $i=$#typeoutpar;$i>0;$i--) { + if ($typeoutpar[$i]) { + $cascadetype=$typeoutpar[$i]; + } else { + $typeoutpar[$i]=$cascadetype; + } + } + my $parm=$$display{$which}; if ($parmlev eq 'full' || $parmlev eq 'brief') { @@ -353,73 +407,79 @@ sub print_row { if ($parmlev eq 'general') { if ($uname) { - &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } elsif ($csec) { - &print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } else { - &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } elsif ($parmlev eq 'map') { if ($uname) { - &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } elsif ($csec) { - &print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } else { - &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } else { - &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); if ($parmlev eq 'brief') { - &print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); if ($csec) { - &print_td($r,4,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,4,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } if ($uname) { - &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } else { - &print_td($r,10,'#FFDDDD',$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,10,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); if ($csec) { - &print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,4,$defbgtwo,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,4,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } if ($uname) { - &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); - &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,$type,$display); + &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } # end of $brief if/else } # end of $parmlev if/else if ($parmlev eq 'full' || $parmlev eq 'brief') { $r->print(''. - &valout($outpar[$result],$$type{$which}).''); + &valout($outpar[$result],$typeoutpar[$result]).''); } my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}. '.'.$$name{$which},$symbp{$rid}); +# this doesn't seem to work, and I don't think is correct +# my $sessionvaltype=&Apache::lonnet::EXT('resource.'.$$part{$which}. +# '.'.$$name{$which}.'.type',$symbp{$rid}); +# this seems to work + my $sessionvaltype=$typeoutpar[$result]; + if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; } $r->print(''. - &valout($sessionval,$$type{$which}).' '. + &valout($sessionval,$sessionvaltype).' '. ''); $r->print(''); $r->print("\n"); } sub print_td { - my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$type,$display)=@_; + my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_; $r->print(''. - &plink($$type{$value},$$display{$value},$$outpar[$which], + &plink($$typeoutpar[$which],$$display{$value},$$outpar[$which], $mprefix."$which",'parmform.pres','psub').''."\n"); } @@ -437,6 +497,102 @@ sub get_env_multiple { return(@values); } +=pod + +=item B: 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: An array that will contain all of the ids in the course. + +=item B: hash, id->type, where "type" contains the extension of the file, thus, I. + +=item B: hash, id->key list, will contain a comma seperated list of the meta-data keys available for the given id + +=item B: hash, name of parameter->display value (what is the display value?) + +=item B: hash, part identification->text representation of part, where the text representation is "[Part $part]" + +=item B: hash, full key to part->display value (what's display value?) + +=item B: hash, ??? + +=item B: ??? + +=item B: hash, ??? + +=item B: ?? + +=item B: hash, id->full sym? + +=back + +=cut + +sub extractResourceInformation { + my $bighash = shift; + my $ids = shift; + my $typep = shift; + my $keyp = shift; + my $allparms = shift; + my $allparts = shift; + my $allkeys = shift; + my $allmaps = shift; + my $fcat = shift; + my $defp = shift; + my $mapp = shift; + my $symbp = shift; + + foreach (keys %$bighash) { + if ($_=~/^src\_(\d+)\.(\d+)$/) { + my $mapid=$1; + my $resid=$2; + my $id=$mapid.'.'.$resid; + my $srcf=$$bighash{$_}; + if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) { + $$ids[$#$ids+1]=$id; + $$typep{$id}=$1; + $$keyp{$id}=''; + foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { + if ($_=~/^parameter\_(.*)/) { + my $key=$_; + my $allkey=$1; + $allkey=~s/\_/\./g; + my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); + my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); + my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); + my $parmdis = $display; + $parmdis =~ s|(\[Part.*$)||g; + my $partkey = $part; + $partkey =~ tr|_|.|; + $$allparms{$name} = $parmdis; + $$allparts{$part} = "[Part $part]"; + $$allkeys{$allkey}=$display; + if ($allkey eq $fcat) { + $$defp{$id}= &Apache::lonnet::metadata($srcf,$key); + } + if ($$keyp{$id}) { + $$keyp{$id}.=','.$key; + } else { + $$keyp{$id}=$key; + } + } + } + $$mapp{$id}= + &Apache::lonnet::declutter($$bighash{'map_id_'.$mapid}); + $$mapp{$mapid}=$$mapp{$id}; + $$allmaps{$mapid}=$$mapp{$id}; + $$symbp{$id}=$$mapp{$id}. + '___'.$resid.'___'. + &Apache::lonnet::declutter($srcf); + $$symbp{$mapid}=$$mapp{$id}.'___(all)'; + } + } + } +} + ################################################## ################################################## @@ -451,6 +607,18 @@ Inputs: $r Returns: nothing +Variables used (guessed by Jeremy): + +=over 4 + +=item B: 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: ParameterS PaRTs? a list of the parts of a problem that we are displaying? Used to display only selected parts? + +=item B: + +=back + =cut ################################################## @@ -489,6 +657,7 @@ sub assessparms { my @pscat=&get_env_multiple('form.pscat'); my $pschp=$ENV{'form.pschp'}; my @psprt=&get_env_multiple('form.psprt'); + if (!@psprt) { $psprt[0]='0'; } my $showoptions=$ENV{'form.showoptions'}; my $pssymb=''; @@ -580,53 +749,10 @@ sub assessparms { $r->print("Unable to access parameter data. (File $ENV{'request.course.fn'}_parms.db not tieable)"); return ; } + # --------------------------------------------------------- Get all assessments - foreach (keys %bighash) { - if ($_=~/^src\_(\d+)\.(\d+)$/) { - my $mapid=$1; - my $resid=$2; - my $id=$mapid.'.'.$resid; - my $srcf=$bighash{$_}; - if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) { - $ids[$#ids+1]=$id; - $typep{$id}=$1; - $keyp{$id}=''; - foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { - if ($_=~/^parameter\_(.*)/) { - my $key=$_; - my $allkey=$1; - $allkey=~s/\_/\./g; - my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); - my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); - my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); - my $parmdis = $display; - $parmdis =~ s|(\[Part.*$)||g; - my $partkey = $part; - $partkey =~ tr|_|.|; - $allparms{$name} = $parmdis; - $allparts{$part} = "[Part $part]"; - $allkeys{$allkey}=$display; - if ($allkey eq $fcat) { - $defp{$id}= &Apache::lonnet::metadata($srcf,$key); - } - if ($keyp{$id}) { - $keyp{$id}.=','.$key; - } else { - $keyp{$id}=$key; - } - } - } - $mapp{$id}= - &Apache::lonnet::declutter($bighash{'map_id_'.$mapid}); - $mapp{$mapid}=$mapp{$id}; - $allmaps{$mapid}=$mapp{$id}; - $symbp{$id}=$mapp{$id}. - '___'.$resid.'___'. - &Apache::lonnet::declutter($srcf); - $symbp{$mapid}=$mapp{$id}.'___(all)'; - } - } - } + extractResourceInformation(\%bighash, \@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp); + $mapp{'0.0'} = ''; $symbp{'0.0'} = ''; # ---------------------------------------------------------- Anything to store? @@ -654,8 +780,10 @@ sub assessparms { if ($snum==5) { $storeunder=$seclevelm; } if ($snum==4) { $storeunder=$seclevelr; } - my %storecontent = ($storeunder => $ENV{'form.pres_value'}, - $storeunder.'type' => $ENV{'form.pres_type'}); + my $delete; + if ($ENV{'form.pres_value'} eq '') { $delete=1;} + my %storecontent = ($storeunder => $ENV{'form.pres_value'}, + $storeunder.'.type' => $ENV{'form.pres_type'}); my $reply=''; if ($snum>3) { # ---------------------------------------------------------------- Store Course @@ -670,10 +798,17 @@ sub assessparms { &Apache::lonnet::expirespread('','','assesscalc'); } # Store parameter - $reply=&Apache::lonnet::cput - ('resourcedata',\%storecontent, - $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, - $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + if ($delete) { + $reply=&Apache::lonnet::del + ('resourcedata',[keys(%storecontent)], + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + } else { + $reply=&Apache::lonnet::cput + ('resourcedata',\%storecontent, + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + } } else { # ------------------------------------------------------------------ Store User # @@ -689,15 +824,25 @@ sub assessparms { &Apache::lonnet::expirespread($uname,$udom,'assesscalc'); } # Store parameter - $reply=&Apache::lonnet::cput - ('resourcedata',\%storecontent,$udom,$uname); + if ($delete) { + $reply=&Apache::lonnet::del + ('resourcedata',[keys(%storecontent)],$udom,$uname); + } else { + $reply=&Apache::lonnet::cput + ('resourcedata',\%storecontent,$udom,$uname); + } } if ($reply=~/^error\:(.*)/) { $message.="Write Error: $1"; } # ---------------------------------------------------------------- Done storing + $message.='

Changes can take up to 10 minutes before being active for all students

'; } +# --------------------------------------------- Devalidate cache for this child + &Apache::lonnet::devalidatecourseresdata( + $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, + $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}); # -------------------------------------------------------------- Get coursedata %courseopt = &Apache::lonnet::dump ('resourcedata', @@ -725,6 +870,7 @@ sub assessparms { if ($pscat[0] eq "all" || !@pscat) {@pscat = (keys %allparms);} if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} # ------------------------------------------------------------------ Start page + &startpage($r,$id,$udom,$csec,$uname); # if ($ENV{'form.url'}) { # $r->print('print(' selected') unless (@psprt); $r->print('>All Parts'); + my %temphash=(); + foreach (@psprt) { $temphash{$_}=1; } foreach $tempkey (sort keys %allparts) { unless ($tempkey =~ /\./) { $r->print(''); @@ -869,12 +1016,12 @@ sub assessparms { } $r->print(''); - my @temp_psprt; - foreach my $t (@psprt) { - push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); - } +# my @temp_psprt; +# foreach my $t (@psprt) { +# push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts)); +# } - @psprt = @temp_psprt; +# @psprt = @temp_psprt; my @temp_pscat; map { @@ -1066,7 +1213,7 @@ ENDTABLEHEADFOUR foreach (split(/\,/,$keyp{$rid})) { my $tempkeyp = $_; my $fullkeyp = $tempkeyp; - $tempkeyp =~ s/_[\d_]+_/_0_/; + $tempkeyp =~ s/_\w+_/_0_/; if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { $part{$tempkeyp}="0"; @@ -1074,7 +1221,7 @@ ENDTABLEHEADFOUR $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; - $display{$tempkeyp} =~ s/_[\d_]+_/_0_/; + $display{$tempkeyp} =~ s/_\w+_/_0_/; $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); } @@ -1148,14 +1295,14 @@ ENDMAPONE foreach (split(/\,/,$keyp{$rid})) { my $tempkeyp = $_; my $fullkeyp = $tempkeyp; - $tempkeyp =~ s/_[\d_]+_/_0_/; + $tempkeyp =~ s/_\w+_/_0_/; if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { $part{$tempkeyp}="0"; $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); $display{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.display'); unless ($display{$tempkeyp}) { $display{$tempkeyp}=''; } $display{$tempkeyp}.=' ('.$name{$tempkeyp}.')'; - $display{$tempkeyp} =~ s/_[\d_]+_/_0_/; + $display{$tempkeyp} =~ s/_\w+_/_0_/; $default{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp); $type{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.type'); } @@ -1221,6 +1368,8 @@ Returns: nothing sub crsenv { my $r=shift; my $setoutput=''; + my $bodytag=&Apache::loncommon::bodytag( + 'Set Course Environment Parameters'); my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; # -------------------------------------------------- Go through list of changes @@ -1233,15 +1382,31 @@ sub crsenv { } if ($name eq 'url') { $value=~s/^\/res\///; + my $bkuptime=time; my @tmp = &Apache::lonnet::get ('environment',['url'],$dom,$crs); $setoutput.='Backing up previous URL: '. &Apache::lonnet::put ('environment', - {'top level map backup ' => $tmp[1] }, + {'top level map backup '.$bkuptime => $tmp[1] }, $dom,$crs). '
'; } + if ($name =~ /^spreadsheet_default_(classcalc| + studentcalc| + assesscalc)$/x) { + my $sheettype = $1; + if ($sheettype eq 'classcalc') { + # no need to do anything since viewing the sheet will + # cause it to be updated. + } elsif ($sheettype eq 'studentcalc') { + # expire all the student spreadsheets + &Apache::lonnet::expirespread('','','studentcalc'); + } else { + # expire all the default assessment spreadsheets + } + } + if ($name) { $setoutput.='Setting '.$name.' to '. $value.': '. @@ -1260,51 +1425,54 @@ sub crsenv { ('url' => 'Top Level Map '. '". - 'Browse
'. + 'Browse
'. 'Modification may make assessment data '. 'inaccessible', 'description' => 'Course Description', - 'courseid' => 'Course ID or number
'. + 'courseid' => 'Course ID or number
'. '(internal, optional)', 'default_xml_style' => 'Default XML Style File '. 'Browse
", - 'question.email' => 'Feedback Addresses for Content '. - 'Questions
(user:domain,'. - 'user:domain,...)', - 'comment.email' => 'Feedback Addresses for Comments
'. - '(user:domain,user:domain,...)', + 'question.email' => 'Feedback Addresses for Resource Content '. + 'Questions
(user:domain,'. + 'user:domain(section;section;...;*;...),...)', + 'comment.email' => 'Feedback Addresses for Course Content Comments
'. + '(user:domain,user:domain(section;section;...;*;...),...)', 'policy.email' => 'Feedback Addresses for Course Policy'. - '
(user:domain,user:domain,...)', - 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets
'. + '
(user:domain,user:domain(section;section;...;*;...),...)', + 'hideemptyrows' => 'Hide Empty Rows in Spreadsheets
'. '("yes" for default hiding)', - 'pageseparators' => 'Visibly Separate Items on Pages
'. + 'pageseparators' => 'Visibly Separate Items on Pages
'. '("yes" for visible separation)', 'pch.roles.denied'=> 'Disallow Resource Discussion for '. - 'Roles
"st": '. + 'Roles
"st": '. 'student, "ta": '. 'TA, "in": '. - 'instructor;
role,role,...) '. + 'instructor;
role,role,...) '. Apache::loncommon::help_open_topic("Course_Disable_Discussion"), 'pch.users.denied' => - 'Disallow Resource Discussion for Users
'. + 'Disallow Resource Discussion for Users
'. '(user:domain,user:domain,...)', 'spreadsheet_default_classcalc' => 'Default Course Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", 'spreadsheet_default_studentcalc' => 'Default Student Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", 'spreadsheet_default_assesscalc' => 'Default Assessment Spreadsheet '. 'Browse
", + ",'spreadsheet')\">Browse
", + 'allow_limited_html_in_feedback' + => 'Allow limited HTML in discussion posts
'. + '(Set value to yes to allow)' ); foreach (keys(%values)) { unless ($descriptions{$_}) { @@ -1313,7 +1481,7 @@ sub crsenv { } foreach (sort keys %descriptions) { # onchange is javascript to automatically check the 'Set' button. - my $onchange = 'onchange="javascript:window.document.forms'. + my $onchange = 'onFocus="javascript:window.document.forms'. '[\'envform\'].elements[\''.$_.'_setparmval\']'. '.checked=true;"'; $output.=''.$descriptions{$_}.''. @@ -1322,7 +1490,7 @@ sub crsenv { ''. ''."\n"; } - my $onchange = 'onchange="javascript:window.document.forms'. + my $onchange = 'onFocus="javascript:window.document.forms'. '[\'envform\'].elements[\'newp_setparmval\']'. '.checked=true;"'; $output.='Create New Environment Variable
'. @@ -1361,11 +1529,8 @@ sub crsenv { LON-CAPA Course Environment - -

Set Course Parameters

+$bodytag -

Course: $ENV{'course.'.$ENV{'request.course.id'}.'.description'}

-

Course Environment

$setoutput