1. 09 Mar, 2021 6 commits
    • jun's avatar
    • jun's avatar
      MDL-70815 core_completion: Update completion_info · 32721b35
      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
      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's avatar
      MDL-70815 core_completion: completion_info::get_grade_completion() · 18ef213d
      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's avatar
      MDL-70815 core_completion: Fix unit tests · 23603315
      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's avatar
      MDL-70815 core_completion: Unit tests for activity_custom_completion · 14234bf2
      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's avatar
      MDL-70815 core_completion: Activity custom completion details base class · beb0dd74
      jun authored
      * Base class for defining an activity module's custom completion details
  2. 05 Mar, 2021 3 commits
  3. 04 Mar, 2021 7 commits
  4. 03 Mar, 2021 24 commits