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

Missing Question Type Improvements: Upgrade 4.6/5.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0
    • 5.0
    • Questions, Quiz
    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • Hide

      Testing

      1. Install Moodle 4.5 or below (a version which can be upgraded to 4.6 or 5.0)
      2. Install a new question type we can use for testing. I chose to use (https://github.com/dualcube/moodle-qtype_ddmatch) but any other question type will do.
      3. Create a course
      4. Create a question bank on the course if one doesn't exist already
      5. Add a question of the newly installed type to the bank
      6. In any text editor on the new question form that lets you attach a file/image - add one (Should be question text or feedback)
      7. Remove the "ddmatch" question type by deleting the question/type/ddmatch directory (or whichever one you chose to install)
      8. Upgrade your codebase to previous weekly release of main 
      9. After the upgrade has completed, there should be an adhoc task in the table `mdl_task_adhoc` of classname `\mod_qbank\task\transfer_question_categories`
      10. Run this adhoc task, either manually by using the `php admin/cli/adhoc_task.php` script or by running the cron again.
      11. You should see it fails to execute due to the unknown question type
      12. Checkout to the latest main branch.
      13. Run the adhoc task again
      14. It should now succeed
      15. You should then be able to find the invalid questions have been moved to the new question bank on the course, most likely called "A shared question bank"
      16. Reinstall the missing question type
      17. Edit the question, which should now be editable again that the type is there
      18. Confirm that attached files/images are still in place (question text and feedback fields should always still be there. Custom text editors on the question type which don't exist on the base question type, may not be transferred.)
      Show
      Testing Install Moodle 4.5 or below (a version which can be upgraded to 4.6 or 5.0) Install a new question type we can use for testing. I chose to use ( https://github.com/dualcube/moodle-qtype_ddmatch ) but any other question type will do. Create a course Create a question bank on the course if one doesn't exist already Add a question of the newly installed type to the bank In any text editor on the new question form that lets you attach a file/image - add one (Should be question text or feedback) Remove the "ddmatch" question type by deleting the question/type/ddmatch directory (or whichever one you chose to install) Upgrade your codebase to previous weekly release of main  After the upgrade has completed, there should be an adhoc task in the table `mdl_task_adhoc` of classname `\mod_qbank\task\transfer_question_categories` Run this adhoc task, either manually by using the `php admin/cli/adhoc_task.php` script or by running the cron again. You should see it fails to execute due to the unknown question type Checkout to the latest main branch. Run the adhoc task again It should now succeed You should then be able to find the invalid questions have been moved to the new question bank on the course, most likely called "A shared question bank" Reinstall the missing question type Edit the question, which should now be editable again that the type is there Confirm that attached files/images are still in place (question text and feedback fields should always still be there. Custom text editors on the question type which don't exist on the base question type, may not be transferred.)
    • Hide

      Code verified against automated checks.

      Checked MDL-84246 using repository: https://github.com/cwarwicker/moodle

      More information about this report

      Built on: Wed Mar 12 08:46:22 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-84246 using repository: https://github.com/cwarwicker/moodle main (0 errors / 0 warnings) [branch: MDL-84246 | CI Job ] More information about this report Built on: Wed Mar 12 08:46:22 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-84246 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18554/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63567/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63568/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63569/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63570/ App tests (stable app version) Built on: Wed Mar 12 12:30:19 UTC 2025

      Upgrade Step

      Invalid questions in the upgrade step to 4.6/5.0 should:

      • Still be able to be transferred to new categories

       

      Things to consider

      • When moving files associated with the question, we can do a generic move from the basequestiontype, which moves files in the quesitontext or generalfeedback, but some question types have other areas where files might be, so if the missing question type would have moved more files, we can't do those. There's not an easy way around this, as we can't really leave the question where it was, as the question banks and categories all get changed and moved around.

       

       

      NOTE FOR INTEGRATOR: This needs to be integrated to 4.6 as well

        1. result_1.png
          result_1.png
          370 kB
        2. result_2.png
          result_2.png
          223 kB
        3. result_3.png
          result_3.png
          1.03 MB

            cwarwicker CMR
            tkorner Thomas Korner
            Mark Johnson Mark Johnson
            Mihail Geshoski Mihail Geshoski
            Huong Nguyen Huong Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 1 hour, 48 minutes
                2d 1h 48m

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