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

mod_scorm reports maxes out on 65536 students in a course

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • 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.

      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

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

            peterburnett Peter Burnett
            brendanheywood Brendan Heywood
            Dan Marsden Dan Marsden
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Janelle Barcega Janelle Barcega
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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