MDL-70815 core_completion: Update completion_info
commit32721b351129a533ad447dfc3ad9515da5cc0834
authorJun Pataleta <jun@moodle.com>
Wed, 10 Feb 2021 03:05:42 +0000 (10 11:05 +0800)
committerJun Pataleta <jun@moodle.com>
Tue, 9 Mar 2021 12:15:28 +0000 (9 20:15 +0800)
tree3711661577a00734b505c07e70e940e00bd521a6
parent18ef213da5a937bedceda45f0888be46b0e52127
MDL-70815 core_completion: Update completion_info

* Update completion_info::get_data() to add other completion
information from a new method called get_other_cm_completion_data().
This allows the storage of the completion statuses of the following
completion rules to completion_info objects:
  - 'Students must receive a grade' completion rule.
  - Any custom completion rule defined by an activity.
This allows detailed completion information to be fetched for course
modules.
It also allows custom completion statuses to be cached which will help
reduce DB queries when fetching completion statuses.
* Update update_state() to fetch overall completion state from the
module's activity_custom_completion implementation. Falls back to the
*_get_completion_state() callback function.
* Update internal_set_data() to include the other cm completion data
in the updated cache data for the module instance.
lib/completionlib.php