--- loncom/homework/inputtags.pm 2003/04/30 13:44:30 1.97 +++ loncom/homework/inputtags.pm 2003/05/06 15:31:45 1.98 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.97 2003/04/30 13:44:30 sakharuk Exp $ +# $Id: inputtags.pm,v 1.98 2003/05/06 15:31:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,7 +33,7 @@ use strict; use Apache::loncommon; BEGIN { - &Apache::lonxml::register('Apache::inputtags',('textfield','textline')); + &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline')); } @@ -200,6 +200,34 @@ sub end_textline { return ""; } +sub start_hiddenline { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $result = ""; + if ($target eq 'web') { + $Apache::lonxml::evaluate--; + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { + my $partid=$Apache::inputtags::part; + my $id=$Apache::inputtags::response[-1]; + my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$id.submission"}); + if ($Apache::lonhomework::type ne 'exam') { + $result= ''; + } + } + } elsif ($target eq 'edit') { + $result=&Apache::edit::tag_start($target,$token); + $result.=&Apache::edit::end_table; + } + return $result; +} + +sub end_hiddenline { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + if ($target eq 'web') { $Apache::lonxml::evaluate++; } + elsif ($target eq 'edit') { return ('','no'); } + return ""; +} + sub finalizeawards { my $result=''; my $award; @@ -350,8 +378,8 @@ sub decideoutput { } else { $message = "Unknown message: $award"; $button=1; - } - if (lc($Apache::lonhomework::problemstatus) ne 'yes') { + } + if (lc($Apache::lonhomework::problemstatus) eq 'no') { $message = "Answer Submitted"; $button=1; }