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

Show regrade error message in the quiz view page

    XMLWordPrintable

Details

    • Improvement
    • Status: Peer review in progress
    • Minor
    • Resolution: Unresolved
    • 4.0
    • None
    • Gradebook
    • MOODLE_400_STABLE
    • MDL-72451_master
    • Hide

      Test to see the error in quiz activity page

      1. Create a S size of course with the generator [Site administration ► Development ► Make test course]. This will generate 10 assignments and 100 students.
      2. Go to the newly generated course.
      3. Create a quiz activity.
      4. Go to the gradebook.
      5. Create a new grade item (from "Add grade item" button at the bottom) named 'Test calculation item'.
      6. Edit calculation for the newly created grade item by clicking "Edit" > "Edit calculation".
      7. Add some id numbers to the assignments and quiz, like "assignment01" or "quiz01"
      8. Create a simple calculation such as "=[[assignment01]] + [[assignment02]] + [[quiz01]]".
      9. Delete one of the assignments that was part of the calculation.
      10. Complete deletion by cron if it's in progress.
      11. Go to quiz activity page.
      12. Confirm 'Probably circular reference or broken calculation formula (Item name: Test calculation item)'
      13. Reload the same page.
      14. Confirm there is no error shown in the page.
      Show
      Test to see the error in quiz activity page Create a S size of course with the generator [Site administration ► Development ► Make test course] . This will generate 10 assignments and 100 students. Go to the newly generated course. Create a quiz activity. Go to the gradebook. Create a new grade item (from "Add grade item" button at the bottom) named 'Test calculation item'. Edit calculation for the newly created grade item by clicking "Edit" > "Edit calculation". Add some id numbers to the assignments and quiz, like "assignment01" or "quiz01" Create a simple calculation such as "=[ [assignment01] ] + [ [assignment02] ] + [ [quiz01] ]". Delete one of the assignments that was part of the calculation. Complete deletion by cron if it's in progress. Go to quiz activity page. Confirm 'Probably circular reference or broken calculation formula (Item name: Test calculation item)' Reload the same page. Confirm there is no error shown in the page.

    Description

      We had a big performance issue in a quiz activity view page.
      After some investigation, we found there was an issue in the grade calculation formula and the regrading process kept calculating each access.
      In our case, the each calculation took more than 10 sec and many students accessed at once, so the site was overloaded.

      When calculating regrade ("grade_regrade_final_grades" function) in the grades page and the gradeing has some errors, the system show the errors in the page and set 'needsupdate = 0' to avoid further error.
      https://github.com/moodle/moodle/blob/206023c15f680b2b3b2aab4d36515337491e0edf/lib/gradelib.php#L393-L403

      But in the quiz activity view page, the system doesn't set 'needsupdate = 0' and keep calculating regrade.
      https://github.com/moodle/moodle/blob/206023c15f680b2b3b2aab4d36515337491e0edf/lib/gradelib.php#L448-L451

      We can't see any errors in the quiz activity view page, so we don't know what's going on.
      The calculation can't fix automatically, so it's better to show something error when the issue is happening.

      Attachments

        Issue Links

          Activity

            People

              tomotsuyuki Tomo Tsuyuki
              tomotsuyuki Tomo Tsuyuki
              Dmitrii Metelkin Dmitrii Metelkin
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: