Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67413

Do nothing upon activity completion should not throw an error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.7, 3.7.3, 3.8, 3.9.1
    • Fix Version/s: 3.8.5, 3.9.2
    • Component/s: Competencies
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a competency framework
        1. Go to Site administration > Competencies > Competency frameworks
        2. Click "Add new competency framework"
        3. Name the framework "framework 1"
        4. Enter in an ID number (001)
        5. Click "Configure scales" and click "Default" for "not yet compliant" and "proficient" for "Competent".
        6. Save changes.
      2. Create a competency
        1. In the framework, click on "framework 1"
        2. In the select competency box a button to add a competency should appear. Click that button.
        3. Name : "Competency 1"
        4. ID: 001
        5. Save changes.
      3. Go to a course.
      4. In the navigation click on "Competencies"
      5. Click "Add competencies to course"
      6. Select Competency 1 from the tree.
      7. Go back to the course screen.
      8. Create a page element.
      9. Give it a name and some content.
      10. in "Activity completion" set completion tracking to "Show activity as complete when conditions are met"
      11. Make sure that "Require view" is checked.
      12. In "Competencies" - "Course competencies" select "Competency 1"
      13. Make sure that "Upon activity completion" is set to "Do nothing".
      14. Click "Save and display"
      15. Check that there is no warning on this page.
      Show
      Create a competency framework Go to Site administration > Competencies > Competency frameworks Click "Add new competency framework" Name the framework "framework 1" Enter in an ID number (001) Click "Configure scales" and click "Default" for "not yet compliant" and "proficient" for "Competent". Save changes. Create a competency In the framework, click on "framework 1" In the select competency box a button to add a competency should appear. Click that button. Name : "Competency 1" ID: 001 Save changes. Go to a course. In the navigation click on "Competencies" Click "Add competencies to course" Select Competency 1 from the tree. Go back to the course screen. Create a page element. Give it a name and some content. in "Activity completion" set completion tracking to "Show activity as complete when conditions are met" Make sure that "Require view" is checked. In "Competencies" - "Course competencies" select "Competency 1" Make sure that "Upon activity completion" is set to "Do nothing". Click "Save and display" Check that there is no warning on this page.
    • Workaround:
      Hide

       

      function observe_course_module_completion_updated()
      ++if ($outcome == course_module_competency::OUTCOME_NONE) {
      ++   continue;
      ++ }
      
      

       

      Show
        function observe_course_module_completion_updated() ++if ($outcome == course_module_competency::OUTCOME_NONE) { ++   continue; ++ }  
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:

      Description

      The observe_course_module_completion_updated function throws an error when

      • activity completion is enabled AND
      • the option "Do nothing" upon activity completion is selected.

       

      Warning: A non-numeric value encountered in competency/classes/api.php on line 4649

      Call Stack:
      1. mod/resource/view.php:0
      2. resource_view() mod/resource/view.php:58
      3. completion_info->set_module_viewed() mod/resource/lib.php:534
      4. completion_info->update_state() lib/completionlib.php:740
      5. completion_info->internal_set_data() lib/completionlib.php:622
      6. core\event\course_module_completion_updated->trigger() lib/completionlib.php:1089
      7. core\event\manager::dispatch() lib/classes/event/base.php:834
      8. core\event\manager::process_buffers() lib/classes/event/manager.php:75
      9. lib/classes/event/manager.php:155() lib/classes/event/manager.php:155
      10. core_competency\api::observe_course_module_completion_updated() lib/classes/event/manager.php:155

       

        Attachments

          Activity

            People

            Assignee:
            rdebleu Renaat Debleu
            Reporter:
            rdebleu Renaat Debleu
            Peer reviewer:
            Mathew May
            Integrator:
            Adrian Greeve
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Sep/20

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 55 minutes
                2h 55m