--- loncom/homework/inputtags.pm 2001/08/06 20:33:23 1.43
+++ loncom/homework/inputtags.pm 2001/08/18 07:56:51 1.44
@@ -79,15 +79,18 @@ sub start_textline {
if ($target eq 'web') {
my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
if ($size eq '') { $size=20; }
- my $oldresponse = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.$Apache::inputtags::response['-1'].submission"};
- $result= '';
- }
- if ($target eq 'edit') {
- $result.=&Apache::edit::tag_start($target,$token,&Apache::lonxml::description($token));
+ my $partid=$Apache::inputtags::part;
+ my $id=$Apache::inputtags::response['-1'];
+ my $oldresponse =
+ $Apache::lonhomework::history{"resource.$partid.$id.submission"};
+ $result= '';
+ } elsif ($target eq 'edit') {
+ $result=&Apache::edit::tag_start($target,$token,
+ &Apache::lonxml::description($token));
$result.=&Apache::edit::text_arg('Size:','size',$token,'5')."";
$result.=&Apache::edit::end_table;
- }
- if ($target eq 'modified') {
+ } elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size');
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
}
@@ -101,15 +104,37 @@ sub end_textline {
}
sub start_datasubmission {
- return '';
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $id = &Apache::response::start_response($parstack,$safeeval);
+ my $result;
+ if ($target eq 'meta') {
+ $result = &Apache::response::meta_stores_write($token->[2]->{'name'},
+ $token->[2]->{'type'},
+ $token->[2]->{'display'});
+ $result .= &Apache::response::meta_package_write('datasubmission');
+ }
+ return $result;
}
sub end_datasubmission {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ( $target == 'web' ) {
- return '';
+ my $result;
+ if ( $target eq 'web' ) {
+ } elsif ($target eq 'grade' ) {
+ if ( defined $ENV{'form.submitted'}) {
+ &Apache::response::setup_params('datasubmission');
+ my $partid = $Apache::inputtags::part;
+ my $id = $Apache::inputtags::response['-1'];
+ my $response = $ENV{'form.HWVAL'.$id};
+ my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
+ if ( $response =~ /[^\s]/) {
+ $Apache::lonhomework::results{"resource.$partid.$id.$name"}=
+ $response;
+ }
+ }
}
- return '';
+ &Apache::response::end_response;
+ return $result;
}
sub finalizeawards {