MDL-71251 qtype_essay: Return new min/max word limit settings via WS

Those settings are required by external clients such as the Moodle App
This commit is contained in:
Juan Leyva 2021-04-09 15:30:32 +02:00
parent 18aafd0ed4
commit 46a9a2b6c4
2 changed files with 5 additions and 0 deletions

View File

@ -247,6 +247,8 @@ class qtype_essay_question extends question_with_responses {
'filetypeslist' => $this->filetypeslist,
'responsetemplate' => $this->responsetemplate,
'responsetemplateformat' => $this->responsetemplateformat,
'minwordlimit' => $this->minwordlimit,
'maxwordlimit' => $this->maxwordlimit,
];
return $settings;

View File

@ -307,6 +307,7 @@ class qtype_essay_question_test extends advanced_testcase {
$this->resetAfterTest();
$essay = test_question_maker::make_an_essay_question();
$essay->minwordlimit = 15;
$essay->start_attempt(new question_attempt_step(), 1);
$qa = test_question_maker::get_a_qa($essay);
$displayoptions = new question_display_options();
@ -322,6 +323,8 @@ class qtype_essay_question_test extends advanced_testcase {
$this->assertNull($options['filetypeslist']);
$this->assertEquals('', $options['responsetemplate']);
$this->assertEquals(FORMAT_MOODLE, $options['responsetemplateformat']);
$this->assertEquals($essay->minwordlimit, $options['minwordlimit']);
$this->assertNull($options['maxwordlimit']);
}
/**