--- loncom/homework/inputtags.pm 2006/11/01 23:24:52 1.210 +++ loncom/homework/inputtags.pm 2006/12/14 04:31:32 1.211 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.210 2006/11/01 23:24:52 albertel Exp $ +# $Id: inputtags.pm,v 1.211 2006/12/14 04:31:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -372,12 +372,18 @@ sub end_textline { sub start_hiddenline { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result = ""; + my $input_id = &start_input($parstack,$safeeval); 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"},'<>&"'); + my $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; + if (ref($oldresponse) eq 'ARRAY') { + $oldresponse = $oldresponse->[$#Apache::inputtags::inputlist]; + } + $oldresponse = &HTML::Entities::encode($oldresponse,'<>&"'); + if ($Apache::lonhomework::type ne 'exam') { $result= ''; @@ -400,6 +406,7 @@ sub end_hiddenline { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; if ($target eq 'web') { $Apache::lonxml::evaluate++; } elsif ($target eq 'edit') { return ('','no'); } + &end_input(); return ""; }