MDL-58415 mod_lesson: Return always allowofflineattempts
We need this field always to be able to display if the lesson is available or not for download
This commit is contained in:
@@ -65,7 +65,7 @@ class mod_lesson_external extends external_api {
|
||||
'maxanswers', 'maxattempts', 'review', 'nextpagedefault', 'feedback', 'minquestions',
|
||||
'maxpages', 'timelimit', 'retake', 'mediafile', 'mediaheight', 'mediawidth',
|
||||
'mediaclose', 'slideshow', 'width', 'height', 'bgcolor', 'displayleft', 'displayleftif',
|
||||
'progressbar', 'allowofflineattempts');
|
||||
'progressbar');
|
||||
|
||||
foreach ($fields as $field) {
|
||||
unset($lessonrecord->{$field});
|
||||
|
||||
@@ -249,7 +249,6 @@ class lesson_summary_exporter extends exporter {
|
||||
'allowofflineattempts' => array(
|
||||
'type' => PARAM_BOOL,
|
||||
'description' => 'Whether to allow the lesson to be attempted offline in the mobile app',
|
||||
'optional' => true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1304,7 +1304,7 @@ class mod_lesson_external_testcase extends externallib_advanced_testcase {
|
||||
// Lesson not using password.
|
||||
$result = mod_lesson_external::get_lesson($this->lesson->id);
|
||||
$result = external_api::clean_returnvalue(mod_lesson_external::get_lesson_returns(), $result);
|
||||
$this->assertCount(5, $result['lesson']); // Expect just this few fields.
|
||||
$this->assertCount(6, $result['lesson']); // Expect just this few fields.
|
||||
$this->assertFalse(isset($result['intro']));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user