Annotation of loncom/homework/loncapagrade.pm, revision 1.7

1.1       albertel    1: # The LearningOnline Network with CAPA
                      2: # external style responses
                      3: #
1.7     ! www         4: # $Id: loncapagrade.pm,v 1.6 2008/11/20 15:19:15 jms Exp $
1.1       albertel    5: #
                      6: # Copyright Michigan State University Board of Trustees
                      7: #
                      8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      9: #
                     10: # LON-CAPA is free software; you can redistribute it and/or modify
                     11: # it under the terms of the GNU General Public License as published by
                     12: # the Free Software Foundation; either version 2 of the License, or
                     13: # (at your option) any later version.
                     14: #
                     15: # LON-CAPA is distributed in the hope that it will be useful,
                     16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     18: # GNU General Public License for more details.
                     19: #
                     20: # You should have received a copy of the GNU General Public License
                     21: # along with LON-CAPA; if not, write to the Free Software
                     22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     23: #
                     24: # /home/httpd/html/adm/gpl.txt
                     25: #
                     26: # http://www.lon-capa.org/
                     27: #
                     28: # 1/26 Guy
1.5       jms        29: 
                     30: 
                     31: 
1.1       albertel   32: package Apache::loncapagrade;
                     33: use strict;
                     34: 
                     35: #Globals
                     36: # results of parse end up in here
1.4       albertel   37: undef(%Apache::loncapagrade::results);
1.1       albertel   38: 
                     39: BEGIN {
                     40: #  &Apache::lonxml::register('Apache::loncapagrade',
1.4       albertel   41: #			    ('loncapagrade','awarddetail','message'));
1.1       albertel   42: }
                     43: 
                     44: sub start_loncapagrade {
1.3       albertel   45:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                     46:     my $result;
                     47:     if ($target eq 'grade') {
1.4       albertel   48: 	undef(%Apache::loncapagrade::results);
1.3       albertel   49: 	&Apache::lonxml::register('Apache::loncapagrade',
1.7     ! www        50: 				  ('awarddetail','message','awarded'));
1.3       albertel   51:     }
                     52:     return $result;
1.1       albertel   53: }
                     54: 
                     55: sub end_loncapagrade {
1.3       albertel   56:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                     57:     my $result;
                     58:     if ($target eq 'grade') {
                     59: 	&Apache::lonxml::deregister('Apache::loncapagrade',
1.7     ! www        60: 				    ('loncapagrade','awarddetail','message','awarded'));
1.3       albertel   61:     }
                     62:     return $result;
1.1       albertel   63: }
                     64: 
                     65: sub start_awarddetail {
1.3       albertel   66:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                     67:     my $result;
                     68:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
                     69:     return $result;
1.1       albertel   70: }
                     71: 
                     72: sub end_awarddetail {
1.3       albertel   73:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                     74:     my $result;
                     75:     if ($target eq 'grade') {
                     76: 	$Apache::loncapagrade::results{'awarddetail'}=
                     77: 	    &Apache::lonxml::endredirection();
                     78:     }
                     79:     return $result;
1.1       albertel   80: }
                     81: 
1.7     ! www        82: sub start_awarded {
        !            83:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
        !            84:     my $result;
        !            85:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
        !            86:     return $result;
        !            87: }
        !            88: 
        !            89: sub end_awarded {
        !            90:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
        !            91:     my $result;
        !            92:     if ($target eq 'grade') {
        !            93:         $Apache::loncapagrade::results{'awarded'}=
        !            94:             &Apache::lonxml::endredirection();
        !            95:     }
        !            96:     return $result;
        !            97: }
        !            98: 
        !            99: 
1.1       albertel  100: sub start_message {
1.3       albertel  101:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                    102:     my $result;
                    103:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
                    104:     return $result;
1.1       albertel  105: }
                    106: 
                    107: sub end_message {
1.3       albertel  108:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
                    109:     my $result;
                    110:     if ($target eq 'grade') {
                    111: 	$Apache::loncapagrade::results{'message'}=
                    112: 	    &Apache::lonxml::endredirection();
                    113:     }
                    114:     return $result;
1.1       albertel  115: }
                    116: 
                    117: 1;
                    118: __END__
                    119: 
1.6       jms       120: =pod
                    121: 
                    122: =head1 NAME
                    123: 
                    124: Apache::loncapagrade
                    125: 
                    126: =head1 SYNOPSIS
                    127: 
                    128: Handler to evaluate externally graded responses.
                    129: 
                    130: This is part of the LearningOnline Network with CAPA project
                    131: described at http://www.lon-capa.org.
                    132: 
                    133: =head1 SUBROUTINES
                    134: 
                    135: =over
                    136: 
                    137: =item start_loncapagrade()
                    138: 
                    139: =item end_loncapagrade()
                    140: 
                    141: =item start_awarddetail()
                    142: 
                    143: =item end_awarddetail()
                    144: 
                    145: =item start_message()
                    146: 
                    147: =item end_message()
                    148: 
                    149: =back
                    150: 
                    151: =head2 notes
                    152: 
                    153: results of parse end up in here:
                    154: undef(%Apache::loncapagrade::results);
                    155: 
                    156: =cut
                    157: 
                    158: 

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