File:  [LON-CAPA] / loncom / homework / loncapagrade.pm
Revision 1.8: download - view: text, annotated - select for diffs
Fri Aug 23 10:03:53 2013 UTC (10 years, 8 months ago) by kruse
Branches: MAIN
CVS tags: version_2_12_X, HEAD
Introduced "handbackurl"-tag and subroutines to make URLs of handbackfiles from external grader accessible.

    1: # The LearningOnline Network with CAPA
    2: # external style responses
    3: #
    4: # $Id: loncapagrade.pm,v 1.8 2013/08/23 10:03:53 kruse 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: 
   30: 
   31: 
   32: package Apache::loncapagrade;
   33: use strict;
   34: 
   35: #Globals
   36: # results of parse end up in here
   37: undef(%Apache::loncapagrade::results);
   38: 
   39: BEGIN {
   40: #  &Apache::lonxml::register('Apache::loncapagrade',
   41: #			    ('loncapagrade','awarddetail','message'));
   42: }
   43: 
   44: sub start_loncapagrade {
   45:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   46:     my $result;
   47:     if ($target eq 'grade') {
   48: 	undef(%Apache::loncapagrade::results);
   49: 	&Apache::lonxml::register('Apache::loncapagrade',
   50: 				  ('awarddetail','message','awarded','handbackurl'));
   51:     }
   52:     return $result;
   53: }
   54: 
   55: sub end_loncapagrade {
   56:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   57:     my $result;
   58:     if ($target eq 'grade') {
   59: 	&Apache::lonxml::deregister('Apache::loncapagrade',
   60: 				    ('loncapagrade','awarddetail','message','awarded','handbackurl'));
   61:     }
   62:     return $result;
   63: }
   64: 
   65: sub start_awarddetail {
   66:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   67:     my $result;
   68:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
   69:     return $result;
   70: }
   71: 
   72: sub end_awarddetail {
   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;
   80: }
   81: 
   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: sub start_handbackurl {
  100:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  101:     my $result;
  102:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
  103:     return $result;
  104: }
  105: 
  106: sub end_handbackurl {
  107:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  108:     my $result;
  109:     if ($target eq 'grade') {
  110:         $Apache::loncapagrade::results{'handbackurl'}=
  111:             &Apache::lonxml::endredirection();
  112:     }
  113:     return $result;
  114: }
  115: 
  116: sub start_message {
  117:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  118:     my $result;
  119:     if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
  120:     return $result;
  121: }
  122: 
  123: sub end_message {
  124:     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  125:     my $result;
  126:     if ($target eq 'grade') {
  127: 	$Apache::loncapagrade::results{'message'}=
  128: 	    &Apache::lonxml::endredirection();
  129:     }
  130:     return $result;
  131: }
  132: 
  133: 1;
  134: __END__
  135: 
  136: =pod
  137: 
  138: =head1 NAME
  139: 
  140: Apache::loncapagrade
  141: 
  142: =head1 SYNOPSIS
  143: 
  144: Handler to evaluate externally graded responses.
  145: 
  146: This is part of the LearningOnline Network with CAPA project
  147: described at http://www.lon-capa.org.
  148: 
  149: =head1 SUBROUTINES
  150: 
  151: =over
  152: 
  153: =item start_loncapagrade()
  154: 
  155: =item end_loncapagrade()
  156: 
  157: =item start_awarddetail()
  158: 
  159: =item end_awarddetail()
  160: 
  161: =item start_message()
  162: 
  163: =item end_message()
  164: 
  165: =back
  166: 
  167: =head2 notes
  168: 
  169: results of parse end up in here:
  170: undef(%Apache::loncapagrade::results);
  171: 
  172: =cut
  173: 
  174: 

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