Annotation of loncom/interface/lonparmset.pm, revision 1.1

1.1     ! www         1: # The LearningOnline Network with CAPA
        !             2: # Handler to set parameters for assessments
        !             3: #
        !             4: # (Handler to resolve ambiguous file locations
        !             5: #
        !             6: # (TeX Content Handler
        !             7: #
        !             8: # 05/29/00,05/30,10/11 Gerd Kortemeyer)
        !             9: #
        !            10: # 10/11,10/12,10/16 Gerd Kortemeyer)
        !            11: #
        !            12: # 11/20 Gerd Kortemeyer
        !            13: 
        !            14: package Apache::lonparmset;
        !            15: 
        !            16: use strict;
        !            17: use Apache::lonnet;
        !            18: use Apache::Constants qw(:common :http REDIRECT);
        !            19: use GDBM_File;
        !            20: 
        !            21: # ================================================================ Main Handler
        !            22: 
        !            23: sub handler {
        !            24:    my $r=shift;
        !            25: 
        !            26:    if ($r->header_only) {
        !            27:       $r->content_type('text/html');
        !            28:       $r->send_http_header;
        !            29:       return OK;
        !            30:    }
        !            31: 
        !            32: # ----------------------------------------------------- Needs to be in a course
        !            33: 
        !            34:    if (($ENV{'request.course.fn'}) && 
        !            35:        (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) {
        !            36: 
        !            37:       my %bighash;
        !            38:       if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
        !            39:                        &GDBM_READER,0640)) {
        !            40:          $r->content_type('text/html');
        !            41:          $r->send_http_header;
        !            42: 	 $r->print('<html><body bgcolor="#FFFFFF">');
        !            43: 
        !            44:          $r->print('</body></html>');
        !            45:          untie(%bighash);
        !            46:       }
        !            47:    } else {
        !            48: # ----------------------------- Not in a course, or not allowed to modify parms
        !            49:       $ENV{'user.error.msg'}=
        !            50:         "/adm/flip:opa:0:0:Cannot modify assessment parameters";
        !            51:       return HTTP_NOT_ACCEPTABLE; 
        !            52:    }
        !            53:    return OK;
        !            54: }
        !            55: 
        !            56: 1;
        !            57: __END__
        !            58: 
        !            59: 
        !            60: 
        !            61: 
        !            62: 
        !            63: 
        !            64: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>