--- loncom/interface/lonhelper.pm 2006/12/18 21:48:47 1.160 +++ loncom/interface/lonhelper.pm 2007/09/01 00:41:42 1.163 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.160 2006/12/18 21:48:47 albertel Exp $ +# $Id: lonhelper.pm,v 1.163 2007/09/01 00:41:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1008,6 +1008,9 @@ sub start_message { if (defined($token->[2]{'nextstate'})) { $paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; } + if (defined($token->[2]{'type'})) { + $paramHash->{TYPE} = $token->[2]{'type'}; + } return ''; } @@ -1023,8 +1026,16 @@ sub end_message { sub render { my $self = shift; - - return &mtn($self->{MESSAGE_TEXT}); + + if ($self->{TYPE} =~ /^\s*warning\s*$/i) { + $self->{MESSAGE_TEXT} = + ''. $self->{MESSAGE_TEXT}.''; + } + if ($self->{TYPE} =~ /^\s*error\s*$/i) { + $self->{MESSAGE_TEXT} = + ''. $self->{MESSAGE_TEXT}.''; + } + return $self->{MESSAGE_TEXT}; } # If a NEXTSTATE was given, switch to it sub postprocess { @@ -1477,7 +1488,7 @@ BUTTONS $choiceLabel = &$choiceLabel($helper, $self); } $result .= "/> ".qq{"; + &mtn($choiceLabel). ""; if ($choice->[4]) { $result .='