File:
[LON-CAPA] /
loncom /
homework /
loncapagrade.pm
Revision
1.7:
download - view:
text,
annotated -
select for diffs
Fri Apr 29 00:32:08 2011 UTC (13 years, 3 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_11_X,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
HEAD,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
Bug #6452: partial correctness from externalresponse
1: # The LearningOnline Network with CAPA
2: # external style responses
3: #
4: # $Id: loncapagrade.pm,v 1.7 2011/04/29 00:32:08 www 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'));
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'));
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:
100: sub start_message {
101: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
102: my $result;
103: if ($target eq 'grade') { &Apache::lonxml::startredirection(); }
104: return $result;
105: }
106:
107: sub end_message {
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;
115: }
116:
117: 1;
118: __END__
119:
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>