Annotation of loncom/homework/essayresponse.pm, revision 1.3
1.1 albertel 1: # The LearningOnline Network with CAPA
2: # essay (ungraded) style responses
3: # 4/3 Guy
4: package Apache::essayresponse;
5: use strict;
6:
7: sub BEGIN {
8: &Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
9: }
10:
11: sub start_essayresponse {
1.3 ! albertel 12: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.1 albertel 13: my $id = &Apache::response::start_response($parstack,$safeeval);
14: return '';
15: }
16:
17: sub end_essayresponse {
1.3 ! albertel 18: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
1.1 albertel 19: if ( $target eq 'grade' ) {
20: if ( defined $ENV{'form.submitted'}) {
21: my $id = $Apache::inputtags::response['-1'];
1.2 albertel 22: my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
23: if ( $response =~ /[^\s]/) {
24: $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$response;
25: $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}="SUBMITTED";
26: }
1.1 albertel 27: }
28: }
29: &Apache::response::end_response;
30: return '';
31: }
1.2 albertel 32:
33: 1;
34: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>