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

Question preview: add 'always latest' version option, and warn if question edited after preview started

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-75301_401_STABLE
    • MDL-75301_master
    • Hide

      This is covered by automated tests in mod/quiz/tests/behat/quiz_question_versions.feature and question/bank/previewquestion/tests/behat/preview_question.feature

      To test manually:

      1. Create a new quiz called "Test quiz"
      2. Add a new question called "Test question", with the text "This is version 1". It can be any type.
      3. Go to the question bank, find "Test question" and select Edit > Preview.
      4. Expand the Preview Options heading an verify that the "Question version" field has an "Always latest" option, which is selected by default.
      5. Enter an answer to the question and click "Save".
      6. In another tab/window, go to the question bank, find "Test question" and select Edit > Edit question.
      7. Change the text to "This is version 2" and click "Save changes".
      8. Back in the preview tab, click "Start again"
        • The preview should now show you version 2.
        • Before fix: The preview still showed you version 1.
      9. In the question bank tab, edit the question again to create version 3.
      10. In the preview tab, enter an answer for the question and click "Save".
        • You should still see version 2. Below the heading you should also see a message indicating that there is a newer version, with a button to restart.
      11. Close the preview.
      12. Back in the question bank, find "Test question" and select Edit > History.
      13. Find version 1 and select "Edit > Preview".
      14. Expand the Preview Options heading an verify that the "Question version" is set to "1".
      15. Repeat steps 5-7, to creating version 4 of the question.
      16. Back in the preview tab, click "Start again"
      17. You should still see version 1, not the latest version.
      18. In "Test Quiz", go to the "Questions" tab, where you can see "Test question" within the quiz.
      19. The version selector for the question should say "Always latest".
      20. Click the "Preview" icon for the question.
      21. Expand the Preview Options heading an verify that the "Question version" field has the "Always latest" selected.
      22. Close the preview.
      23. Change the question's version selector to a specific version.
      24. Click the "Preview" icon for the question.
      25. Expand the Preview Options heading an verify that the "Question version" field has the same version selected as you set in 23.
      Show
      This is covered by automated tests in mod/quiz/tests/behat/quiz_question_versions.feature and question/bank/previewquestion/tests/behat/preview_question.feature To test manually: Create a new quiz called "Test quiz" Add a new question called "Test question", with the text "This is version 1". It can be any type. Go to the question bank, find "Test question" and select Edit > Preview. Expand the Preview Options heading an verify that the "Question version" field has an "Always latest" option, which is selected by default. Enter an answer to the question and click "Save". In another tab/window, go to the question bank, find "Test question" and select Edit > Edit question. Change the text to "This is version 2" and click "Save changes". Back in the preview tab, click "Start again" The preview should now show you version 2. Before fix: The preview still showed you version 1. In the question bank tab, edit the question again to create version 3. In the preview tab, enter an answer for the question and click "Save". You should still see version 2. Below the heading you should also see a message indicating that there is a newer version, with a button to restart. Close the preview. Back in the question bank, find "Test question" and select Edit > History. Find version 1 and select "Edit > Preview". Expand the Preview Options heading an verify that the "Question version" is set to "1". Repeat steps 5-7, to creating version 4 of the question. Back in the preview tab, click "Start again" You should still see version 1, not the latest version. In "Test Quiz", go to the "Questions" tab, where you can see "Test question" within the quiz. The version selector for the question should say "Always latest". Click the "Preview" icon for the question. Expand the Preview Options heading an verify that the "Question version" field has the "Always latest" selected. Close the preview. Change the question's version selector to a specific version. Click the "Preview" icon for the question. Expand the Preview Options heading an verify that the "Question version" field has the same version selected as you set in 23.

      See this forum discussion: https://moodle.org/mod/forum/discuss.php?d=436160#p1755303. The lack of this option, as the default, is causing Moodle to behave in a way that users do not expect (which is why I cheakily created this as a bug, not an improvement.)

      What needs to be done:

      • Add the (Always latest) option to that dropdown.
      • Make it work.
      • Review all the places that link to preview, and ensure that the most appropriate version setting gets passed. (I think the always latest version is right almost everywhere, except when you open the preview from the question history page, when it should show that specific version, and from the quiz, when it should use the setting that the questoin uses in that quiz.)

      Here is what was implemented:

            marxjohnson Mark Johnson
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 41 minutes
                3h 41m

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