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

Completion: When ratings off, disable grade completion

    Details

    • Testing Instructions:
      Hide

      0. Enable completion system at system and course level.
      1. Create a new Database
      2. Expand 'Activity completion' and select 'Show complete when conditions met'.
      3. Try to tick the 'Require grade' checkbox
      EXPECTED: Checkbox is disabled.
      4. Expand 'Ratings' and change 'Aggregate type' to something other than 'No ratings'.
      5. Try to tick the checkbox again.
      EXPECTED: Checkbox is enabled and can be ticked.

      (The following steps verify existing behaviour.)
      6. Create a new Quiz (quiz does not use ratings).
      7. Expand 'Activity completion' and select 'Show complete when conditions met'
      8. Try to tick the 'Require grade' checkbox.
      EXPECTED: Checkbox is enabled and can be ticked.
      9. Create a new Page (page cannot be graded at all).
      10. Expand 'Activity completion'.
      EXPECTED: There should be no 'Require grade' checkbox.

      Show
      0. Enable completion system at system and course level. 1. Create a new Database 2. Expand 'Activity completion' and select 'Show complete when conditions met'. 3. Try to tick the 'Require grade' checkbox EXPECTED: Checkbox is disabled. 4. Expand 'Ratings' and change 'Aggregate type' to something other than 'No ratings'. 5. Try to tick the checkbox again. EXPECTED: Checkbox is enabled and can be ticked. (The following steps verify existing behaviour.) 6. Create a new Quiz (quiz does not use ratings). 7. Expand 'Activity completion' and select 'Show complete when conditions met' 8. Try to tick the 'Require grade' checkbox. EXPECTED: Checkbox is enabled and can be ticked. 9. Create a new Page (page cannot be graded at all). 10. Expand 'Activity completion'. EXPECTED: There should be no 'Require grade' checkbox.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_23_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-27459-master

      Description

      Editing an already created Database activity gets the following error message:

      /////////////////////////////////////////////

      Debug info: Cannot find grade item for 'data'
      cm '18209' matching number '0'
      Stack trace:

      • line 1317 of /lib/completionlib.php: moodle_exception thrown
      • line 568 of /lib/completionlib.php: call to completion_info->internal_systemerror()
      • line 492 of /lib/completionlib.php: call to completion_info->internal_get_state()
      • line 789 of /lib/completionlib.php: call to completion_info->update_state()
      • line 342 of /course/modedit.php: call to completion_info->reset_all_state()

      /////////////////////////////////////////////

      To reproduce this error:
      1. create an ungraded Database activity
      2. save - no error appears at this point
      3. Access the Database activity and click on Edit Settings link
      4. Make changes, but make sure "Aggregate type" is set to "No ratings"
      5. Click on the [Save and display] button
      6. The above error message appears (this is with Debug messages set to "Developer"

      Workaround at this point is to click on the name of the Database activity in the breadcrumbs (not on the Continue button). Interestingly changes made while editing the activity seem to be saved as expected.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  10 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14