--- loncom/homework/inputtags.pm 2001/06/02 03:59:59 1.35 +++ loncom/homework/inputtags.pm 2001/07/13 14:02:35 1.38 @@ -31,6 +31,7 @@ sub initialize_inputtags { sub start_input { my ($parstack,$safeeval)=@_; my $id = &Apache::lonxml::get_param('id',$parstack,$safeeval); + if ($id eq '') { $id = $Apache::lonxml::curdepth; } push (@Apache::inputtags::input,$id); push (@Apache::inputtags::inputlist,$id); return $id; @@ -79,11 +80,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,$tagstack,$parstack,$parser,$safeeval)=@_; + if ($target eq 'edit') { return ('','no'); } return ""; } @@ -148,9 +159,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;