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

Better handling of broken (needsupdate = 1) gradebook

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5.2, 3.6, 3.7, 3.11.11
    • None
    • Gradebook
    • MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE

    Description

      This is a followup of MDL-64609, where it was detected that is extremely easy to end with a broken gradebook.

      Reproduction steps:

      1. Go into a course (can be new) with at least one student
      2. Create any grade-able activity, give to it the "g1" idnumber (common activity settings).
      2. Go to Gradebook setup
      3. Add a category
      6. Edit the category calculation and set it to =[[g1]]
      7. Delete the activity from the course (and run adhoc tasks if needed to complete the deletion)
      8. Once deleted completely, try visiting the overview report, the user report... all them end showing an exception about gradesneedregrading. For example:

      Debug info: 
      Error code: gradesneedregrading
      $a contents:
      ×Stack trace:
      line 717 of /grade/export/lib.php: moodle_exception thrown
      line 138 of /grade/lib.php: call to export_verify_grades()
      line 432 of /grade/lib.php: call to graded_users_iterator->init()
      line 39 of /grade/report/overview/renderer.php: call to grade_get_graded_users_select()
      line 132 of /grade/report/overview/index.php: call to gradereport_overview_renderer->graded_users_selector()
      

      So, it's extremely easy to break the gradebook with something as simple as removing an activity or grade item that is being used in calculations. And later it's extremely hard to find which formula is the one causing the mess.

      This issue is about:

      A) If possible, avoid removing activities or grade items that are being used. Consistency.

      B) When any grade item needs update (or its formula is wrong), show it visually, so the teacher knows which one is the problematic item. Visibility.

      C) If possible, allow all those reports to work ok, no matter there are items needing update. Apply B) to those reports too.

      D) Maybe, coming from MDL-74449, build some consistency checker (and fixer) so we can see which the status of big and old gradebooks is. I think we'll fins a lot of orphaned stuff in many of them.

      Ciao

      PS: Only confirmed in 3.7dev, but I can imagine it's the same in stables, so adding them to the affected versions.

      Attachments

        1. bulk_delete_001.png
          bulk_delete_001.png
          227 kB
        2. bulk_delete_002.png
          bulk_delete_002.png
          135 kB
        3. gradebook_error_001.png
          gradebook_error_001.png
          212 kB
        4. single_delete_001.png
          single_delete_001.png
          219 kB
        5. single_delete_002.png
          single_delete_002.png
          124 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              11 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated: