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

Possible to get in "recalculating grades" infinite loop

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • wip-MDL-55707-master
    • Hide
      1. Create a small test course with the generator [Site administration  ► Development  ► Make test course]. This will generate 10 assignments and 100 students.
      2. Go to the gradebook for the newly generated course.
      3. In the gradebook setup [Grade administration  ► Setup  ► Gradebook setup] create a new grade item (button at the bottom).
      4. Change the newly created grade item to a calculated grade item by clicking edit > edit calculation.
      5. Add some id numbers to the assignments.
      6. Create a simple calculation such as =[[assignment01]] + [[assignment02]].
      7. Go to the grader report, turn on editing and add over 100 grades to the students. We will be deleting an assignment that was in the calculation and it is important that when it is gone that there are still over 100 grades for students in other activities.
      8. Go to the course main page (/course/view.php).
      9. Delete one of the assignments that was part of the calculation.
      10. Click on the gradebook [Course administration ► Grades].
      11. You should now see a progress bar (if you don't see a progress bar then you do not have enough grade entries).
      12. You should also see the following error -

        Probably circular reference or broken calculation formula.

      13. Click continue. You should not be stuck on the same page with the progress bar again, but instead one of the grade reports.
      Show
      Create a small test course with the generator [Site administration  ► Development  ► Make test course] . This will generate 10 assignments and 100 students. Go to the gradebook for the newly generated course. In the gradebook setup [Grade administration  ► Setup  ► Gradebook setup] create a new grade item (button at the bottom). Change the newly created grade item to a calculated grade item by clicking edit > edit calculation. Add some id numbers to the assignments. Create a simple calculation such as =[ [assignment01] ] + [ [assignment02] ] . Go to the grader report, turn on editing and add over 100 grades to the students. We will be deleting an assignment that was in the calculation and it is important that when it is gone that there are still over 100 grades for students in other activities. Go to the course main page (/course/view.php). Delete one of the assignments that was part of the calculation. Click on the gradebook [Course administration ► Grades] . You should now see a progress bar (if you don't see a progress bar then you do not have enough grade entries). You should also see the following error - Probably circular reference or broken calculation formula. Click continue. You should not be stuck on the same page with the progress bar again, but instead one of the grade reports.
    • 3.2 Sprint 5

      There are a few things you need for this to happen:

      • You need to have more than 100 grade_grades in the course, that is to say there must be at least 100 grades are assigned in the course, this triggers the progress bar to display
      • You must have an invalid calculated item

      To get an invalid calculation, you need to go to something like the course category and Edit calculation.

      1. Add IDs for a number of your items, then do the calculation formula (=[[id1]]+[[id2]]).
      2. Save
      3. Delete one of the graded items that is included in your formula from the gradebook setup page (not from the formula itself), but remember, we still need over 100 grade_grades.
      4. Bask in your infinite loop glory.

      Without the progress bar, the calculation just fails, and the page will show (and on each page view it will attempt to recalculate, since the calculation never successfully finishes and clears needsupdate). But now if you hit the limit set which triggers the progress bar, on each page you will instead just be shown the progress bar, and can never get past it.

      The only workarounds involve manipulating the DB, or at least having direct knowledge of the id of the grade item with the bad calculation...

      See forums: https://moodle.org/mod/forum/discuss.php?d=336933

            abgreeve Adrian Greeve
            emerrill Eric Merrill
            Eric Merrill Eric Merrill
            David Monllaó David Monllaó
            Frédéric Massart Frédéric Massart
            Votes:
            3 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.