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

Make shared question banks more manageable and usable

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_500_STABLE
    • MDL-71378_main
    • Hide

      A. Fresh installation Moodle 5.0 (main)

      Setup

      1. Create a fresh install of Moodle with this patch.
      2. Confirm that the installation completes successfully.
      3. Log in as an admin
      4. Set up a course
      5. Create a question bank activity
      6. Create some questions in the default category, please use different types of questions to get a better feeling of the patch.
      7. Add a quiz with at least 3-4 questions
      8. Create a new user
      9. Enroll that user as a student in that course

      Testing scenario A.1. General question information

      1. Edit the questions created during setup, to create some versions for those questions
      2. Save changes and go to the question bank activity
      3. Confirm:
        1. All the question information is available on the question bank page
        2. All the question information is available on the question history page

      Testing scenario A.2. Quiz attept using questions from question bank activity

      1. Create a new question bank activity
      2. Add some questions to it
      3. Setup a quiz
      4. Add those questions to the quiz
      5. Use the created category as a random question
      6. Change the versions for the questions in the regular questions in the quiz
      7. Login as student
      8. Attempt the quiz
      9. Confirm
        1. Quiz uses the questions selected in an attempt
        2. Random question picks up the questions from the selected question category

      Testing scenario A3. Question data in restore (same site)

      1. Backup the course and save the .mbz file on the local device
      2. Restore the previous backup file to the same site as a new course
      3. Confirm:
        1. The restored questions are available in question bank activity and working as expected
        2. The restored quiz has all the questions
        3. The restored quiz has all the attempts
        4. All the files are available in the restores questions
        5. The preview of the questions is working as expected

      Testing scenario A.4. Question data in restore (different site)

      1. Setup a new Moodle 5.0 site
      2. Restore the previous backup course (created in scenario A3) on that site
      3. Confirm:
        1. The restored questions are available in question bank activity and working as expected
        2. The restored quiz has all the questions
        3. The restored quiz has all the attempts
        4. All the files are available in the restores questions
        5. The preview of the questions is working as expected

       

      B. Migration from Moodle 3.11

      Setup

      1. Setup a Moodle 3.11 site
      2. Log in as an admin
      3. Set up a course and access to the question bank
      4. Create some questions in the course category, please use different types of questions to get a better feeling of the patch.
      5. Add a quiz with at least 3-4 questions
      6. Create a new user
      7. Enroll that user as a student in that course
      8. Attempt the quiz
      9. Backup the course (including user data)
      10. Download and save the file on the local device

      Testing scenario B.1. Migration of questions

      1. Change the codebase to 5.0 with this patch applied
      2. Upgrade the site. 
      3. Run adhoc task \mod_qbank\task\transfer_question_categories
      4. Go to the quiz and check the questions and any attempts made for those questions.
      5. Confirm:
        1. That all the questions are available in the question bank activity
        2. All the question data including the files added to the questions are available
        3. The preview of the questions is working as expected
        4. All the questions in the quiz are available and the preview is working from the quiz
        5. The previous attempts are available and they can be viewed as expected
      6. Log out and log in as the student
      7. Navigate to the course
      8. Re-attempt the quiz
      9. Confirm:
        1. The quiz is working as expected without any issues or error
      10. Log out and log in as an admin
      11. Create some versions of the questions
      12. Change to those versions from the quiz
      13. Logout and log in as a student
      14. Start a new attempt of the quiz again (if the previous attempt wasn't finished, you should finish it before starting a new attempt; otherwise, the new question versions won't be updated)
      15. Confirm:
        1. That the newly selected versions of the quiz are considered in this attempt
        2. All the questions are working as expected without any issue
        3. Any image or files are available to access

      Testing scenario B.2. Legacy question data migrates in restore

      1. Standup a fresh Moodle 5.0 site
      2. Restore the Moodle 3.11 course backup on that site
      3. Confirm:
        1. The restored questions are available in a question bank activity and working as expected
        2. The restored quiz has all the questions
        3. The restored quiz has all the attempts
        4. All the files are available in the restores questions
        5. The preview of the questions is working as expected
      Show
      A. Fresh installation Moodle 5.0 (main) Setup Create a fresh install of Moodle with this patch. Confirm that the installation completes successfully. Log in as an admin Set up a course Create a question bank activity Create some questions in the default category, please use different types of questions to get a better feeling of the patch. Add a quiz with at least 3-4 questions Create a new user Enroll that user as a student in that course Testing scenario A.1. General question information Edit the questions created during setup, to create some versions for those questions Save changes and go to the question bank activity Confirm : All the question information is available on the question bank page All the question information is available on the question history page Testing scenario A.2. Quiz attept using questions from question bank activity Create a new question bank activity Add some questions to it Setup a quiz Add those questions to the quiz Use the created category as a random question Change the versions for the questions in the regular questions in the quiz Login as student Attempt the quiz Confirm Quiz uses the questions selected in an attempt Random question picks up the questions from the selected question category Testing scenario A3. Question data in restore (same site) Backup the course and save the .mbz file on the local device Restore the previous backup file to the same site as a new course Confirm : The restored questions are available in question bank activity and working as expected The restored quiz has all the questions The restored quiz has all the attempts All the files are available in the restores questions The preview of the questions is working as expected Testing scenario A.4. Question data in restore (different site) Setup a new Moodle 5.0 site Restore the previous backup course (created in scenario A3) on that site Confirm : The restored questions are available in question bank activity and working as expected The restored quiz has all the questions The restored quiz has all the attempts All the files are available in the restores questions The preview of the questions is working as expected   B. Migration from Moodle 3.11 Setup Setup a Moodle 3.11 site Log in as an admin Set up a course and access to the question bank Create some questions in the course category, please use different types of questions to get a better feeling of the patch. Add a quiz with at least 3-4 questions Create a new user Enroll that user as a student in that course Attempt the quiz Backup the course (including user data) Download and save the file on the local device Testing scenario B.1. Migration of questions Change the codebase to 5.0 with this patch applied Upgrade the site.  Run adhoc task \mod_qbank\task\transfer_question_categories Go to the quiz and check the questions and any attempts made for those questions. Confirm : That all the questions are available in the question bank activity All the question data including the files added to the questions are available The preview of the questions is working as expected All the questions in the quiz are available and the preview is working from the quiz The previous attempts are available and they can be viewed as expected Log out and log in as the student Navigate to the course Re-attempt the quiz Confirm : The quiz is working as expected without any issues or error Log out and log in as an admin Create some versions of the questions Change to those versions from the quiz Logout and log in as a student Start a new attempt of the quiz again (if the previous attempt wasn't finished, you should finish it before starting a new attempt; otherwise, the new question versions won't be updated) Confirm : That the newly selected versions of the quiz are considered in this attempt All the questions are working as expected without any issue Any image or files are available to access Testing scenario B.2. Legacy question data migrates in restore Standup a fresh Moodle 5.0 site Restore the Moodle 3.11 course backup on that site Confirm : The restored questions are available in a question bank activity and working as expected The restored quiz has all the questions The restored quiz has all the attempts All the files are available in the restores questions The preview of the questions is working as expected
    • Hide

      Code verified against automated checks with warnings.

      Checked MDL-71378 using repository: https://github.com/SimonasAdams/moodle

      Should these errors be fixed?

      Built on: Mon 18 Nov 2024 11:54:27 AM UTC

      Show
      Code verified against automated checks with warnings. Checked MDL-71378 using repository: https://github.com/SimonasAdams/moodle main (0 errors / 14 warnings) [branch: MDL-71378_main | CI Job ] overview (0/0) , phplint (0/0) , phpcs (0/0) , js (0/12) , css (0/0) , phpdoc (0/0) , commit (0/1) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/1) , gherkin (0/0) , Should these errors be fixed? Built on: Mon 18 Nov 2024 11:54:27 AM UTC
    • Show
      Launching automatic jobs for branch MDL-71378 _main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17376/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59303/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59304/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59305/ Behat (Firefox - classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59306/ App tests (stable app version) / complete) Built on: Mon Nov 18 11:46:29 AM UTC 2024

      The model for having shared questions banks in Moodle has serious limitations. For example, sharing questions beween courses is only possible if you define non-standard custom roles, and assign them in the system context. Also, there is only one system context, so there only a single questions bank that can be used to share quetsions throught a Moodle site, which is not scalable. We need a better model.

      Our proposal to fix this has 3 main parts:

      1. Currently, we have ativities like quiz, which have their on private question-bank area. if you are focused on the question bank, then you can see the quiz as "Question bank + other stuff" (with the question bank part of the UI generated by core_question). We don't want to change this, becuase we always want to support the simple case where teachers can build a stand-alone quiz without thinking about the question bank. Thefore, to allow people control over which question banks they have, we will create a new activity Question bank (mod_qbank) which is basically "Question bank + nothing else."
      2. Once we have done that, there is no need for system/course-category/course question banks. So, in future, we will say that question banks can only exist at context_module. This sill simplify a lot of bits of code.
      3. Finally, in the quiz, if you choose Add -> From question bank, then in that dialogue, you will be able to select questoins to add to the quiz from any shared question bank that you have permission to access (as controlled by the existing capabilities moodle/question:use(all/mine).
      4. Obviously, upgrade from the previous version to this new version must be smooth.

      Point 3 is supported by the already integrated changes which added the qeustion_references database table (starting in MDL-71696).

      More details will follow.

        1. Activity help popup.png
          Activity help popup.png
          40 kB
        2. backup-moodle2-course-2-activity_examples-20220308-1901-nu.mbz
          7.65 MB
        3. intermediate_icon.jpg
          intermediate_icon.jpg
          3 kB
        4. MDL-71378 FRESH MAIN.png
          MDL-71378 FRESH MAIN.png
          1.65 MB
        5. MDL-71378 MIGRATION FROM 311.png
          MDL-71378 MIGRATION FROM 311.png
          2.09 MB
        6. MDL-71378 warnings.png
          MDL-71378 warnings.png
          160 kB
        7. new_icons.jpg
          new_icons.jpg
          46 kB
        8. pr_amendments_round2.ods
          28 kB
        9. pr_amendments_round3.ods
          37 kB
        10. pr_amendments.ods
          29 kB
        11. qbank_withoutpatch.png
          qbank_withoutpatch.png
          69 kB
        12. qbank_withpatch.png
          qbank_withpatch.png
          79 kB
        13. questions_in_use_by_quiz_after_transfer.png
          questions_in_use_by_quiz_after_transfer.png
          153 kB

            Votes:
            43 Vote for this issue
            Watchers:
            75 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 2 days, 2 hours, 30 minutes
                1w 2d 2h 30m

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