- 11 Mar, 2021 4 commits
-
-
-
-
-
Since cm_info::customdata can be of any type, we need to cast it to an array first before checking for custom completion rules. Otherwise, an exception can be thrown (e.g. customdata has been set as an stdClass)
-
- 10 Mar, 2021 9 commits
-
-
-
sam marshall authored
-
sam marshall authored
-
sam marshall authored
-
sam marshall authored
In all cases changes have been kept to a minimum while not making the code completely horrible. For example, there are many instances where it would probably be better to rewrite a query entirely, but I have not done that (in order to reduce the risk of changes).
-
git://github.com/sarjona/moodlejun authored
-
Sara Arjona authored
The $CFG->badges_site_backpack setting has been completely removed because it's not required anymore. From now, the primary site backpack will be the first one in the "Manage backpacks" list (so, the one with lower sortorder value).
-
Sara Arjona authored
Before removing $CFG->badges_site_backpack setting, admins should be able to re-order the existing site-backpacks (because then, the first one will be treated as the default one). This patch adds the sort order feature to the backpack list.
-
-
- 09 Mar, 2021 11 commits
-
-
-
-
-
jun authored
Use the custom completion implementation for mod_choice to test completion_info::get_state() to cover the case where the completion state is being determined from the custom completion condition.
-
jun authored
-
jun authored
-
jun authored
* 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.
-
jun authored
Move the current logic for determining the completion status for the "Student must receive grade" completion rule to a function so it cann be reused. Unit test included.
-
jun authored
* Unit tests for completion_info::get_data() and completion_info::internal_get_state are mocked which causes failures with the new implementation. It's more straightforward and realistic to generate real course and modules to test these methods.
-
jun authored
Tests cover - get_overall_completion_state() - is_available() - validate_rule() Tests don't cover - methods that rely on static methods such as: - is_defined() - static methods in the class because they can't be mocked - abstract methods that can be tested better by the plugins that extend activity_custom_completion such as: - get_state() - get_defined_custom_rules() - get_custom_rule_descriptions()
-
jun authored
* Base class for defining an activity module's custom completion details
-
- 08 Mar, 2021 7 commits
-
-
-
sam marshall authored
-
sam marshall authored
-
sam marshall authored
-
sam marshall authored
-
sam marshall authored
Currently admin_setting_configselect has lazy-loading support via a callback function (so you don't have to make pointless single-use classes for each unusual setting), but this is not present in other similar types. This commit adds identical support to admin_setting_configmulticheckbox.
-
Sara Arjona authored
Setting "External backpack connection" has been moved from "Backpack settings" to "Badges settings" in order to make easier to find and configure it. Some extra tests have been added to cover existing behaviour and confirm is still working as expected.
-
- 05 Mar, 2021 3 commits
-
-
Sara Arjona authored
-
-
-
- 04 Mar, 2021 6 commits