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:
Juan Leyva
2017-04-20 09:58:46 +02:00
parent 0fc1f24b12
commit a33c0e30eb
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -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,
),
);
}
+1 -1
View File
@@ -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']));
}