--- loncom/homework/inputtags.pm 2001/06/01 15:52:50 1.34 +++ loncom/homework/inputtags.pm 2001/07/12 19:27:48 1.37 @@ -42,7 +42,7 @@ sub end_input { } sub start_textarea { - my ($target,$token,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result = ""; my $id = &start_input($parstack,$safeeval); if ($target eq 'web') { @@ -62,7 +62,7 @@ sub start_textarea { } sub end_textarea { - my ($target,$token,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; if ($target eq 'web') { return ""; } @@ -71,7 +71,7 @@ sub end_textarea { } sub start_textline { - my ($target,$token,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result = ""; if ($target eq 'web') { my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval); @@ -79,11 +79,21 @@ sub start_textline { 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)); + $result.=&Apache::edit::text_arg('Size:','size',$token,'5').""; + $result.=&Apache::edit::end_table; + } + if ($target eq 'modified') { + my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size'); + if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } + } return $result; } sub end_textline { - my ($target,$token,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + if ($target eq 'edit') { return ('','no'); } return ""; } @@ -92,7 +102,7 @@ sub start_datasubmission { } sub end_datasubmission { - my ($target,$token,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; if ( $target == 'web' ) { return ''; } @@ -148,9 +158,22 @@ sub decideoutput { my ($award,$solved)=@_; my $message=''; my $button=0; - if ($solved =~ /^correct/ || $award eq 'EXACT_ANS' || $award eq 'APPROX_ANS' ) { - $message = "You are correct. Your receipt is ".&Apache::lonnet::receipt; + if ($solved =~ /^correct/) { + $message = "You are correct. Your receipt is ". + &Apache::lonnet::receipt; + $button=0; + } elsif ($solved =~ /^excused/) { + $message = "You are excused from the problem."; $button=0; + } elsif ($award eq 'EXACT_ANS' || $award eq 'APPROX_ANS' ) { + if ($solved =~ /^incorrect/ || $solved eq '') { + $message = "Incorrect"; + $button=1; + } else { + $message = "You are correct. Your receipt is ". + &Apache::lonnet::receipt; + $button=0; + } } elsif ($award eq 'NO_RESPONSE') { $message = ''; $button=1;