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

Assignment blind marking performance issues

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Run automated tests
      2. Enable blind marking on an assignment
      3. As a student, submit some files
      4. As a teacher, review the list of submissions
        1. Confirm that the submission list includes a hidden participant number
      5. Note the number of DB queries on the page
      6. Revert the patch
      7. Refresh the page
        1. The number of DB queries with the patch applied should be lower. Usually by about 4 x number of participants on the page
      8. Re-apply the patch
      9. As a teacher create a non-blind marked assignment
      10. As 2-3 students submit to both the blind and non-blind assigments
      11. As teacher view the course page
        1. Confirm that the correct info is shown in the Recent activity block for each assignment
      12. As a teacher grade each of the submissions, ensuring that the "Notify students" checkbox is unticked
      13. Run cron
        1. Confirm no errors
        2. Confirm that each submitted assignment received an e-mail
      Show
      Run automated tests Enable blind marking on an assignment As a student, submit some files As a teacher, review the list of submissions Confirm that the submission list includes a hidden participant number Note the number of DB queries on the page Revert the patch Refresh the page The number of DB queries with the patch applied should be lower. Usually by about 4 x number of participants on the page Re-apply the patch As a teacher create a non-blind marked assignment As 2-3 students submit to both the blind and non-blind assigments As teacher view the course page Confirm that the correct info is shown in the Recent activity block for each assignment As a teacher grade each of the submissions, ensuring that the "Notify students" checkbox is unticked Run cron Confirm no errors Confirm that each submitted assignment received an e-mail
    • Affected Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-54873-master

      Description

      With blind marking enabled, fetching participant mappings requires one DB call per user.

      1. mod/assign/gradingtable.php::col_recordid calls
      2. mod/assign/locallib.php::get_uniqueid_for_user, which in turn calls
      3. # mod/assign/locallib.php::get_uniqueid_for_user_static, which makes at least one, and potentially more calls to get_record.

      We should make an attempt to either:

      1. join the assign_user_mapping table when formulating the SQL query in the constructor; or
      2. fetch all mappings in get_uniquid_for_user() or somewhere in that chain.

      My preference is for joining the user mapping table in the table constructor, as this also helps to resolve MDL-54872 as the recordid becomes available as a sorting value.

      By doing this we can reduce the number of DB reads by the number of users displayed on the page.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Sep/16