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

Quiz overview report runs out of memory with huge courses

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-71838_311
    • 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

              timhunt Tim Hunt
              timhunt Tim Hunt
              Brendan Heywood Brendan Heywood
              Andrew Lyons Andrew Lyons
              Gladys Basiana Gladys Basiana
              Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Lyons, 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:
                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