Annotation of loncom/homework/essayresponse.pm, revision 1.8
1.1 albertel 1: # The LearningOnline Network with CAPA
2: # essay (ungraded) style responses
1.5 albertel 3: #
1.8 ! ng 4: # $Id: essayresponse.pm,v 1.7 2002/01/18 17:45:30 albertel Exp $
1.5 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: #
1.1 albertel 28: # 4/3 Guy
29: package Apache::essayresponse;
30: use strict;
31:
1.6 harris41 32: BEGIN {
1.1 albertel 33: &Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
34: }
35:
36: sub start_essayresponse {
1.3 albertel 37: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.4 albertel 38: my $result;
1.1 albertel 39: my $id = &Apache::response::start_response($parstack,$safeeval);
1.4 albertel 40: if ($target eq 'meta') {
41: $result=&Apache::response::meta_package_write('essayresponse');
42: }
1.8 ! ng 43: # if ($target eq 'web') {
! 44: # $result='<br />Collaborators: <input type="text" size="20" name="HWCOL'.
! 45: # $Apache::inputtags::response['-1']."' />';
! 46: # }
1.4 albertel 47: return $result;
1.1 albertel 48: }
49:
50: sub end_essayresponse {
1.3 albertel 51: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.1 albertel 52: if ( $target eq 'grade' ) {
53: if ( defined $ENV{'form.submitted'}) {
54: my $id = $Apache::inputtags::response['-1'];
1.2 albertel 55: my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
1.8 ! ng 56: my $collaborators = $ENV{'form.HWCOL'.$Apache::inputtags::response['-1']};
1.2 albertel 57: if ( $response =~ /[^\s]/) {
1.7 albertel 58: my $part=$Apache::inputtags::part;
59: $Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;
60: $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}="SUBMITTED";
1.8 ! ng 61: # $Apache::lonhomework::results{"resource.$part.$id.collaborators"}=$collaborators;
1.7 albertel 62: my %previous=&Apache::response::check_for_previous($response,$part,$id);
63: &Apache::response::handle_previous(\%previous,'SUBMITTED');
1.2 albertel 64: }
1.1 albertel 65: }
66: }
67: &Apache::response::end_response;
68: return '';
69: }
1.2 albertel 70:
71: 1;
72: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>