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

Convert the "Prepare submissions for annotation" scheduled task into adhoc tasks

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_401_STABLE
    • master-MDL-71468-v4
    • Hide

      1. Set up the site (before patch is applied):

      1. Install gs:
        apt-get update && apt-get install ghostscript
      2. Create a course.
      3. Create 3 students: Student One, Student Two and Student Three.
      4. Enrol students to the course with Student role.
      5. Crate Assignment activity with Submission types set to File submissions and Annotate PDF enabled in Feedback types.
      6. Log in as Student One and submit a submission with an image.
      7. Connect to the database.
      8. Confirm, that submission conversion is queued:
        SELECT * FROM mdl_assignfeedback_editpdf_queue;

      2. Generate ad-hoc tasks for not yet converted queue items:

      1. Apply the patch.
      2. Run upgrade script:
        php admin/cli/upgrade.php
      3. Log in as an admin.
      4. Access Scheduled tasks admin page.
      5. Confirm, that assignfeedback_editpdf\task\convert_submissions doesn't exist anymore.
      6. Connect to the database.
      7. Confirm, that mdl_assignfeedback_editpdf_queue table doesn't exist anymore.
      8. Confirm, that ad-hoc task was created for Student One submission:
        SELECT * FROM mdl_task_adhoc;
      9. Run ad-hoc tasks:
        php admin/cli/adhoc_task.php --execute
      10. Confirm, that \assignfeedback_editpdf\task\convert_submission has been completed successfully.
      11. Access grading page for Student One.
      12. Confirm, that student submission is displayed.

      3. Convert new submissions in cron:

      1. Log in as Student Two and submit a submission with an image.
      2. Confirm, that ad-hoc task was created:
        SELECT * FROM mdl_task_adhoc;
      3. Run ad-hoc tasks:
        php admin/cli/adhoc_task.php --execute
      4. Log in as Teacher.
      5. Access grading page for Student Two.
      6. Confirm, that student submission is displayed.

      4. Convert new submissions in teacher session:

      1. Log in as Student Three and submit a submission with an image.
      2. Confirm, that ad-hoc task was created:
        SELECT * FROM mdl_task_adhoc;
      3. Log in as Teacher.
      4. Access grading page for Student Three.
      5. Confirm, that student submission is displayed.
      6. Run ad-hoc tasks:
        php admin/cli/adhoc_task.php --execute
      7. Confirm, that \assignfeedback_editpdf\task\convert_submission has been completed successfully.
      Show
      1. Set up the site (before patch is applied): Install gs: apt-get update && apt-get install ghostscript Create a course. Create 3 students: Student One , Student Two and Student Three . Enrol students to the course with Student role. Crate Assignment activity with Submission types set to File submissions and Annotate PDF enabled in Feedback types . Log in as Student One and submit a submission with an image. Connect to the database. Confirm , that submission conversion is queued: SELECT * FROM mdl_assignfeedback_editpdf_queue; 2. Generate ad-hoc tasks for not yet converted queue items: Apply the patch. Run upgrade script: php admin/cli/upgrade.php Log in as an admin. Access Scheduled tasks admin page. Confirm , that assignfeedback_editpdf\task\convert_submissions doesn't exist anymore. Connect to the database. Confirm , that mdl_assignfeedback_editpdf_queue table doesn't exist anymore. Confirm , that ad-hoc task was created for Student One submission: SELECT * FROM mdl_task_adhoc; Run ad-hoc tasks: php admin/cli/adhoc_task.php --execute Confirm , that \assignfeedback_editpdf\task\convert_submission has been completed successfully. Access grading page for Student One. Confirm , that student submission is displayed. 3. Convert new submissions in cron: Log in as Student Two and submit a submission with an image. Confirm , that ad-hoc task was created: SELECT * FROM mdl_task_adhoc; Run ad-hoc tasks: php admin/cli/adhoc_task.php --execute Log in as Teacher. Access grading page for Student Two. Confirm , that student submission is displayed. 4. Convert new submissions in teacher session: Log in as Student Three and submit a submission with an image. Confirm , that ad-hoc task was created: SELECT * FROM mdl_task_adhoc; Log in as Teacher. Access grading page for Student Three. Confirm , that student submission is displayed. Run ad-hoc tasks: php admin/cli/adhoc_task.php --execute Confirm , that \assignfeedback_editpdf\task\convert_submission has been completed successfully.

      Having a big number of assignments the "\assignfeedback_editpdf\task\convert_submissions" task starts lagging.

      It also has no limit of records to process so it tries to process the qhole queue in one go, works for enormous amount of time and eventually dies (this has been fixed in MDL-73846).

      As we can't run more than one instance of the scheduled task at the same time and there is no way to speed it up, it seems to be a good idea to convert submissions using adhoc tasks.

      As part of this enhancement all existing and not processed records in `mdl_assignfeedback_editpdf_queue` will need to be converted into adhoc tasks. Then the table can be deleted.

        1. MDL-71468_adhoc_1.png
          MDL-71468_adhoc_1.png
          191 kB
        2. MDL-71468_adhoc_2.png
          MDL-71468_adhoc_2.png
          53 kB
        3. MDL-71468_adhoc_3.png
          MDL-71468_adhoc_3.png
          90 kB
        4. MDL-71468_adhoc_4.png
          MDL-71468_adhoc_4.png
          65 kB
        5. MDL-71468_adhoc_5.png
          MDL-71468_adhoc_5.png
          83 kB
        6. MDL-71468_before patch.png
          MDL-71468_before patch.png
          32 kB
        7. MDL-71468_cron_1.png
          MDL-71468_cron_1.png
          76 kB
        8. MDL-71468_cron_2.png
          MDL-71468_cron_2.png
          84 kB
        9. MDL-71468_teacher session_1.png
          MDL-71468_teacher session_1.png
          72 kB
        10. MDL-71468_teacher session_2.png
          MDL-71468_teacher session_2.png
          86 kB
        11. MDL-71468_teacher session_3.png
          MDL-71468_teacher session_3.png
          44 kB

            mikhailgolenkov Misha Golenkov
            mikhailgolenkov Misha Golenkov
            Brendan Heywood Brendan Heywood
            Shamim Rezaie Shamim Rezaie
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            3 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 2 hours, 50 minutes
                1d 2h 50m

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