version 1.177, 2004/11/23 20:36:46
|
version 1.197, 2005/06/01 21:44:00
|
Line 62 use GDBM_File;
|
Line 62 use GDBM_File;
|
use Apache::lonhomework; |
use Apache::lonhomework; |
use Apache::lonxml; |
use Apache::lonxml; |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::lonnavmaps; |
|
|
my %courseopt; |
my %courseopt; |
my %useropt; |
my %useropt; |
Line 72 my %symbp;
|
Line 73 my %symbp;
|
my %mapp; |
my %mapp; |
my %typep; |
my %typep; |
my %keyp; |
my %keyp; |
|
my %uris; |
my %maptitles; |
my %maptitles; |
|
|
my $uname; |
|
my $udom; |
|
my $uhome; |
|
my $csec; |
|
my $coursename; |
|
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
|
Line 96 Inputs: $what - a parameter spec (inclu
|
Line 91 Inputs: $what - a parameter spec (inclu
|
|
|
Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 11 possible levels |
Returns: A list, the first item is the index into the remaining list of items of parm valuse that is the active one, the list consists of parm values at the 11 possible levels |
|
|
11- resource default |
11 - General Course |
10- map default |
10 - Map or Folder level in course |
9 - General Course |
9- resource default |
8 - Map or Folder level in course |
8- map default |
7 - resource level in course |
7 - resource level in course |
6 - General for section |
6 - General for section |
5 - Map or Folder level for section |
5 - Map or Folder level for section |
Line 113 Returns: A list, the first item is the
|
Line 108 Returns: A list, the first item is the
|
################################################## |
################################################## |
################################################## |
################################################## |
sub parmval { |
sub parmval { |
my ($what,$id,$def)=@_; |
my ($what,$id,$def,$uname,$udom,$csec)=@_; |
my $result=''; |
my $result=''; |
my @outpar=(); |
my @outpar=(); |
# ----------------------------------------------------- Cascading lookup scheme |
# ----------------------------------------------------- Cascading lookup scheme |
Line 121 sub parmval {
|
Line 116 sub parmval {
|
my $symbparm=$symbp{$id}.'.'.$what; |
my $symbparm=$symbp{$id}.'.'.$what; |
my $mapparm=$mapp{$id}.'___(all).'.$what; |
my $mapparm=$mapp{$id}.'___(all).'.$what; |
|
|
my $seclevel=$ENV{'request.course.id'}.'.['.$csec.'].'.$what; |
my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$what; |
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'}.'.'.$what; |
|
my $courselevelr=$ENV{'request.course.id'}.'.'.$symbparm; |
|
my $courselevelm=$ENV{'request.course.id'}.'.'.$mapparm; |
|
|
|
# -------------------------------------------------------- first, check default |
my $courselevel=$env{'request.course.id'}.'.'.$what; |
|
my $courselevelr=$env{'request.course.id'}.'.'.$symbparm; |
|
my $courselevelm=$env{'request.course.id'}.'.'.$mapparm; |
|
|
if (defined($def)) { $outpar[11]=$def; $result=11; } |
|
|
|
# ----------------------------------------------------- second, check map parms |
|
|
|
my $thisparm=$parmhash{$symbparm}; |
# --------------------------------------------------------- first, check course |
if (defined($thisparm)) { $outpar[10]=$thisparm; $result=10; } |
|
|
|
# --------------------------------------------------------- third, check course |
|
|
|
if (defined($courseopt{$courselevel})) { |
if (defined($courseopt{$courselevel})) { |
$outpar[9]=$courseopt{$courselevel}; |
$outpar[11]=$courseopt{$courselevel}; |
$result=9; |
$result=11; |
} |
} |
|
|
if (defined($courseopt{$courselevelm})) { |
if (defined($courseopt{$courselevelm})) { |
$outpar[8]=$courseopt{$courselevelm}; |
$outpar[10]=$courseopt{$courselevelm}; |
$result=8; |
$result=10; |
} |
} |
|
|
|
# ------------------------------------------------------- second, check default |
|
|
|
if (defined($def)) { $outpar[9]=$def; $result=9; } |
|
|
|
# ------------------------------------------------------ third, check map parms |
|
|
|
my $thisparm=$parmhash{$symbparm}; |
|
if (defined($thisparm)) { $outpar[8]=$thisparm; $result=8; } |
|
|
if (defined($courseopt{$courselevelr})) { |
if (defined($courseopt{$courselevelr})) { |
$outpar[7]=$courseopt{$courselevelr}; |
$outpar[7]=$courseopt{$courselevelr}; |
$result=7; |
$result=7; |
} |
} |
|
|
|
# ------------------------------------------------------ fourth, back to course |
if (defined($csec)) { |
if (defined($csec)) { |
if (defined($courseopt{$seclevel})) { |
if (defined($courseopt{$seclevel})) { |
$outpar[6]=$courseopt{$seclevel}; |
$outpar[6]=$courseopt{$seclevel}; |
Line 171 sub parmval {
|
Line 169 sub parmval {
|
} |
} |
} |
} |
|
|
# ---------------------------------------------------------- fourth, check user |
# ---------------------------------------------------------- fifth, check user |
|
|
if (defined($uname)) { |
if (defined($uname)) { |
if (defined($useropt{$courselevel})) { |
if (defined($useropt{$courselevel})) { |
Line 192 sub parmval {
|
Line 190 sub parmval {
|
return ($result,@outpar); |
return ($result,@outpar); |
} |
} |
|
|
|
|
|
################################################## |
|
################################################## |
|
# |
|
# Store a parameter by ID |
|
# |
|
# Takes |
|
# - resource id |
|
# - name of parameter |
|
# - level |
|
# - new value |
|
# - new type |
|
# - username |
|
# - userdomain |
|
|
|
sub storeparm { |
|
my ($sresid,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec)=@_; |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if ($sresid=~/\./) { |
|
my $resource=$navmap->getById($sresid); |
|
&storeparm_by_symb($resource->symb(),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec); |
|
} else { |
|
my $resource=$navmap->getByMapPc($sresid); |
|
&storeparm_by_symb(&Apache::lonnet::declutter($resource->src()),$spnam,$snum,$nval,$ntype,$uname,$udom,$csec); |
|
} |
|
} |
|
|
|
# |
|
# Store a parameter by symb |
|
# |
|
# Takes |
|
# - symb |
|
# - name of parameter |
|
# - level |
|
# - new value |
|
# - new type |
|
# - username |
|
# - userdomain |
|
|
|
sub storeparm_by_symb { |
|
# ---------------------------------------------------------- Get symb, map, etc |
|
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec)=@_; |
|
# ---------------------------------------------------------- Construct prefixes |
|
$spnam=~s/\_([^\_]+)$/\.$1/; |
|
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
|
my $symbparm=$symb.'.'.$spnam; |
|
my $mapparm=$map.'___(all).'.$spnam; |
|
|
|
my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam; |
|
my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm; |
|
my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm; |
|
|
|
my $courselevel=$env{'request.course.id'}.'.'.$spnam; |
|
my $courselevelr=$env{'request.course.id'}.'.'.$symbparm; |
|
my $courselevelm=$env{'request.course.id'}.'.'.$mapparm; |
|
|
|
my $storeunder=''; |
|
if (($snum==11) || ($snum==3)) { $storeunder=$courselevel; } |
|
if (($snum==10) || ($snum==2)) { $storeunder=$courselevelm; } |
|
if (($snum==7) || ($snum==1)) { $storeunder=$courselevelr; } |
|
if ($snum==6) { $storeunder=$seclevel; } |
|
if ($snum==5) { $storeunder=$seclevelm; } |
|
if ($snum==4) { $storeunder=$seclevelr; } |
|
|
|
my $delete; |
|
if ($nval eq '') { $delete=1;} |
|
my %storecontent = ($storeunder => $nval, |
|
$storeunder.'.type' => $ntype); |
|
my $reply=''; |
|
if ($snum>3) { |
|
# ---------------------------------------------------------------- Store Course |
|
# |
|
# Expire sheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
if (($snum==7) || ($snum==4)) { |
|
&Apache::lonnet::expirespread('','','assesscalc',$symb); |
|
} elsif (($snum==8) || ($snum==5)) { |
|
&Apache::lonnet::expirespread('','','assesscalc',$map); |
|
} else { |
|
&Apache::lonnet::expirespread('','','assesscalc'); |
|
} |
|
# Store parameter |
|
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 |
|
# |
|
# Expire sheets |
|
&Apache::lonnet::expirespread($uname,$udom,'studentcalc'); |
|
if ($snum==1) { |
|
&Apache::lonnet::expirespread |
|
($uname,$udom,'assesscalc',$symb); |
|
} elsif ($snum==2) { |
|
&Apache::lonnet::expirespread |
|
($uname,$udom,'assesscalc',$map); |
|
} else { |
|
&Apache::lonnet::expirespread($uname,$udom,'assesscalc'); |
|
} |
|
# Store parameter |
|
if ($delete) { |
|
$reply=&Apache::lonnet::del |
|
('resourcedata',[keys(%storecontent)],$udom,$uname); |
|
} else { |
|
$reply=&Apache::lonnet::cput |
|
('resourcedata',\%storecontent,$udom,$uname); |
|
} |
|
&Apache::lonnet::devalidateuserresdata($uname,$udom); |
|
} |
|
|
|
if ($reply=~/^error\:(.*)/) { |
|
return "<font color=red>Write Error: $1</font>"; |
|
} |
|
return ''; |
|
} |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
|
Line 272 sub plink {
|
Line 394 sub plink {
|
my $winvalue=$value; |
my $winvalue=$value; |
unless ($winvalue) { |
unless ($winvalue) { |
if ($type=~/^date/) { |
if ($type=~/^date/) { |
$winvalue=$ENV{'form.recent_'.$type}; |
$winvalue=$env{'form.recent_'.$type}; |
} else { |
} else { |
$winvalue=$ENV{'form.recent_'.(split(/\_/,$type))[0]}; |
$winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]}; |
} |
} |
} |
} |
return |
return |
Line 289 sub startpage {
|
Line 411 sub startpage {
|
|
|
my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','', |
my $bodytag=&Apache::loncommon::bodytag('Set/Modify Course Parameters','', |
'onUnload="pclose()"'); |
'onUnload="pclose()"'); |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Table'); |
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(); |
Line 309 sub startpage {
|
Line 432 sub startpage {
|
my $overallhelp= |
my $overallhelp= |
&Apache::loncommon::help_open_menu('','Setting Parameters','Course_Setting_Parameters','',10,'Instructor Interface'); |
&Apache::loncommon::help_open_menu('','Setting Parameters','Course_Setting_Parameters','',10,'Instructor Interface'); |
my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters"); |
my $assessparmhelp=&Apache::loncommon::help_open_topic("Cascading_Parameters","Assessment Parameters"); |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<html> |
$html |
<head> |
<head> |
<title>LON-CAPA Course Parameters</title> |
<title>LON-CAPA Course Parameters</title> |
<script> |
<script> |
Line 357 sub startpage {
|
Line 481 sub startpage {
|
$selscript |
$selscript |
</head> |
</head> |
$bodytag |
$bodytag |
|
$breadcrumbs |
$overallhelp |
$overallhelp |
ENDHEAD |
ENDHEAD |
|
|
Line 378 $assessparmhelp
|
Line 503 $assessparmhelp
|
</form> |
</form> |
<hr /> |
<hr /> |
ENDHEAD2 |
ENDHEAD2 |
} |
} |
$r->print(<<ENDHEAD3); |
my %sectionhash=(); |
<form method="post" action="/adm/parmset" name="parmform"> |
my $sections=''; |
|
if (&Apache::loncommon::get_sections( |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}, |
|
\%sectionhash)) { |
|
$sections=$lt{'sg'}.': <select name="csec">'; |
|
foreach ('',sort keys %sectionhash) { |
|
$sections.='<option value="'.$_.'"'. |
|
($_ eq $csec?'selected="selected"':'').'>'.$_.'</option>'; |
|
} |
|
$sections.='</select>'; |
|
} |
|
$r->print(<<ENDHEAD3); |
|
<form method="post" action="/adm/parmset?action=settable" name="parmform"> |
<h4>$lt{'captm'}</h4> |
<h4>$lt{'captm'}</h4> |
ENDHEAD3 |
ENDHEAD3 |
|
|
Line 389 ENDHEAD3
|
Line 527 ENDHEAD3
|
} else { |
} else { |
$r->print(<<ENDHEAD); |
$r->print(<<ENDHEAD); |
<b> |
<b> |
$lt{'sg'}: |
$sections |
<input type="text" value="$csec" size="6" name="csec"> |
<br /> |
<br> |
|
$lt{'fu'} |
$lt{'fu'} |
<input type="text" value="$uname" size="12" name="uname"> |
<input type="text" value="$uname" size="12" name="uname" /> |
$lt{'oi'} |
$lt{'oi'} |
<input type="text" value="$id" size="12" name="id"> |
<input type="text" value="$id" size="12" name="id" /> |
$lt{'ad'} |
$lt{'ad'} |
$chooseopt |
$chooseopt |
</b> |
</b> |
Line 408 ENDHEAD
|
Line 545 ENDHEAD
|
|
|
sub print_row { |
sub print_row { |
my ($r,$which,$part,$name,$rid,$default,$defaulttype,$display,$defbgone, |
my ($r,$which,$part,$name,$rid,$default,$defaulttype,$display,$defbgone, |
$defbgtwo,$parmlev)=@_; |
$defbgtwo,$parmlev,$uname,$udom,$csec)=@_; |
# get the values for the parameter in cascading order |
# get the values for the parameter in cascading order |
# empty levels will remain empty |
# empty levels will remain empty |
my ($result,@outpar)=&parmval($$part{$which}.'.'.$$name{$which}, |
my ($result,@outpar)=&parmval($$part{$which}.'.'.$$name{$which}, |
$rid,$$default{$which}); |
$rid,$$default{$which},$uname,$udom,$csec); |
# get the type for the parameters |
# get the type for the parameters |
# problem: these may not be set for all levels |
# problem: these may not be set for all levels |
my ($typeresult,@typeoutpar)=&parmval($$part{$which}.'.'. |
my ($typeresult,@typeoutpar)=&parmval($$part{$which}.'.'. |
$$name{$which}.'.type', |
$$name{$which}.'.type', |
$rid,$$defaulttype{$which}); |
$rid,$$defaulttype{$which},$uname,$udom,$csec); |
# cascade down manually |
# cascade down manually |
my $cascadetype=$defaulttype; |
my $cascadetype=$$defaulttype{$which}; |
for (my $i=$#typeoutpar;$i>0;$i--) { |
for (my $i=11;$i>0;$i--) { |
if ($typeoutpar[$i]) { |
if ($typeoutpar[$i]) { |
$cascadetype=$typeoutpar[$i]; |
$cascadetype=$typeoutpar[$i]; |
} else { |
} else { |
$typeoutpar[$i]=$cascadetype; |
$typeoutpar[$i]=$cascadetype; |
} |
} |
} |
} |
|
|
my $parm=$$display{$which}; |
my $parm=$$display{$which}; |
|
|
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
Line 450 sub print_row {
|
Line 586 sub print_row {
|
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,6,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} elsif ($parmlev eq 'map') { |
} elsif ($parmlev eq 'map') { |
|
|
Line 459 sub print_row {
|
Line 595 sub print_row {
|
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,5,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} else { |
} else { |
&print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
} |
} |
} else { |
} else { |
|
|
&print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,11,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
if ($parmlev eq 'brief') { |
if ($parmlev eq 'brief') { |
|
|
Line 477 sub print_row {
|
Line 613 sub print_row {
|
} |
} |
} else { |
} else { |
|
|
&print_td($r,10,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,9,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,9,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,8,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
&print_td($r,7,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); |
|
|
if ($csec) { |
if ($csec) { |
Line 520 sub print_td {
|
Line 656 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 bgcolor='.(($result==$which)?'"#AAFFAA"':$defbg). |
' align="center">'); |
' align="center">'); |
if ($which<10) { |
if ($which<8 || $which > 9) { |
$r->print(&plink($$typeoutpar[$which], |
$r->print(&plink($$typeoutpar[$which], |
$$display{$value},$$outpar[$which], |
$$display{$value},$$outpar[$which], |
$mprefix."$which",'parmform.pres','psub')); |
$mprefix."$which",'parmform.pres','psub')); |
Line 565 Input: See list below:
|
Line 701 Input: See list below:
|
=cut |
=cut |
|
|
sub extractResourceInformation { |
sub extractResourceInformation { |
my $bighash = shift; |
|
my $ids = shift; |
my $ids = shift; |
my $typep = shift; |
my $typep = shift; |
my $keyp = shift; |
my $keyp = shift; |
Line 578 sub extractResourceInformation {
|
Line 713 sub extractResourceInformation {
|
my $mapp = shift; |
my $mapp = shift; |
my $symbp = shift; |
my $symbp = shift; |
my $maptitles=shift; |
my $maptitles=shift; |
|
my $uris=shift; |
|
|
foreach (keys %$bighash) { |
|
if ($_=~/^src\_(\d+)\.(\d+)$/) { |
my $navmap = Apache::lonnavmaps::navmap->new(); |
# there are no resources in the 0 level |
my @allres=$navmap->retrieveResources(undef,undef,1,undef,1); |
if ($1 eq '0') { next; } |
foreach my $resource (@allres) { |
my $mapid=$1; |
my $id=$resource->id(); |
my $resid=$2; |
my ($mapid,$resid)=split(/\./,$id); |
my $id=$mapid.'.'.$resid; |
if ($mapid eq '0') { next; } |
my $srcf=$$bighash{$_}; |
$$ids[$#$ids+1]=$id; |
if (1) { |
my $srcf=$resource->src(); |
$srcf=~/\.(\w+)$/; |
$srcf=~/\.(\w+)$/; |
$$ids[$#$ids+1]=$id; |
$$typep{$id}=$1; |
$$typep{$id}=$1; |
$$keyp{$id}=''; |
$$keyp{$id}=''; |
$$uris{$id}=$srcf; |
foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) { |
if ($_=~/^parameter\_(.*)/) { |
if ($_=~/^parameter\_(.*)/) { |
my $key=$_; |
my $key=$_; |
my $allkey=$1; |
my $allkey=$1; |
$allkey=~s/\_/\./g; |
$allkey=~s/\_/\./g; |
if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq |
if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq |
'parm') { |
'parm') { |
next; #hide hidden things |
next; #hide hidden things |
} |
} |
my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
my $display= &Apache::lonnet::metadata($srcf,$key.'.display'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $name=&Apache::lonnet::metadata($srcf,$key.'.name'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $part= &Apache::lonnet::metadata($srcf,$key.'.part'); |
my $parmdis = $display; |
my $parmdis = $display; |
$parmdis =~ s|(\[Part.*$)||g; |
$parmdis =~ s|(\[Part.*)$||g; |
my $partkey = $part; |
my $partkey = $part; |
$partkey =~ tr|_|.|; |
$partkey =~ tr|_|.|; |
$$allparms{$name} = $parmdis; |
$$allparms{$name} = $parmdis; |
$$allparts{$part} = "[Part $part]"; |
$$allparts{$part} = "[Part $part]"; |
$$allkeys{$allkey}=$display; |
$$allkeys{$allkey}=$display; |
if ($allkey eq $fcat) { |
if ($allkey eq $fcat) { |
$$defp{$id}= &Apache::lonnet::metadata($srcf,$key); |
$$defp{$id}= &Apache::lonnet::metadata($srcf,$key); |
} |
|
if ($$keyp{$id}) { |
|
$$keyp{$id}.=','.$key; |
|
} else { |
|
$$keyp{$id}=$key; |
|
} |
|
} |
|
} |
} |
$$mapp{$id}= |
if ($$keyp{$id}) { |
&Apache::lonnet::declutter($$bighash{'map_id_'.$mapid}); |
$$keyp{$id}.=','.$key; |
$$mapp{$mapid}=$$mapp{$id}; |
|
$$allmaps{$mapid}=$$mapp{$id}; |
|
if ($mapid eq '1') { |
|
$$maptitles{$mapid}='Main Course Documents'; |
|
} else { |
} else { |
$$maptitles{$mapid}= |
$$keyp{$id}=$key; |
$$bighash{'title_'.$$bighash{'ids_'.&Apache::lonnet::clutter($$mapp{$id})}}; |
|
} |
} |
$$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; |
|
$$symbp{$id}=$$mapp{$id}. |
|
'___'.$resid.'___'. |
|
&Apache::lonnet::declutter($srcf); |
|
$$symbp{$mapid}=$$mapp{$id}.'___(all)'; |
|
} |
} |
} |
} |
|
$$mapp{$id}= |
|
&Apache::lonnet::declutter($resource->enclosing_map_src()); |
|
$$mapp{$mapid}=$$mapp{$id}; |
|
$$allmaps{$mapid}=$$mapp{$id}; |
|
if ($mapid eq '1') { |
|
$$maptitles{$mapid}='Main Course Documents'; |
|
} else { |
|
$$maptitles{$mapid}=&Apache::lonnet::gettitle(&Apache::lonnet::clutter($$mapp{$id})); |
|
} |
|
$$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; |
|
$$symbp{$id}=&Apache::lonnet::encode_symb($$mapp{$id},$resid,$srcf); |
|
$$symbp{$mapid}=$$mapp{$id}.'___(all)'; |
} |
} |
} |
} |
|
|
Line 679 sub assessparms {
|
Line 810 sub assessparms {
|
my %allmaps=(); |
my %allmaps=(); |
my %alllevs=(); |
my %alllevs=(); |
|
|
|
my $uname; |
|
my $udom; |
|
my $uhome; |
|
my $csec; |
|
|
|
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
|
|
$alllevs{'Resource Level'}='full'; |
$alllevs{'Resource Level'}='full'; |
# $alllevs{'Resource Level [BRIEF]'}='brief'; |
|
$alllevs{'Map Level'}='map'; |
$alllevs{'Map Level'}='map'; |
$alllevs{'Course Level'}='general'; |
$alllevs{'Course Level'}='general'; |
|
|
Line 690 sub assessparms {
|
Line 827 sub assessparms {
|
my %defp; |
my %defp; |
%courseopt=(); |
%courseopt=(); |
%useropt=(); |
%useropt=(); |
my %bighash=(); |
|
|
|
@ids=(); |
@ids=(); |
%symbp=(); |
%symbp=(); |
Line 698 sub assessparms {
|
Line 834 sub assessparms {
|
|
|
my $message=''; |
my $message=''; |
|
|
$csec=$ENV{'form.csec'}; |
$csec=$env{'form.csec'}; |
if ($udom=$ENV{'form.udom'}) { |
|
} elsif ($udom=$ENV{'request.role.domain'}) { |
if ($udom=$env{'form.udom'}) { |
} elsif ($udom=$ENV{'user.domain'}) { |
} elsif ($udom=$env{'request.role.domain'}) { |
|
} elsif ($udom=$env{'user.domain'}) { |
} else { |
} else { |
$udom=$r->dir_config('lonDefDomain'); |
$udom=$r->dir_config('lonDefDomain'); |
} |
} |
|
|
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
my @pscat=&Apache::loncommon::get_env_multiple('form.pscat'); |
my $pschp=$ENV{'form.pschp'}; |
my $pschp=$env{'form.pschp'}; |
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 $showoptions=$ENV{'form.showoptions'}; |
my $showoptions=$env{'form.showoptions'}; |
|
|
my $pssymb=''; |
my $pssymb=''; |
my $parmlev=''; |
my $parmlev=''; |
my $trimheader=''; |
my $trimheader=''; |
my $prevvisit=$ENV{'form.prevvisit'}; |
my $prevvisit=$env{'form.prevvisit'}; |
|
|
# unless ($parmlev==$ENV{'form.parmlev'}) { |
|
# $parmlev = 'full'; |
|
# } |
|
|
|
unless ($ENV{'form.parmlev'}) { |
unless ($env{'form.parmlev'}) { |
$parmlev = 'map'; |
$parmlev = 'map'; |
} else { |
} else { |
$parmlev = $ENV{'form.parmlev'}; |
$parmlev = $env{'form.parmlev'}; |
} |
} |
|
|
# ----------------------------------------------- Was this started from grades? |
# ----------------------------------------------- Was this started from grades? |
|
|
if (($ENV{'form.command'} eq 'set') && ($ENV{'form.url'}) |
if (($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&& (!$ENV{'form.dis'})) { |
&& (!$env{'form.dis'})) { |
my $url=$ENV{'form.url'}; |
my $url=$env{'form.url'}; |
$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
$url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; |
$pssymb=&Apache::lonnet::symbread($url); |
$pssymb=&Apache::lonnet::symbread($url); |
if (!@pscat) { @pscat=('all'); } |
if (!@pscat) { @pscat=('all'); } |
$pschp=''; |
$pschp=''; |
$parmlev = 'full'; |
$parmlev = 'full'; |
$trimheader='yes'; |
$trimheader='yes'; |
} elsif ($ENV{'form.symb'}) { |
} elsif ($env{'form.symb'}) { |
$pssymb=$ENV{'form.symb'}; |
$pssymb=$env{'form.symb'}; |
if (!@pscat) { @pscat=('all'); } |
if (!@pscat) { @pscat=('all'); } |
$pschp=''; |
$pschp=''; |
$parmlev = 'full'; |
$parmlev = 'full'; |
$trimheader='yes'; |
$trimheader='yes'; |
} else { |
} else { |
$ENV{'form.url'}=''; |
$env{'form.url'}=''; |
} |
} |
|
|
my $id=$ENV{'form.id'}; |
my $id=$env{'form.id'}; |
if (($id) && ($udom)) { |
if (($id) && ($udom)) { |
$uname=(&Apache::lonnet::idget($udom,$id))[1]; |
$uname=(&Apache::lonnet::idget($udom,$id))[1]; |
if ($uname) { |
if ($uname) { |
Line 759 sub assessparms {
|
Line 892 sub assessparms {
|
&mt('at domain')." '$udom'</font>"; |
&mt('at domain')." '$udom'</font>"; |
} |
} |
} else { |
} else { |
$uname=$ENV{'form.uname'}; |
$uname=$env{'form.uname'}; |
} |
} |
unless ($udom) { $uname=''; } |
unless ($udom) { $uname=''; } |
$uhome=''; |
$uhome=''; |
Line 772 sub assessparms {
|
Line 905 sub assessparms {
|
$uname=''; |
$uname=''; |
} else { |
} else { |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$csec=&Apache::lonnet::getsection($udom,$uname, |
$ENV{'request.course.id'}); |
$env{'request.course.id'}); |
if ($csec eq '-1') { |
if ($csec eq '-1') { |
$message="<font color=red>". |
$message="<font color=red>". |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
&mt("User")." '$uname' ".&mt("at domain")." '$udom' ". |
&mt("not in this course")."</font>"; |
&mt("not in this course")."</font>"; |
$uname=''; |
$uname=''; |
$csec=$ENV{'form.csec'}; |
$csec=$env{'form.csec'}; |
} else { |
} else { |
my %name=&Apache::lonnet::userenvironment($udom,$uname, |
my %name=&Apache::lonnet::userenvironment($udom,$uname, |
('firstname','middlename','lastname','generation','id')); |
('firstname','middlename','lastname','generation','id')); |
Line 792 sub assessparms {
|
Line 925 sub assessparms {
|
|
|
unless ($csec) { $csec=''; } |
unless ($csec) { $csec=''; } |
|
|
my $fcat=$ENV{'form.fcat'}; |
my $fcat=$env{'form.fcat'}; |
unless ($fcat) { $fcat=''; } |
unless ($fcat) { $fcat=''; } |
|
|
# ------------------------------------------------------------------- Tie hashs |
# ------------------------------------------------------------------- Tie hashs |
if (!(tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
|
&GDBM_READER(),0640))) { |
|
$r->print("Unable to access course data. (File $ENV{'request.course.fn'}.db not tieable)"); |
|
return ; |
|
} |
|
if (!(tie(%parmhash,'GDBM_File', |
if (!(tie(%parmhash,'GDBM_File', |
$ENV{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640))) { |
$env{'request.course.fn'}.'_parms.db',&GDBM_READER(),0640))) { |
$r->print("Unable to access parameter data. (File $ENV{'request.course.fn'}_parms.db not tieable)"); |
$r->print("Unable to access parameter data. (File $env{'request.course.fn'}_parms.db not tieable)"); |
return ; |
return ; |
} |
} |
|
|
# --------------------------------------------------------- Get all assessments |
# --------------------------------------------------------- Get all assessments |
extractResourceInformation(\%bighash, \@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp,\%maptitles); |
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allkeys, \%allmaps, $fcat, \%defp, \%mapp, \%symbp,\%maptitles,\%uris); |
|
|
$mapp{'0.0'} = ''; |
$mapp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
|
|
# ---------------------------------------------------------- Anything to store? |
# ---------------------------------------------------------- Anything to store? |
if ($ENV{'form.pres_marker'}) { |
if ($env{'form.pres_marker'}) { |
my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'}); |
$message.=&storeparm(split(/\&/,$env{'form.pres_marker'}), |
$spnam=~s/\_([^\_]+)$/\.$1/; |
$env{'form.pres_value'}, |
# ---------------------------------------------------------- Construct prefixes |
$env{'form.pres_type'}, |
|
$uname,$udom,$csec); |
my $symbparm=$symbp{$sresid}.'.'.$spnam; |
|
my $mapparm=$mapp{$sresid}.'___(all).'.$spnam; |
|
|
|
my $seclevel=$ENV{'request.course.id'}.'.['.$csec.'].'.$spnam; |
|
my $seclevelr=$ENV{'request.course.id'}.'.['.$csec.'].'.$symbparm; |
|
my $seclevelm=$ENV{'request.course.id'}.'.['.$csec.'].'.$mapparm; |
|
|
|
my $courselevel=$ENV{'request.course.id'}.'.'.$spnam; |
|
my $courselevelr=$ENV{'request.course.id'}.'.'.$symbparm; |
|
my $courselevelm=$ENV{'request.course.id'}.'.'.$mapparm; |
|
|
|
my $storeunder=''; |
|
if (($snum==9) || ($snum==3)) { $storeunder=$courselevel; } |
|
if (($snum==8) || ($snum==2)) { $storeunder=$courselevelm; } |
|
if (($snum==7) || ($snum==1)) { $storeunder=$courselevelr; } |
|
if ($snum==6) { $storeunder=$seclevel; } |
|
if ($snum==5) { $storeunder=$seclevelm; } |
|
if ($snum==4) { $storeunder=$seclevelr; } |
|
|
|
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 |
|
# |
|
# Expire sheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
if (($snum==7) || ($snum==4)) { |
|
&Apache::lonnet::expirespread('','','assesscalc',$symbp{$sresid}); |
|
} elsif (($snum==8) || ($snum==5)) { |
|
&Apache::lonnet::expirespread('','','assesscalc',$mapp{$sresid}); |
|
} else { |
|
&Apache::lonnet::expirespread('','','assesscalc'); |
|
} |
|
# Store parameter |
|
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 |
|
# |
|
# Expire sheets |
|
&Apache::lonnet::expirespread($uname,$udom,'studentcalc'); |
|
if ($snum==1) { |
|
&Apache::lonnet::expirespread |
|
($uname,$udom,'assesscalc',$symbp{$sresid}); |
|
} elsif ($snum==2) { |
|
&Apache::lonnet::expirespread |
|
($uname,$udom,'assesscalc',$mapp{$sresid}); |
|
} else { |
|
&Apache::lonnet::expirespread($uname,$udom,'assesscalc'); |
|
} |
|
# Store parameter |
|
if ($delete) { |
|
$reply=&Apache::lonnet::del |
|
('resourcedata',[keys(%storecontent)],$udom,$uname); |
|
} else { |
|
$reply=&Apache::lonnet::cput |
|
('resourcedata',\%storecontent,$udom,$uname); |
|
} |
|
} |
|
|
|
if ($reply=~/^error\:(.*)/) { |
|
$message.="<font color=red>Write Error: $1</font>"; |
|
} |
|
# ---------------------------------------------------------------- Done storing |
# ---------------------------------------------------------------- Done storing |
$message.='<h3>'.&mt('Changes can take up to 10 minutes before being active for all students.').&Apache::loncommon::help_open_topic('Caching').'</h3>'; |
$message.='<h3>'.&mt('Changes can take up to 10 minutes before being active for all students.').&Apache::loncommon::help_open_topic('Caching').'</h3>'; |
} |
} |
# --------------------------------------------- Devalidate cache for this child |
# --------------------------------------------- Devalidate cache for this child |
&Apache::lonnet::devalidatecourseresdata( |
&Apache::lonnet::devalidatecourseresdata( |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}); |
$env{'course.'.$env{'request.course.id'}.'.domain'}); |
&Apache::lonnet::clear_EXT_cache_status(); |
#&Apache::lonnet::clear_EXT_cache_status(); |
# -------------------------------------------------------------- Get coursedata |
# -------------------------------------------------------------- Get coursedata |
%courseopt = &Apache::lonnet::dump |
%courseopt = &Apache::lonnet::dump |
('resourcedata', |
('resourcedata', |
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}); |
$env{'course.'.$env{'request.course.id'}.'.num'}); |
# --------------------------------------------------- Get userdata (if present) |
# --------------------------------------------------- Get userdata (if present) |
if ($uname) { |
if ($uname) { |
%useropt=&Apache::lonnet::dump('resourcedata',$udom,$uname); |
%useropt=&Apache::lonnet::dump('resourcedata',$udom,$uname); |
Line 918 sub assessparms {
|
Line 972 sub assessparms {
|
if ($fcat eq '') { |
if ($fcat eq '') { |
$a<=>$b; |
$a<=>$b; |
} else { |
} else { |
my ($result,@outpar)=&parmval($fcat,$a,$defp{$a}); |
my ($result,@outpar)=&parmval($fcat,$a,$defp{$a},$uname,$udom,$csec); |
my $aparm=$outpar[$result]; |
my $aparm=$outpar[$result]; |
($result,@outpar)=&parmval($fcat,$b,$defp{$b}); |
($result,@outpar)=&parmval($fcat,$b,$defp{$b},$uname,$udom,$csec); |
my $bparm=$outpar[$result]; |
my $bparm=$outpar[$result]; |
1*$aparm<=>1*$bparm; |
1*$aparm<=>1*$bparm; |
} |
} |
Line 933 sub assessparms {
|
Line 987 sub assessparms {
|
my $have_assesments=1; |
my $have_assesments=1; |
if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } |
if (scalar(keys(%allkeys)) eq 0) { $have_assesments=0; } |
|
|
|
$trimheader = 'yes'; |
&startpage($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader); |
&startpage($r,$id,$udom,$csec,$uname,$have_assesments,$trimheader); |
|
|
if (!$have_assesments) { |
if (!$have_assesments) { |
untie(%bighash); |
|
untie(%parmhash); |
untie(%parmhash); |
return ''; |
return ''; |
} |
} |
# if ($ENV{'form.url'}) { |
# if ($env{'form.url'}) { |
# $r->print('<input type="hidden" value="'.$ENV{'form.url'}. |
# $r->print('<input type="hidden" value="'.$env{'form.url'}. |
# '" name="url"><input type="hidden" name="command" value="set">'); |
# '" name="url"><input type="hidden" name="command" value="set">'); |
# } |
# } |
$r->print('<input type="hidden" value="true" name="prevvisit">'); |
$r->print('<input type="hidden" value="true" name="prevvisit">'); |
Line 949 sub assessparms {
|
Line 1003 sub assessparms {
|
foreach ('tolerance','date_default','date_start','date_end', |
foreach ('tolerance','date_default','date_start','date_end', |
'date_interval','int','float','string') { |
'date_interval','int','float','string') { |
$r->print('<input type="hidden" value="'. |
$r->print('<input type="hidden" value="'. |
$ENV{'form.recent_'.$_}.'" name="recent_'.$_.'">'); |
$env{'form.recent_'.$_}.'" name="recent_'.$_.'">'); |
} |
} |
|
|
$r->print('<h2>'.$message.'</h2><table>'); |
$r->print('<h2>'.$message.'</h2><table>'); |
Line 989 sub assessparms {
|
Line 1043 sub assessparms {
|
$r->print('<input type="hidden" value="'.$pssymb.'" name="symb">'); |
$r->print('<input type="hidden" value="'.$pssymb.'" name="symb">'); |
} |
} |
|
|
$r->print('<tr><td colspan="3"><hr /><input type="checkbox"'); |
$r->print('<tr><td colspan="3"><hr /><label><input type="checkbox"'); |
if ($showoptions eq 'show') {$r->print(" checked ");} |
if ($showoptions eq 'show') {$r->print(" checked ");} |
$r->print(' name="showoptions" value="show">'.&mt('Show More Options').'<hr /></td></tr>'); |
$r->print(' name="showoptions" value="show" />'.&mt('Show More Options').'</label><hr /></td></tr>'); |
# $r->print("<tr><td>Show: $showoptions</td></tr>"); |
# $r->print("<tr><td>Show: $showoptions</td></tr>"); |
# $r->print("<tr><td>pscat: @pscat</td></tr>"); |
# $r->print("<tr><td>pscat: @pscat</td></tr>"); |
# $r->print("<tr><td>psprt: @psprt</td></tr>"); |
# $r->print("<tr><td>psprt: @psprt</td></tr>"); |
Line 1115 sub assessparms {
|
Line 1169 sub assessparms {
|
if (($prevvisit) || ($pschp) || ($pssymb)) { |
if (($prevvisit) || ($pschp) || ($pssymb)) { |
# ----------------------------------------------------------------- Start Table |
# ----------------------------------------------------------------- Start Table |
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my $csuname=$ENV{'user.name'}; |
my $csuname=$env{'user.name'}; |
my $csudom=$ENV{'user.domain'}; |
my $csudom=$env{'user.domain'}; |
|
|
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
if ($parmlev eq 'full' || $parmlev eq 'brief') { |
my $coursespan=$csec?8:5; |
my $coursespan=$csec?8:5; |
Line 1147 sub assessparms {
|
Line 1201 sub assessparms {
|
$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{'rl'}</th> |
</tr><tr><td colspan=5></td><th colspan=2>$lt{'ic'}</th><th colspan=2>$lt{'rl'}</th> |
<th colspan=3>$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>". |
Line 1157 ENDTABLETWO
|
Line 1212 ENDTABLETWO
|
$r->print(<<ENDTABLEHEADFOUR); |
$r->print(<<ENDTABLEHEADFOUR); |
</tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th> |
</tr><tr><th>$lt{'aut'}</th><th>$lt{'type'}</th> |
<th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th> |
<th>$lt{'emof'}</th><th>$lt{'part'}</th><th>$lt{'pn'}</th> |
<th>$lt{'def'}</th><th>$lt{'femof'}</th> |
<th>$lt{'gen'}</th><th>$lt{'foremf'}</th> |
<th>$lt{'gen'}</th><th>$lt{'foremf'}</th><th>$lt{'fr'}</th> |
<th>$lt{'def'}</th><th>$lt{'femof'}</th><th>$lt{'fr'}</th> |
ENDTABLEHEADFOUR |
ENDTABLEHEADFOUR |
|
|
if ($csec) { |
if ($csec) { |
Line 1184 ENDTABLEHEADFOUR
|
Line 1239 ENDTABLEHEADFOUR
|
|| |
|| |
($pssymb && $pssymb eq $symbp{$rid})) { |
($pssymb && $pssymb eq $symbp{$rid})) { |
# ------------------------------------------------------ Entry for one resource |
# ------------------------------------------------------ Entry for one resource |
if ($defbgone eq '"E0E099"') { |
if ($defbgone eq '"#E0E099"') { |
$defbgone='"E0E0DD"'; |
$defbgone='"#E0E0DD"'; |
} else { |
} else { |
$defbgone='"E0E099"'; |
$defbgone='"#E0E099"'; |
} |
} |
if ($defbgtwo eq '"FFFF99"') { |
if ($defbgtwo eq '"#FFFF99"') { |
$defbgtwo='"FFFFDD"'; |
$defbgtwo='"#FFFFDD"'; |
} else { |
} else { |
$defbgtwo='"FFFF99"'; |
$defbgtwo='"#FFFF99"'; |
} |
} |
my $thistitle=''; |
my $thistitle=''; |
my %name= (); |
my %name= (); |
Line 1201 ENDTABLEHEADFOUR
|
Line 1256 ENDTABLEHEADFOUR
|
my %display=(); |
my %display=(); |
my %type= (); |
my %type= (); |
my %default=(); |
my %default=(); |
my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
|
foreach (split(/\,/,$keyp{$rid})) { |
foreach (split(/\,/,$keyp{$rid})) { |
my $tempkeyp = $_; |
my $tempkeyp = $_; |
Line 1219 ENDTABLEHEADFOUR
|
Line 1274 ENDTABLEHEADFOUR
|
my $totalparms=scalar keys %name; |
my $totalparms=scalar keys %name; |
if ($totalparms>0) { |
if ($totalparms>0) { |
my $firstrow=1; |
my $firstrow=1; |
my $title=$bighash{'title_'.$rid}; |
my $title=&Apache::lonnet::gettitle($uri); |
$title=~s/\:/:/g; |
|
$r->print('<tr><td bgcolor='.$defbgone. |
$r->print('<tr><td bgcolor='.$defbgone. |
' rowspan='.$totalparms. |
' rowspan='.$totalparms. |
'><tt><font size=-1>'. |
'><tt><font size=-1>'. |
Line 1257 ENDTABLEHEADFOUR
|
Line 1311 ENDTABLEHEADFOUR
|
|
|
&print_row($r,$_,\%part,\%name,$rid,\%default, |
&print_row($r,$_,\%part,\%name,$rid,\%default, |
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$parmlev); |
$parmlev,$uname,$udom,$csec); |
} |
} |
} |
} |
} |
} |
Line 1301 ENDTABLEHEADFOUR
|
Line 1355 ENDTABLEHEADFOUR
|
# $r->print("$mapid:$map: $rid <br /> \n"); |
# $r->print("$mapid:$map: $rid <br /> \n"); |
|
|
if ($map eq $mapid) { |
if ($map eq $mapid) { |
my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
# $r->print("Keys: $keyp{$rid} <br />\n"); |
# $r->print("Keys: $keyp{$rid} <br />\n"); |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
Line 1365 ENDMAPONE
|
Line 1419 ENDMAPONE
|
$r->print('<tr>'); |
$r->print('<tr>'); |
&print_row($r,$_,\%part,\%name,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$parmlev); |
$parmlev,$uname,$udom,$csec); |
# $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n"); |
# $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n"); |
} |
} |
$r->print("</table></center>"); |
$r->print("</table></center>"); |
Line 1389 ENDMAPONE
|
Line 1443 ENDMAPONE
|
foreach (@ids) { |
foreach (@ids) { |
my $rid = $_; |
my $rid = $_; |
|
|
my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid}); |
my $uri=&Apache::lonnet::declutter($uris{$rid}); |
|
|
#-------------------------------------------------------------------- |
#-------------------------------------------------------------------- |
# @catmarker contains list of all possible parameters including part #s |
# @catmarker contains list of all possible parameters including part #s |
Line 1442 ENDMAPONE
|
Line 1496 ENDMAPONE
|
foreach (sort keys %name) { |
foreach (sort keys %name) { |
$r->print('<tr>'); |
$r->print('<tr>'); |
&print_row($r,$_,\%part,\%name,$mapid,\%default, |
&print_row($r,$_,\%part,\%name,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$parmlev); |
\%type,\%display,$defbgone,$defbgtwo,$parmlev,$uname,$udom,$csec); |
# $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n"); |
# $r->print("<tr><td>resource.$part{$_}.$name{$_},$symbp{$mapid}</td></tr>\n"); |
} |
} |
$r->print("</table></center>"); |
$r->print("</table></center>"); |
} # end of $parmlev eq general |
} # end of $parmlev eq general |
} |
} |
$r->print('</form></body></html>'); |
$r->print('</form></body></html>'); |
untie(%bighash); |
|
untie(%parmhash); |
untie(%parmhash); |
} # end sub assessparms |
} # end sub assessparms |
|
|
Line 1477 sub crsenv {
|
Line 1530 sub crsenv {
|
my $setoutput=''; |
my $setoutput=''; |
my $bodytag=&Apache::loncommon::bodytag( |
my $bodytag=&Apache::loncommon::bodytag( |
'Set Course Environment Parameters'); |
'Set Course Environment Parameters'); |
my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef, |
my $crs = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
'Edit Course Environment'); |
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
# |
# |
# Go through list of changes |
# Go through list of changes |
foreach (keys %ENV) { |
foreach (keys %env) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
my $value = $ENV{'form.'.$name.'_value'}; |
my $value = $env{'form.'.$name.'_value'}; |
if ($name eq 'newp') { |
if ($name eq 'newp') { |
$name = $ENV{'form.newp_name'}; |
$name = $env{'form.newp_name'}; |
} |
} |
if ($name eq 'url') { |
if ($name eq 'url') { |
$value=~s/^\/res\///; |
$value=~s/^\/res\///; |
Line 1527 sub crsenv {
|
Line 1582 sub crsenv {
|
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
if ($name =~ /^default_enrollment_(start|end)_date$/) { |
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value'); |
$value=&Apache::lonhtmlcommon::get_date_from_form($name.'_value'); |
} |
} |
|
# Get existing cloners |
|
my @oldcloner = (); |
|
if ($name eq 'cloners') { |
|
my %clonenames=&Apache::lonnet::dump('environment',$dom,$crs,'cloners'); |
|
if ($clonenames{'cloners'} =~ /,/) { |
|
@oldcloner = split/,/,$clonenames{'cloners'}; |
|
} else { |
|
$oldcloner[0] = $clonenames{'cloners'}; |
|
} |
|
} |
# |
# |
# Let the user know we made the changes |
# Let the user know we made the changes |
if ($name && defined($value)) { |
if ($name && defined($value)) { |
|
if ($name eq 'cloners') { |
|
$value =~ s/^,//; |
|
$value =~ s/,$//; |
|
} |
my $put_result = &Apache::lonnet::put('environment', |
my $put_result = &Apache::lonnet::put('environment', |
{$name=>$value},$dom,$crs); |
{$name=>$value},$dom,$crs); |
if ($put_result eq 'ok') { |
if ($put_result eq 'ok') { |
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'.$value.'</b>.<br />'; |
$setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'.$value.'</b>.<br />'; |
|
if ($name eq 'cloners') { |
|
&change_clone($value,\@oldcloner); |
|
} |
|
# Flush the course logs so course description is immediately updated |
|
if ($name eq 'description' && defined($value)) { |
|
&Apache::lonnet::flushcourselogs(); |
|
} |
} else { |
} else { |
$setoutput.=&mt('Unable to set').' <b>'.$name.'</b> '.&mt('to'). |
$setoutput.=&mt('Unable to set').' <b>'.$name.'</b> '.&mt('to'). |
' <b>'.$value.'</b> '.&mt('due to').' '.$put_result.'.<br />'; |
' <b>'.$value.'</b> '.&mt('due to').' '.$put_result.'.<br />'; |
Line 1542 sub crsenv {
|
Line 1618 sub crsenv {
|
} |
} |
# ------------------------- 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'}); |
|
|
# -------------------------------------------------------- Get parameters again |
# -------------------------------------------------------- Get parameters again |
|
|
Line 1737 sub crsenv {
|
Line 1813 sub crsenv {
|
my $Value=&mt('Value'); |
my $Value=&mt('Value'); |
my $Set=&mt('Set'); |
my $Set=&mt('Set'); |
my $browse_js=&Apache::loncommon::browser_and_searcher_javascript('parmset'); |
my $browse_js=&Apache::loncommon::browser_and_searcher_javascript('parmset'); |
$r->print(<<ENDENV); |
my $html=&Apache::lonxml::xmlbegin(); |
<html> |
$r->print(<<ENDenv); |
|
$html |
|
<head> |
<script type="text/javascript" language="Javascript" > |
<script type="text/javascript" language="Javascript" > |
$browse_js |
$browse_js |
</script> |
</script> |
<head> |
|
<title>LON-CAPA Course Environment</title> |
<title>LON-CAPA Course Environment</title> |
</head> |
</head> |
$bodytag |
$bodytag |
<form method="post" action="/adm/parmset" name="envform"> |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=crsenv" name="envform"> |
$setoutput |
$setoutput |
<p> |
<p> |
<table border=2> |
<table border=2> |
Line 1757 $output
|
Line 1835 $output
|
</form> |
</form> |
</body> |
</body> |
</html> |
</html> |
ENDENV |
ENDenv |
} |
} |
################################################## |
################################################## |
|
|
Line 1786 sub overview {
|
Line 1864 sub overview {
|
my $r=shift; |
my $r=shift; |
my $bodytag=&Apache::loncommon::bodytag( |
my $bodytag=&Apache::loncommon::bodytag( |
'Set/Modify Course Assessment Parameters'); |
'Set/Modify Course Assessment 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'}; |
|
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(undef,'Overview'); |
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDOVER); |
$r->print(<<ENDOVER); |
<html> |
$html |
<head> |
<head> |
<title>LON-CAPA Course Environment</title> |
<title>LON-CAPA Course Environment</title> |
</head> |
</head> |
$bodytag |
$bodytag |
<form method="post" action="/adm/parmset" name="overviewform"> |
$breadcrumbs |
|
<form method="post" action="/adm/parmset?action=setoverview" name="overviewform"> |
<input type="hidden" name="overview" value="1" /> |
<input type="hidden" name="overview" value="1" /> |
ENDOVER |
ENDOVER |
# Setting |
# Setting |
Line 1803 ENDOVER
|
Line 1884 ENDOVER
|
undef %newdata; |
undef %newdata; |
my @deldata=(); |
my @deldata=(); |
undef @deldata; |
undef @deldata; |
foreach (keys %ENV) { |
foreach (keys %env) { |
if ($_=~/^form\.([a-z]+)\_(.+)$/) { |
if ($_=~/^form\.([a-z]+)\_(.+)$/) { |
my $cmd=$1; |
my $cmd=$1; |
my $thiskey=$2; |
my $thiskey=$2; |
if ($cmd eq 'set') { |
if ($cmd eq 'set') { |
my $data=$ENV{$_}; |
my $data=$env{$_}; |
if ($olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
if ($olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
} elsif ($cmd eq 'del') { |
} elsif ($cmd eq 'del') { |
push (@deldata,$thiskey); |
push (@deldata,$thiskey); |
} elsif ($cmd eq 'datepointer') { |
} elsif ($cmd eq 'datepointer') { |
my $data=&Apache::lonhtmlcommon::get_date_from_form($ENV{$_}); |
my $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_}); |
if (defined($data) and $olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
if (defined($data) and $olddata{$thiskey} ne $data) { $newdata{$thiskey}=$data; } |
} |
} |
} |
} |
Line 1909 ENDOVER
|
Line 1990 ENDOVER
|
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
|
|
=pod |
|
|
|
=item change clone |
|
|
|
Modifies the list of courses a user can clone (stored |
|
in the user's environemnt.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. |
|
|
|
Returns: |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
|
|
|
|
sub change_clone { |
|
my ($clonelist,$oldcloner) = @_; |
|
my ($uname,$udom); |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $clone_crs = $cnum.':'.$cdom; |
|
|
|
if ($cnum && $cdom) { |
|
my @allowclone = (); |
|
if ($clonelist =~ /,/) { |
|
@allowclone = split/,/,$clonelist; |
|
} else { |
|
$allowclone[0] = $clonelist; |
|
} |
|
foreach my $currclone (@allowclone) { |
|
if (!grep/^$currclone$/,@$oldcloner) { |
|
($uname,$udom) = split/:/,$currclone; |
|
if ($uname && $udom) { |
|
unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} eq '') { |
|
$currclonecrs{'cloneable'} = $clone_crs; |
|
} else { |
|
$currclonecrs{'cloneable'} .= ','.$clone_crs; |
|
} |
|
&Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
foreach my $oldclone (@$oldcloner) { |
|
if (!grep/^$oldclone$/,@allowclone) { |
|
($uname,$udom) = split/:/,$oldclone; |
|
if ($uname && $udom) { |
|
unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { |
|
my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable'); |
|
my %newclonecrs = (); |
|
if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) { |
|
if ($currclonecrs{'cloneable'} =~ /,/) { |
|
my @currclonecrs = split/,/,$currclonecrs{'cloneable'}; |
|
foreach (@currclonecrs) { |
|
unless ($_ eq $clone_crs) { |
|
$newclonecrs{'cloneable'} .= $_.','; |
|
} |
|
} |
|
$newclonecrs{'cloneable'} =~ s/,$//; |
|
} else { |
|
$newclonecrs{'cloneable'} = ''; |
|
} |
|
&Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
################################################## |
|
################################################## |
|
|
|
=pod |
|
|
|
=item * header |
|
|
|
Output html header for page |
|
|
|
=cut |
|
|
|
################################################## |
|
################################################## |
|
sub header { |
|
my $html=&Apache::lonxml::xmlbegin(); |
|
my $bodytag=&Apache::loncommon::bodytag('Parameter Manager'); |
|
my $title = &mt('LON-CAPA Parameter Manager'); |
|
return(<<ENDHEAD); |
|
$html |
|
<head> |
|
<title>$title</title> |
|
</head> |
|
$bodytag |
|
ENDHEAD |
|
} |
|
################################################## |
|
################################################## |
|
sub print_main_menu { |
|
my ($r,$parm_permission)=@_; |
|
# |
|
$r->print(<<ENDMAINFORMHEAD); |
|
<form method="post" enctype="multipart/form-data" |
|
action="/adm/parmset" name="studentform"> |
|
ENDMAINFORMHEAD |
|
# |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my @menu = |
|
( |
|
{ text => 'Set Course Environment Parameters', |
|
help => 'Course_Setting_Parameters', |
|
action => 'crsenv', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Set/Modify Course Assessment Parameters - Helper Mode', |
|
url => '/adm/helper/parameter.helper', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Modify Course Assessment Parameters - Overview Mode', |
|
action => 'setoverview', |
|
permission => $parm_permission, |
|
}, |
|
{ text => 'Set/Modify Course Assessment Parameters - Table Mode', |
|
action => 'settable', |
|
permission => $parm_permission, |
|
}, |
|
# { text => 'Set Parameter Default Preferences', |
|
# help => 'Course_View_Class_List', |
|
# action => 'setdefaults', |
|
# permission => $parm_permission, |
|
# }, |
|
); |
|
my $menu_html = ''; |
|
foreach my $menu_item (@menu) { |
|
next if (! $menu_item->{'permission'}); |
|
$menu_html.='<p>'; |
|
$menu_html.='<font size="+1">'; |
|
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></font>'; |
|
if (exists($menu_item->{'help'})) { |
|
$menu_html.= |
|
&Apache::loncommon::help_open_topic($menu_item->{'help'}); |
|
} |
|
$menu_html.='</p>'.$/; |
|
} |
|
$r->print($menu_html); |
|
return; |
|
} |
|
|
|
|
|
|
|
|
|
################################################## |
|
################################################## |
|
|
=pod |
=pod |
|
|
Line 1917 ENDOVER
|
Line 2170 ENDOVER
|
Main handler. Calls &assessparms and &crsenv subroutines. |
Main handler. Calls &assessparms and &crsenv subroutines. |
|
|
=cut |
=cut |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
use Data::Dumper; |
use Data::Dumper; |
Line 1929 sub handler {
|
Line 2181 sub handler {
|
$r->send_http_header; |
$r->send_http_header; |
return OK; |
return OK; |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
|
['action','state']); |
|
|
# ----------------------------------------------------------- Clear out garbage |
# ----------------------------------------------------------- Clear out garbage |
|
|
Line 1945 sub handler {
|
Line 2198 sub handler {
|
|
|
%maptitles=(); |
%maptitles=(); |
|
|
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset", |
|
text=>"Parameter Manager", |
|
faq=>9, |
|
bug=>'Instructor Interface'}); |
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
|
my $parm_permission = |
|
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
|
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
|
$env{'request.course.sec'})); |
|
if ($env{'request.course.id'} && $parm_permission) { |
|
|
if (($ENV{'request.course.id'}) && |
# Start Page |
(&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}) || |
|
&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}.'/'. |
|
$ENV{'request.course.sec'}) |
|
)) { |
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
$coursename=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
|
|
|
if (($ENV{'form.crsenv'}) || (!$ENV{'request.course.fn'})) { |
# |
# ---------------------------------------------- This is for course environment |
# Main switch on form.action and form.state, as appropriate |
# -------------------------- also call if toplevel map coudl not be initialized |
# |
&crsenv($r); |
# Check first if coming from someone else headed directly for |
} elsif ($ENV{'form.overview'}) { |
# the table mode |
# --------------------------------------------------------------- Overview mode |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
|
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
|
&assessparms($r); |
|
|
|
} elsif (! exists($env{'form.action'})) { |
|
$r->print(&header()); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
|
'Parameter Manager')); |
|
&print_main_menu($r,$parm_permission); |
|
} elsif ($env{'form.action'} eq 'crsenv' && $parm_permission) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', |
|
text=>"Course Environment"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs(undef, |
|
'Edit Course Environment')); |
|
&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); |
} else { |
} elsif ($env{'form.action'} eq 'settable' && $parm_permission) { |
# --------------------------------------------------------- Bring up assessment |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
|
text=>"Table Mode"}); |
&assessparms($r); |
&assessparms($r); |
} |
} |
|
|
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |
$ENV{'user.error.msg'}= |
$env{'user.error.msg'}= |
"/adm/parmset:opa:0:0:Cannot modify assessment parameters"; |
"/adm/parmset:opa:0:0:Cannot modify assessment parameters"; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |