MDL-27747 don't truncate essay responses in the reports. #601
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user