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

Long running adhoc task: transfer_question_categories

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 5.0
    • Questions
    • MOODLE_500_STABLE
    • MDL-84466_main
    • Hide

      1. Install a Moodle 4.5 site. Do not have the cron running, so that we can test ad-hoc tasks manually.
      2. Create a course
      3. Add a quiz, and a question to the quiz, which includes a file in its question text, and has some tags.
      4. On the course page, go to "Question bank" and confirm the questions are in the course question bank.
      5. Repeat steps 2-4 for a second course.
      6. Apply this branch and upgrade to Moodle 5.0
      7. Go to a course and access the Question banks page.

      • Confirm a notification is shown due to the ad-hoc tasks still pending.

      8. Go to a the quiz on the course, go to the "Questions" tab, and click the pencil (edit) icon next to the question name.

      • Confirm you are still on the same page, but now the notification from step 7 is shown as well.

      9. Go to Site Administration > Server > Ad-hoc tasks

      • Confirm there is an instance of transfer_question_categories pending

      10. Click "Run all" to run the task.
      11. Click "Back to ad-hoc tasks"

      • Confirm there there are now 2 instances of transfer_questions pending (one for the question bank on each course).

      12. Repeat steps 7-8 and confirm that the notifications are still displayed.
      13. Run the remaining ad-hoc tasks.
      14. Go to one of the quizzes and go to the "Questions" page

      • Confirm that the question is displayed, with a badge showing the name of the course's shared question bank.

      15. Preview the question

      • Confirm that the question is displayed correctly including the images.

      16. Click on the pencil (edit) icon next to the question name.

      • Confirm that the question edit form is displayed

      17. Repeat steps 13-15 for the second course.

      Show
      1. Install a Moodle 4.5 site. Do not have the cron running, so that we can test ad-hoc tasks manually. 2. Create a course 3. Add a quiz, and a question to the quiz, which includes a file in its question text, and has some tags. 4. On the course page, go to "Question bank" and confirm the questions are in the course question bank. 5. Repeat steps 2-4 for a second course. 6. Apply this branch and upgrade to Moodle 5.0 7. Go to a course and access the Question banks page. Confirm a notification is shown due to the ad-hoc tasks still pending. 8. Go to a the quiz on the course, go to the "Questions" tab, and click the pencil (edit) icon next to the question name. Confirm you are still on the same page, but now the notification from step 7 is shown as well. 9. Go to Site Administration > Server > Ad-hoc tasks Confirm there is an instance of transfer_question_categories pending 10. Click "Run all" to run the task. 11. Click "Back to ad-hoc tasks" Confirm there there are now 2 instances of transfer_questions pending (one for the question bank on each course). 12. Repeat steps 7-8 and confirm that the notifications are still displayed. 13. Run the remaining ad-hoc tasks. 14. Go to one of the quizzes and go to the "Questions" page Confirm that the question is displayed, with a badge showing the name of the course's shared question bank. 15. Preview the question Confirm that the question is displayed correctly including the images. 16. Click on the pencil (edit) icon next to the question name. Confirm that the question edit form is displayed 17. Repeat steps 13-15 for the second course.
    • Hide

      Code verified against automated checks with warnings.

      Checked MDL-84466 using repository: https://github.com/marxjohnson/moodle.git

      Should these errors be fixed?

      Built on: Mon Apr 7 15:46:12 UTC 2025

      Show
      Code verified against automated checks with warnings. Checked MDL-84466 using repository: https://github.com/marxjohnson/moodle.git main (0 errors / 1 warnings) [branch: MDL-84466_main | CI Job ] overview (0/1) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Warn: The MDL-84466 _main branch at https://github.com/marxjohnson/moodle.git has not been rebased recently (>20 days ago). Should these errors be fixed? Built on: Mon Apr 7 15:46:12 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84466 _main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18949/ PHPUnit (sqlsrv) --> unrelated, please ignore. https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64845/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64846/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64847/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64848/ App tests (stable app version) Built on: Mon Apr 7 16:25:15 UTC 2025

      When running the task on our instance, it takes about 12 hours to complete. The problem is in some question categories that apparently take a very long time to convert.

      For one run I have prepared a cachegrind.out file with the PHP Xdebug profiler. The file is uploaded here: https://filesender.switch.ch/filesender2/?s=download&token=779baa4b-0c24-4ce9-a27e-9a1336f4c4e7 available till Februar 27th. It's gzipped 3.4GB. Unzipped its more that 30GB in size.

      Also we added some more logging to the conversion task to see where the time is spend and to identify possible issues. These changes are intermediate changes, not ment to become part of the Moodle core, but could when further adapted. The changes are in this repo/branch:

      https://github.com/srobotta/moodle/tree/update-qbank-with-logging

       

       

        1. qbank_transfer_new.txt
          3 kB
          Stephan Robotta
        2. qbank_transfer_old.txt
          2 kB
          Stephan Robotta

            marxjohnson Mark Johnson
            strobotta Stephan Robotta
            Tim Hunt Tim Hunt
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

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