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

Quiz overview report runs out of memory with huge courses

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Pull 3.10 Branch:
      MDL-71838_310
    • Pull 3.11 Branch:
      MDL-71838_311
    • Pull Master Branch:
    • Testing Instructions:
      Hide

      Set up

      1. Use Administration > Development > Make test course to create an XL or XXL course. (You can use an existing one if you have one. The key thing is the number of enrolled users. Other aspects of bigness don't matter.)
      2. Ensure that Administration > Development > Debugging > Performance info is turned on.
      3. Create a groups in the test course, containing the test student you will use to attempt the quiz.
      4. In the large course, create a new quiz, with group mode set to Separate groups.
      5. Add one true-false question.
      6. Log in as a student, and make one attempt at the quiz.

      Testing

      1. Log in as teacher, go to the quiz.
      2. Make a note of 'RAM peak' from the performance info in the footer. You will need to compare something to this in a minute.
      3. Go to Quiz settings -> Results -> Grades.
      4. Verify the page load completely (there should be a graph at the bottom)
      5. Verify that in the performance info in the footer, 'RAM peak' is similar to what you got on the front page of the quiz. (If you got 20MB before, up to about 25MB would probably be OK here. 100MB would not!)
      6. Verify that the table has a row for Overall average.
      7. Switch the group selector to the group the student is in.
      8. Verify that the table has two average rows: 'Group average' and 'Overall average'.
      Show
      Set up Use Administration > Development > Make test course to create an XL or XXL course. (You can use an existing one if you have one. The key thing is the number of enrolled users. Other aspects of bigness don't matter.) Ensure that Administration > Development > Debugging > Performance info is turned on. Create a groups in the test course, containing the test student you will use to attempt the quiz. In the large course, create a new quiz, with group mode set to Separate groups. Add one true-false question. Log in as a student, and make one attempt at the quiz. Testing Log in as teacher, go to the quiz. Make a note of 'RAM peak' from the performance info in the footer. You will need to compare something to this in a minute. Go to Quiz settings -> Results -> Grades. Verify the page load completely (there should be a graph at the bottom) Verify that in the performance info in the footer, 'RAM peak' is similar to what you got on the front page of the quiz. (If you got 20MB before, up to about 25MB would probably be OK here. 100MB would not!) Verify that the table has a row for Overall average. Switch the group selector to the group the student is in. Verify that the table has two average rows: 'Group average' and 'Overall average'.

      Description

      Suppose you have a course with 243801 participants. Then trying to diplay the Grades report for a quiz (.../mod/quiz/report.php?id=1234&mode=overview) dies with an out-of-memory error.

      The problem is that at one point, where it really intends to do a record_exists_sql to see if there are any users, it acutally does a get_records_sql, which tries to load all the user ids into memory, and dies.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Brendan Heywood Brendan Heywood
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Jul/21

                  Time Tracking

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