MDL-27747 don't truncate essay responses in the reports. #601

This commit is contained in:
Tim Hunt
2011-06-07 17:01:11 +01:00
parent 47678d60f8
commit e84dacffeb
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -70,8 +70,8 @@ class qtype_essay_question extends question_with_responses {
if (isset($response['answer'])) {
$formatoptions = new stdClass();
$formatoptions->para = false;
return shorten_text(html_to_text(format_text(
$response['answer'], FORMAT_HTML, $formatoptions), 0, false), 200);
return html_to_text(format_text(
$response['answer'], FORMAT_HTML, $formatoptions), 0, false);
} else {
return null;
}
@@ -45,8 +45,7 @@ class qtype_essay_question_test extends UnitTestCase {
public function test_summarise_response() {
$longstring = str_repeat('0123456789', 50);
$essay = test_question_maker::make_an_essay_question();
$summary = $essay->summarise_response(array('answer' => $longstring));
$this->assertTrue(strlen($summary) < 250);
$this->assertEqual(substr($longstring, 0, 100), substr($summary, 0, 100));
$this->assertEqual($longstring,
$essay->summarise_response(array('answer' => $longstring)));
}
}