1 This file describes API changes in /completion/* - completion,
2 information provided here is intended especially for developers.
5 * A new method, cm_completion_details::is_overall_complete() has been added to calculate whether a module should be considered or
6 not completed, based on their completion options and the current value for the overall complete state.
7 * The following previously deprecated methods have been removed and can no longer be used:
8 - `core_course_bulk_activity_completion_renderer::navigation`
9 - `core_completion\manager::get_available_completion_tabs`
10 * The following previously deprecated methods have been removed and can no longer be used:
11 - `completion_info::display_help_icon`
12 - `completion_info::print_help_icon`
13 * The \core_completion\completion_info_exporter class has been updated to return a new field "isverallcomplete" to return the result of the
14 new cm_completion_details::is_overall_complete() method.
17 * A trait class, core_completion/form/form_trait has been added to reuse code for adding and validation completion settings to any
19 * New method is_manual() has been added to `core_completion/cm_completion_details`
20 * The method manager::get_activities_and_resources() now has the optional $includedefaults parameter to define whether the default
21 values should be included or not.
22 * The methods manager::apply_default_completion() and manager::get_default_completion() now have the optional $suffix parameter
23 to be added to the name of the completion rules.
24 * The method manager::defaultcompletion() now has the $modules and $form parameters, to specify the modules that have been set
25 through the form and the current form that has been sent.
26 * Support for deprecated `[modname]_get_completion_state` callbacks has been removed, custom completion rules must be implemented
27 by appropriate `mod_[modname]\completion\custom_completion` class instead
28 * $CFG->completiondefault setting has been removed.
31 * New method mark_course_completions_activity_criteria() has been added to mark course completions instantly. It is
32 based on cron for completion_criteria_activity.php which is refactored to use it as well.
33 * Core now passes an additional parameter to '_get_completion_state'. This is an array representation of the completion results that have already been
34 tested. Currently contains - viewed, usegrade, passgrade. Any plugin that are dependent on these criteria can now check this array instead of retesting it.
35 * The method \completion_criteria_completion::mark_complete() now has the optional $timecompleted parameter to specify when the
36 criteria was completed.
37 * New method get_available_completion_options() has been added in the core_completion\manager class. This method can be used
38 to obtain an array with the available completion options ([url => name]) for the current course and user.
39 * The method get_available_completion_tabs() in the core_completion\manager class has been deprecated because the tabs navigation
40 structure is no longer used in the completion pages. Please use core_completion\manager::get_available_completion_options()
44 * New Behat steps for activity completion in the behat_completion class:
45 - activity_completion_condition_displayed_as()
46 - Given the "<Completion condition>" completion condition of "<Activity name>" is displayed as "<Status>"
47 - activity_should_have_the_completion_condition()
48 - Given "<Activity name>" should have the "<Condition name>" completion condition
49 - manual_completion_button_displayed_as()
50 - Given the manual completion button of "<Activity name>" is displayed as "<Status>"
51 - the_manual_completion_button_for_activity_should_be_disabled()
52 - Given the manual completion button for "<Activity name>" should be disabled
53 - there_should_be_no_completion_for_activity()
54 - Given there should be no completion information shown for "<Activity name>"
55 - toggle_the_manual_completion_state()
56 - Given I toggle the manual completion state of "<Activity name>"
57 - overridden_manual_completion_button_displayed_as
58 - Given the manual completion button of "<Activity name>" overridden by "<User>" is displayed as "<Status>"
59 - overridden_activity_completion_condition_displayed_as
60 - Given the "<Completion condition>" completion condition of "<Activity name>" overridden by "<User>" is displayed as "<Status>"
61 * *_get_completion_state() callback functions have been deprecated and should no longer be used. Plugins that define custom
62 completion rules must implement the mod_[modname]\completion\custom_completion class that extends the
63 \core_completion\activity_custom_completion base class.
66 * External function core_completion_external::get_activities_completion_status new returns the following additional field:
67 - valueused (indicates whether the completion state affects the availability of other content)
68 * On the course page, only users with the capability 'moodle/course:isincompletionreports' (students, by default) can now tick the
69 completion checkboxes. Teachers no longer get working checkboxes; tey see slightly different icons that indicate whether
70 completion is enabled for the activity. These are the same icons which have always been shown to teachers before when the
71 enabled the course editing mode.
75 * A completed and failed activity counts as a completed activity for