The existing course format plugins are not adapted tu use the new
courseformat subsystem. This means they don't provide a valid renderer,
or hardcode the inclusion of the topics renderer.php file, or do not
extend the format renderer but the core one (missing some methods). This
commit provides some quick fixes to prevent exceptions.
The course index is the first UI component that implements the new
drawers and the reactive components. The course index uses the course
state to present the current course structure and changes whenever
that structure change.
The module now exports a getCourseEditor and a getCurrentCourseEditor
methods. The module is more consistent as it can be used to get
other course than the current one.
The new course editor for Moodle 4.0 is the first AMD
module that will use the new reactive library. This
commit creates creates the initial structure of the
new course editor frontend.
* When completion tracking is not enabled for the course, it does not
make sense for the course's showcompletionconditions setting to
be set according to the default value indicated by the
"moodlecourse | showcompletionconditions" admin setting. Setting
showcompletionconditions as enabled when completion tracking is disabled
makes even less sense. So in such a case, we should not be setting a
default value for showcompletionconditions and allow it to be null.
* When the course is edited and completion tracking is enabled, this
also would set the "Show completion conditions" field to default to the
value set in the "moodlecourse | showcompletionconditions" admin
setting.
Padding nested course categories by space to make them render in a tree
structure does not really make a lot of sense as they are already being
rendered as full paths. It's simpler to show them without the
indentation.
Given this, there's not much point keeping make_categories_options().
So it's better to deprecate this function and call
core_course_category::make_categories_list() directly instead.
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.
All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
The patch adds two new optional parameters that control the function
behaviour. With default values, the function is backwards compatible and
it simply uses the number of enrolment records. The new parameters allow
to include only active enrolments and/or only recently active users.
Committer's note: This change was originally part of a bigger patchset
submitted by the author. This is a stripped-down version that does not
use phpunit tests for the new behaviour.