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

mod_scorm reports maxes out on 65536 students in a course

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      This is just a regression test to make sure everything is still being read correctly.

       

      1) Create a test course and add a Plain scorm to it, from the test package uploaded here. Set the grade setting to 'Learning Objects'

      • With no students enrolled in the course, verify that Basic report, Interactions report, and Objectives report, all display the banners 'No students enrolled in this course yet.' and 'Nothing to report'.
      • Verify that the graph report shows many empty charts with no data. Verify that the chart data shows all 0s for the various groups.

      2) Create a couple of test users, test1 and test2, and login with them in different sessions, and enroll them both in the course.

      • Verify the Basic report, Interactions report and Objectives report now show the 2 test users.
      • Verify the Graph report still has many blank graphs and no data recorded.
      • Verify the Basic report has no access or start time recorded for the 2 users.
      • Verify the Interactions report and the objectives report both show no attempts, access, start time, or score, and say not attempted in all categories for both users.

      3) As the test1 user, enter the scorm in 'Normal' mode

      • Verify the Basic report now shows Attempt 1, and a start and access time, with a score of 0 for the test1 user, and hasn't changed for the test2 user.
      • Verify the Graph report now has a bar of data in the 0-10 band, and the data shows 1 data point in the 0-10 band for the top chart
      • Verify that the Interactions and Objectives reports both show a status of Not attempted for all categories, with a start and access time.

      4) Complete the scorm activity as test1 by clicking in every page to complete it, and finishing the quiz at the end (Blue is the correct answer)

      • Verify the basic graph now shows a score of 18 for test1.
      • Verify the graph report shows a data point in the 0-10 band for all charts.
      • Verify that the Interactions and objectives reports show the status as 'Completed' for each section, and the total score as 18.

      5) Autocreate groups inside the course of size 1

      • Now edit the scorm settings to operate on seperate groups
      • Verify in the basic report it shows both users by default, but if you select Group A as the visible, you see the data for only test1
      • Verify the data is the same for as above for all reports when viewing Group A

      5) Many users

      Generate a test course of 'S' Size (Admin > Development > Make test course)

      • Inside the test course, upload the scorm as a new activity.
      • Verify there are 100 users in the basic report.
      • Manually edit  the file /mod/scorm/report/basic/classes/report.php and add some lines before the "// Fetch the attempts." comment.

      + var_dump(count($params));            
      + die;
       
      // Fetch the attempts.            
      if (!$download) {                
          $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params,
      ...

       

      •  Attempt to load the basic report in the generated course scorm
      • Verify the returned count is 2
      • This confirms that 100 users are no longer being passed as params to the query.
      Show
      This is just a regression test to make sure everything is still being read correctly.   1) Create a test course and add a Plain scorm to it, from the test package uploaded here. Set the grade setting to 'Learning Objects' With no students enrolled in the course, verify that Basic report, Interactions report, and Objectives report, all display the banners 'No students enrolled in this course yet.' and 'Nothing to report'. Verify that the graph report shows many empty charts with no data. Verify that the chart data shows all 0s for the various groups. 2) Create a couple of test users, test1 and test2, and login with them in different sessions, and enroll them both in the course. Verify the Basic report, Interactions report and Objectives report now show the 2 test users. Verify the Graph report still has many blank graphs and no data recorded. Verify the Basic report has no access or start time recorded for the 2 users. Verify the Interactions report and the objectives report both show no attempts, access, start time, or score, and say not attempted in all categories for both users. 3) As the test1 user, enter the scorm in 'Normal' mode Verify the Basic report now shows Attempt 1, and a start and access time, with a score of 0 for the test1 user, and hasn't changed for the test2 user. Verify the Graph report now has a bar of data in the 0-10 band, and the data shows 1 data point in the 0-10 band for the top chart Verify that the Interactions and Objectives reports both show a status of Not attempted for all categories, with a start and access time. 4) Complete the scorm activity as test1 by clicking in every page to complete it, and finishing the quiz at the end (Blue is the correct answer) Verify the basic graph now shows a score of 18 for test1. Verify the graph report shows a data point in the 0-10 band for all charts. Verify that the Interactions and objectives reports show the status as 'Completed' for each section, and the total score as 18. 5) Autocreate groups inside the course of size 1 Now edit the scorm settings to operate on seperate groups Verify in the basic report it shows both users by default, but if you select Group A as the visible, you see the data for only test1 Verify the data is the same for as above for all reports when viewing Group A 5) Many users Generate a test course of 'S' Size (Admin > Development > Make test course) Inside the test course, upload the scorm as a new activity. Verify there are 100 users in the basic report. Manually edit  the file /mod/scorm/report/basic/classes/report.php and add some lines before the "// Fetch the attempts." comment. + var_dump(count($params)); + die;   // Fetch the attempts. if (!$download) { $attempts = $DB->get_records_sql($select.$from.$where.$sort, $params, ...    Attempt to load the basic report in the generated course scorm Verify the returned count is 2 This confirms that 100 users are no longer being passed as params to the query.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_40_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull 3.8 Branch:
    • Pull 3.9 Branch:
    • Pull Master Branch:

      Description

      Closely related to MDL-46279, but this one is more easily solvable by combining everything into a single sql call and not passing in a massive list of ids.

      /mod/scorm/report.php?id=12345&mode=basic&attemptsmode=0&group=0

      Shows message 'Error reading from database' which under the hood is the postgres max params limit

        Attachments

        1. image-2020-07-08-11-14-29-731.png
          image-2020-07-08-11-14-29-731.png
          62 kB
        2. RuntimeMinimumCalls_SCORM12.zip
          350 kB
        3. Screenshot_1.png
          Screenshot_1.png
          74 kB
        4. Screenshot_2.png
          Screenshot_2.png
          100 kB
        5. Screenshot_3.png
          Screenshot_3.png
          126 kB
        6. Screenshot_4.png
          Screenshot_4.png
          104 kB
        7. Screenshot_5.png
          Screenshot_5.png
          110 kB

          Activity

            People

            Assignee:
            peterburnett Peter Burnett
            Reporter:
            brendanheywood Brendan Heywood
            Peer reviewer:
            Dan Marsden
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jul/20

                Time Tracking

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