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

Add the ability to duplicate a question within a quiz

XMLWordPrintable

    • MOODLE_401_STABLE
    • MDL-74984-master
    • Hide

      Covered by newly created Behat and PHPUnit.

      Manual testing steps are below.

      Initial setup

      1. Create a new Course called (the name is Course 1 and Course shortname is C1) or use an existing one.
      2. Create 2 new Quiz activities (called Quiz 1 and Quiz 2) in the created Course.
      3. Create a True/False question in the Question bank of created course called "Test duplicate" and idnumber is "id101" and tag is "foo".
      4. Edit the created question with the new name "Test duplicate question".
      5. Verify that the created question version is now v2.

      Question bank Duplicate question plugin

      1. Login as admin.
      2. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins.
      3. Verify that you will see the Duplicate question plugin.
      4. Enable the plugin (if necessary).
      5. Navigate to the Question bank of the created course.
      6. Click on the Edit action menu of the "Test duplicate question" question.
      7. Verify that you will see the "Duplicate" option in the opened menu.
      8. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins.
      9. Disable the plugin.
      10. Navigate to the Question bank of the created course.
      11. Click on the Edit action menu of the "Test duplicate question" question.
      12. Verify that you will not see the "Duplicate" option in the opened menu.
      13. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins.
      14. Enable the plugin again for the next test.

      Question bank

      1. Login as admin.
      2. Navigate to the Question bank of the created course.
      3. Click on the Edit action menu of the "Test duplicate question" question.
      4. Click on the Duplicate option.
      5. Verify that you will see "Are you sure you want to duplicate the 'Test duplicate question' question?".
      6. Click on the Cancel button.
      7. Verify that the dialogue will be closed and nothing will happen.
      8. Click on the Edit action menu of the "Test duplicate question" question.
      9. Click on the Duplicate option.
      10. Click on the Yes button.
      11. Verify that you will see a new question called "Test duplicate question (copy)" in the question bank.
      12. Verify that you will not see a question called "Test duplicate (copy)" in the question bank.
      13. Verify that the newly created question is highlighted.
      14. Verify that the newly created question's idnumber is id102.
      15. Verify that the newly created question version is v1.
      16. Try to preview the question.
      17. Verify that the newly created question has the same information (default mark, answer...) as the original question.
      18. Verify that the newly created question can work normally (Try to input the answer, Submit the answer...).
      19. Delete the "Test duplicate question (copy)" in the question bank for the next test.

      Quiz with a normal question

      1. Login as admin.
      2. Navigate to Quiz 1 activity.
      3. Navigate to the Quiz questions page.
      4. Verify that you will not see any questions.
      5. Click the Add menu and select "from question bank".
      6. Select the "Test duplicate question" question.
      7. Click on Add selected questions to the quiz button.
      8. Verify that you will see the "Test duplicate question" question on the page.
      9. Verify that you will see a Duplicate icon next to the Delete icon.
      10. Click on the Duplicate icon.
      11. Verify that you will see "Are you sure you want to duplicate the 'Test duplicate question' question?".
      12. Click on the Cancel button.
      13. Verify that the dialogue will be closed and nothing will happen.
      14. Click on the Duplicate icon.
      15. Click on the Yes button.
      16. Verify that you will see a new question called "Test duplicate question (copy)" on the Quiz questions page.
      17. Verify that the newly created question will be on the same page as the original question.
      18. Navigate to the Question bank page of the Quiz.
      19. Verify that you will see a new question called "Test duplicate question (copy)" in the question bank.

      Quiz with a random question

      1. Login as admin.
      2. Navigate to Quiz 2 activity.
      3. Navigate to the Quiz questions page.
      4. Verify that you will not see any questions.
      5. Click the Add menu and select "a random question".
      6. Set the Tags field to "foo"
      7. Press the Add random question button.
      8. Verify that you will see a random question called (Random (Default for C1, tags: foo).
      9. Verify that you will see a Duplicate icon next to the Delete icon.
      10. Click on the Duplicate icon.
      11. Verify that you will see "Are you sure you want to duplicate the 'Random question' question?".
      12. Click on the Cancel button.
      13. Verify that the dialogue will be closed and nothing will happen.
      14. Click on the Duplicate icon.
      15. Click on the Yes button.
      16. Verify that you will see a new question called (Random (Default for C1, tags: foo) on the Quiz questions page.
      17. Verify that the newly created question will be on the same page as the original question.
      18. Navigate to the Question bank page of the Quiz.
      19. Verify that you will not see any new questions in the question bank.

       

      Logs report

      1. Login as admin.
      2. Navigate to Site Administration > Reports > Logs.
      3. Set the filter to Today to limit the events.
      4. Press Get these logs.
      5. Verify that you will see some events with Event name is: Question duplicated.
      6. Verify that you will see some events with Event description is: The user with id '[userid]' duplicated a question with the id of '[questionid' in the category with the id '[categoryid]'.
      7. Click on the event link.
      8. Verify that you can Preview the duplicated question normally.

      Community question type

      1. Install a question type from the community. Ex: https://moodle.org/plugins/qtype_ordering
      2. Re-test the whole test suite (Except the random question case) with the new question type
      Show
      Covered by newly created Behat and PHPUnit. Manual testing steps are below. Initial setup Create a new Course called (the name is Course 1 and Course shortname is C1 ) or use an existing one. Create 2 new Quiz activities (called Quiz 1 and Quiz 2 ) in the created Course. Create a True/False question in the Question bank of created course called "Test duplicate" and idnumber is "id101" and tag is "foo" . Edit the created question with the new name "Test duplicate question". Verify that the created question version is now v2 . Question bank Duplicate question plugin Login as admin. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins. Verify that you will see the Duplicate question plugin. Enable the plugin (if necessary). Navigate to the Question bank of the created course. Click on the Edit action menu of the "Test duplicate question" question. Verify that you will see the "Duplicate" option in the opened menu. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins. Disable the plugin. Navigate to the Question bank of the created course. Click on the Edit action menu of the "Test duplicate question" question. Verify that you will not see the "Duplicate" option in the opened menu. Nvaigate to Site Administraton > Plugins > Question bank plugins / Manage question bank plugins. Enable the plugin again for the next test. Question bank Login as admin. Navigate to the Question bank of the created course. Click on the Edit action menu of the "Test duplicate question" question. Click on the Duplicate option. Verify that you will see "Are you sure you want to duplicate the 'Test duplicate question' question?". Click on the Cancel button. Verify that the dialogue will be closed and nothing will happen. Click on the Edit action menu of the "Test duplicate question" question. Click on the Duplicate option. Click on the Yes button. Verify that you will see a new question called "Test duplicate question (copy)" in the question bank. Verify that you will not see a question called "Test duplicate (copy)" in the question bank. Verify that the newly created question is highlighted. Verify that the newly created question's idnumber is id102. Verify that the newly created question version is v1. Try to preview the question. Verify that the newly created question has the same information (default mark, answer...) as the original question. Verify that the newly created question can work normally (Try to input the answer, Submit the answer...). Delete the "Test duplicate question (copy)" in the question bank for the next test. Quiz with a normal question Login as admin. Navigate to Quiz 1 activity. Navigate to the Quiz questions page. Verify that you will not see any questions. Click the Add menu and select "from question bank". Select the "Test duplicate question" question. Click on Add selected questions to the quiz button. Verify that you will see the "Test duplicate question" question on the page. Verify that you will see a Duplicate icon next to the Delete icon. Click on the Duplicate icon. Verify that you will see "Are you sure you want to duplicate the 'Test duplicate question' question?". Click on the Cancel button. Verify that the dialogue will be closed and nothing will happen. Click on the Duplicate icon. Click on the Yes button. Verify that you will see a new question called "Test duplicate question (copy)" on the Quiz questions page. Verify that the newly created question will be on the same page as the original question. Navigate to the Question bank page of the Quiz. Verify that you will see a new question called "Test duplicate question (copy)" in the question bank. Quiz with a random question Login as admin. Navigate to Quiz 2 activity. Navigate to the Quiz questions page. Verify that you will not see any questions. Click the Add menu and select "a random question". Set the Tags field to "foo" Press the Add random question button. Verify that you will see a random question called (Random (Default for C1, tags: foo). Verify that you will see a Duplicate icon next to the Delete icon. Click on the Duplicate icon. Verify that you will see "Are you sure you want to duplicate the 'Random question' question?". Click on the Cancel button. Verify that the dialogue will be closed and nothing will happen. Click on the Duplicate icon. Click on the Yes button. Verify that you will see a new question called (Random (Default for C1, tags: foo) on the Quiz questions page. Verify that the newly created question will be on the same page as the original question. Navigate to the Question bank page of the Quiz. Verify that you will not see any new questions in the question bank.   Logs report Login as admin. Navigate to Site Administration > Reports > Logs. Set the filter to Today to limit the events. Press Get these logs. Verify that you will see some events with Event name is: Question duplicated. Verify that you will see some events with Event description is: The user with id ' [userid] ' duplicated a question with the id of '[questionid' in the category with the id ' [categoryid] '. Click on the event link. Verify that you can Preview the duplicated question normally. Community question type Install a question type from the community. Ex: https://moodle.org/plugins/qtype_ordering Re-test the whole test suite (Except the random question case) with the new question type
    • 6
    • HQ Team International CIH2-225, HQ Team International CIH2-226

      To make it easier and faster for teachers to create their quiz, they require the ability to duplicate questions within their quiz.

      Similar functionality already exists in the actions available within the question bank (listed as "Duplicate" in the Edit dropdown). The main functional differences in this new use case are:

      1. We do not need to navigate to the "edit" page for the question once it is duplicated.
      2. This would probably be best implemented as a web service, where the duplication is completed and then the new row is displayed on the page, without requiring a refresh/redirect.
      3. There will be some additional values that need to be set by the web service so that the question is duplicated within the quiz itself, and not just recreated as a question in the question bank. We need to be mindful of what is required vs optional information passed into the web service, as there may be other generic use cases for it (eg if the question bank gets updated to use it later).

      Although the below prototype shows the new quiz interface, this can be implemented independent of any styling changes being completed. If being implemented on the existing interface, the icon can be placed to the left of the "delete" icon, and reuse the icon from the equivalent question bank option mentioned above.

      Prototype

      Prototype link for this improvement

      In the old UI, placement can be to the left of the delete icon:

            Unassigned Unassigned
            michaelh Michael Hawkins
            Tim Hunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 1 day, 7 hours, 17 minutes
                1w 1d 7h 17m

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