--- loncom/homework/grades.pm 2012/12/10 13:28:54 1.596.2.12.2.10 +++ loncom/homework/grades.pm 2017/05/19 16:48:56 1.596.2.12.2.39 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.596.2.12.2.10 2012/12/10 13:28:54 raeburn Exp $ +# $Id: grades.pm,v 1.596.2.12.2.39 2017/05/19 16:48:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -253,7 +253,7 @@ sub showResourceInfo { $result.='
'.&keywords_highlight($answer).''; } elsif ( $response eq 'organic') { - my $result='Smile representation: "'.$answer.'"'; + my $result=&mt('Smile representation: [_1]', + '"'.&HTML::Entities::encode($answer, '"<>&').'"'); my $jme=$record->{$version."resource.$partid.$respid.molecule"}; $result.=&Apache::chemresponse::jme_img($jme,$answer,400); return $result; @@ -498,12 +502,14 @@ sub cleanRecord { $result.=''; return $result; } - } elsif ( $response =~ m/(?:numerical|formula)/) { + } elsif ( $response =~ m/(?:numerical|formula|custom)/) { + # Respect multiple input fields, see Bug #5409 $answer = &Apache::loncommon::format_previous_attempt_value('submission', $answer); + return $answer; } - return $answer; + return &HTML::Entities::encode($answer, '"<>&'); } #-- A couple of common js functions @@ -811,7 +817,7 @@ sub verifyreceipt { '