# The LearningOnline Network with CAPA # essay (ungraded) style responses # 4/3 Guy package Apache::essayresponse; use strict; sub BEGIN { &Apache::lonxml::register('Apache::essayresponse',('essayresponse')); } sub start_essayresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $id = &Apache::response::start_response($parstack,$safeeval); return ''; } sub end_essayresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; if ( $target eq 'grade' ) { if ( defined $ENV{'form.submitted'}) { my $id = $Apache::inputtags::response['-1']; my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']}; if ( $response =~ /[^\s]/) { $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=$response; $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}="SUBMITTED"; } } } &Apache::response::end_response; return ''; } 1; __END__