upgrade.txt 3.89 KB
Newer Older
1
2
3
This files describes API changes in /completion/* - completion,
information provided here is intended especially for developers.

4
5
6
=== 4.0 ===
* New method mark_course_completions_activity_criteria() has been added to mark course completions instantly. It is
  based on cron for completion_criteria_activity.php which is refactored to use it as well.
7
8
9
10
11
12
13
14
15
* Modified completion criteria to allow plugins to override core completion logic.
* Core now passes an additional parameter to '_get_completion_state'. This is an array representation of the completion results that have already been
  tested. Currently contains - viewed, usegrade, passgrade. Any plugin that are dependent on these criteria can now check this array instead of retesting it.
* Introduced a new plugin function - '_get_completion_aggregation_state', that would indicate the aggregation type/relationship between the plugin and core
  completion criteria. This callback should either return a COMPLETION_STANDARD_FLOW / COMPLETION_CUSTOM_MODULE_FLOW. The former for default existing core
  behaviour while the latter enforces the override logic from the plugin. Defaults to COMPLETION_STANDARD_FLOW if not defined. This is useful when plugins
  need to override the core completion criteria in cases where it may be dependent on them. In these cases, the 'source of truth' would be the response
  from the plugin's 'get_completion_state' function. e.g. Quiz's completion defines a criteria of 'requires passing grade OR all attempts AND min attempts
  reached.' In these cases, even if a passing grade has not been achieved, the activity should be marked as completed if the no.of attempts have been reached.
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
=== 3.11 ===
* New Behat steps for activity completion in the behat_completion class:
  - activity_completion_condition_displayed_as()
    - Given the "<Completion condition>" completion condition of "<Activity name>" is displayed as "<Status>"
  - activity_should_have_the_completion_condition()
    - Given "<Activity name>" should have the "<Condition name>" completion condition
  - manual_completion_button_displayed_as()
    - Given the manual completion button of "<Activity name>" is displayed as "<Status>"
  - the_manual_completion_button_for_activity_should_be_disabled()
    - Given the manual completion button for "<Activity name>" should be disabled
  - there_should_be_no_completion_for_activity()
    - Given there should be no completion information shown for "<Activity name>"
  - toggle_the_manual_completion_state()
    - Given I toggle the manual completion state of "<Activity name>"
  - overridden_manual_completion_button_displayed_as
    - Given the manual completion button of "<Activity name>" overridden by "<User>" is displayed as "<Status>"
  - overridden_activity_completion_condition_displayed_as
    - Given the "<Completion condition>" completion condition of "<Activity name>" overridden by "<User>" is displayed as "<Status>"
35
36
37
* *_get_completion_state() callback functions have been deprecated and should no longer be used. Plugins that define custom
  completion rules must implement the mod_[modname]\completion\custom_completion class that extends the
  \core_completion\activity_custom_completion base class.
38

39
40
41
=== 3.7 ===
 * External function core_completion_external::get_activities_completion_status new returns the following additional field:
   - valueused (indicates whether the completion state affects the availability of other content)
42
43
44
45
 * On the course page, only users with the capability 'moodle/course:isincompletionreports' (students, by default) can now tick the
   completion checkboxes. Teachers no longer get working checkboxes; tey see slightly different icons that indicate whether
   completion is enabled for the activity. These are the same icons which have always been shown to teachers before when the
   enabled the course editing mode.
46

47
48
49
50
=== 2.9 ===

* A completed and failed activity counts as a completed activity for
  course completion.