--- loncom/homework/essayresponse.pm 2001/12/04 15:17:56 1.5
+++ loncom/homework/essayresponse.pm 2002/07/09 17:18:25 1.8
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.5 2001/12/04 15:17:56 albertel Exp $
+# $Id: essayresponse.pm,v 1.8 2002/07/09 17:18:25 ng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -29,7 +29,7 @@
package Apache::essayresponse;
use strict;
-sub BEGIN {
+BEGIN {
&Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
}
@@ -40,6 +40,10 @@ sub start_essayresponse {
if ($target eq 'meta') {
$result=&Apache::response::meta_package_write('essayresponse');
}
+# if ($target eq 'web') {
+# $result='
Collaborators: ';
+# }
return $result;
}
@@ -49,9 +53,14 @@ sub end_essayresponse {
if ( defined $ENV{'form.submitted'}) {
my $id = $Apache::inputtags::response['-1'];
my $response = $ENV{'form.HWVAL'.$Apache::inputtags::response['-1']};
+ my $collaborators = $ENV{'form.HWCOL'.$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";
+ my $part=$Apache::inputtags::part;
+ $Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;
+ $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}="SUBMITTED";
+# $Apache::lonhomework::results{"resource.$part.$id.collaborators"}=$collaborators;
+ my %previous=&Apache::response::check_for_previous($response,$part,$id);
+ &Apache::response::handle_previous(\%previous,'SUBMITTED');
}
}
}