--- loncom/interface/lonparmset.pm 2000/11/27 12:14:32 1.13 +++ loncom/interface/lonparmset.pm 2001/09/01 14:13:47 1.34 @@ -9,7 +9,10 @@ # # 10/11,10/12,10/16 Gerd Kortemeyer) # -# 11/20,11/21,11/22,11/23,11/24,11/25,11/27 Gerd Kortemeyer +# 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28, +# 12/08,12/12, +# 16/01/01,02/08,03/20,03/23,03/24,03/26,05/09, +# 07/05,07/06,08/08,08/09,09/01 Gerd Kortemeyer package Apache::lonparmset; @@ -17,7 +20,6 @@ use strict; use Apache::lonnet; use Apache::Constants qw(:common :http REDIRECT); use GDBM_File; -use Apache::lonmeta; my %courseopt; @@ -31,6 +33,11 @@ my @ids; my %symbp; my %mapp; my %typep; +my %keyp; +my %defp; + +my %allkeys; +my %allmaps; my $uname; my $udom; @@ -53,13 +60,13 @@ sub parmval { my $seclevel= $ENV{'request.course.id'}.'.['. - $ENV{'request.course.sec'}.'].'.$what; + $csec.'].'.$what; my $seclevelr= $ENV{'request.course.id'}.'.['. - $ENV{'request.course.sec'}.'].'.$symbparm; + $csec.'].'.$symbparm; my $seclevelm= $ENV{'request.course.id'}.'.['. - $ENV{'request.course.sec'}.'].'.$mapparm; + $csec.'].'.$mapparm; my $courselevel= $ENV{'request.course.id'}.'.'.$what; @@ -121,16 +128,6 @@ sub parmval { return $result; } -# ---------------------------------------------------------------- Sort routine - -sub bycat { - if ($fcat eq '') { - $a<=>$b; - } else { - &parmval('0.'.$fcat,$a)<=>&parmval('0.'.$fcat,$b); - } -} - # ------------------------------------------------------------ Output for value sub valout { @@ -143,26 +140,23 @@ sub valout { sub plink { my ($type,$dis,$value,$marker,$return,$call)=@_; - return ''. - &valout($value,$type).''; + &valout($value,$type).''; } -# ================================================================ Main Handler +sub assessparms { -sub handler { - my $r=shift; - - if ($r->header_only) { - $r->content_type('text/html'); - $r->send_http_header; - return OK; - } - -# ----------------------------------------------------- Needs to be in a course - - if (($ENV{'request.course.fn'}) && - (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) { + my $r=shift; # -------------------------------------------------------- Variable declaration %courseopt=(); @@ -177,6 +171,25 @@ sub handler { $csec=$ENV{'form.csec'}; $udom=$ENV{'form.udom'}; + unless ($udom) { $udom=$r->dir_config('lonDefDomain'); } + + my $pscat=$ENV{'form.pscat'}; + my $pschp=$ENV{'form.pschp'}; + my $pssymb=''; + +# ----------------------------------------------- Was this started from grades? + + if (($ENV{'form.command'} eq 'set') && ($ENV{'form.url'}) + && (!$ENV{'form.dis'})) { + my $url=$ENV{'form.url'}; + $url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; + $pssymb=&Apache::lonnet::symbread($url); + $pscat='all'; + $pschp=''; + } else { + $ENV{'form.url'}=''; + } + my $id=$ENV{'form.id'}; if (($id) && ($udom)) { $uname=(&Apache::lonnet::idget($udom,$id))[1]; @@ -184,7 +197,7 @@ sub handler { $id=''; } else { $message= - "