File:  [LON-CAPA] / loncom / homework / loncapagrade.pm
Revision 1.4: download - view: text, annotated - select for diffs
Tue Sep 11 19:07:01 2007 UTC (16 years, 8 months ago) by albertel
Branches: MAIN
CVS tags: version_2_8_X, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_99_1, version_2_5_99_0, HEAD, GCI_1
- BUG#5419, get <externalresponse> operational again
   - xmlparse needs to have parser_env primed
   - misspelling in dereister was leaking memory

    1: # The LearningOnline Network with CAPA
    2: # external style responses
    3: #
    4: # $Id: loncapagrade.pm,v 1.4 2007/09/11 19:07:01 albertel Exp $
    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
   29: package Apache::loncapagrade;
   30: use strict;
   31: 
   32: #Globals
   33: # results of parse end up in here
   34: undef(%Apache::loncapagrade::results);
   35: 
   36: BEGIN {
   37: #  &Apache::lonxml::register('Apache::loncapagrade',
   38: #			    ('loncapagrade','awarddetail','message'));
   39: }
   40: 
   41: sub start_loncapagrade {
   42:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   43:     my $result;
   44:     if ($target eq 'grade') {
   45: 	undef(%Apache::loncapagrade::results);
   46: 	&Apache::lonxml::register('Apache::loncapagrade',
   47: 				  ('awarddetail','message'));
   48:     }
   49:     return $result;
   50: }
   51: 
   52: sub end_loncapagrade {
   53:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   54:     my $result;
   55:     if ($target eq 'grade') {
   56: 	&Apache::lonxml::deregister('Apache::loncapagrade',
   57: 				    ('loncapagrade','awarddetail','message'));
   58:     }
   59:     return $result;
   60: }
   61: 
   62: sub start_awarddetail {
   63:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   64:     my $result;
   65:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
   66:     return $result;
   67: }
   68: 
   69: sub end_awarddetail {
   70:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   71:     my $result;
   72:     if ($target eq 'grade') {
   73: 	$Apache::loncapagrade::results{'awarddetail'}=
   74: 	    &Apache::lonxml::endredirection();
   75:     }
   76:     return $result;
   77: }
   78: 
   79: sub start_message {
   80:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   81:     my $result;
   82:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
   83:     return $result;
   84: }
   85: 
   86: sub end_message {
   87:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   88:     my $result;
   89:     if ($target eq 'grade') {
   90: 	$Apache::loncapagrade::results{'message'}=
   91: 	    &Apache::lonxml::endredirection();
   92:     }
   93:     return $result;
   94: }
   95: 
   96: 1;
   97: __END__
   98: 

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