Skip to content

Commit

Permalink
Fix #68 - fix issue with mobile app usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Nov 2, 2023
1 parent 13c5fff commit 8a216fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/output/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
defined('MOODLE_INTERNAL') || die();

require_once($CFG->dirroot . '/mod/subcourse/locallib.php');
require_once($CFG->libdir . '/externallib.php');

/**
* Controls the display of the plugin in the Mobile App.
Expand Down Expand Up @@ -71,15 +72,15 @@ public static function main_view($args) {
}

if ($refcourse) {
$refcourse->fullname = external_format_string($refcourse->fullname, $context);
$refcourse->fullname = \external_format_string($refcourse->fullname, $context);
$refcourse->url = new \moodle_url('/course/view.php', ['id' => $refcourse->id]);
$progress = \core_completion\progress::get_course_progress_percentage($refcourse);
}

$currentgrade = subcourse_get_current_grade($subcourse, $USER->id);

// Pre-format some of the texts for the mobile app.
$subcourse->name = external_format_string($subcourse->name, $context);
$subcourse->name = \external_format_string($subcourse->name, $context);
[$subcourse->intro, $subcourse->introformat] = external_format_text($subcourse->intro, $subcourse->introformat, $context,
'mod_subcourse', 'intro');

Expand Down

0 comments on commit 8a216fd

Please sign in to comment.