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

Question preview doesn't include subcategories for top level categories

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. Log in as admin
      2. Create a course (c1)
      3. Create a quiz activity (quiz1) in c1
      4. View quiz1 and go to the question bank categories
        • cog icon > question bank > categories
      5. Add a subcategory (c1 subcategory) to the “Default for c1” category
      6. Go to the questions tab in the question bank
      7. Create 2 questions (doesn’t matter the type) in the “Default for c1” category
        • Name the questions something that identifies the category, such as “c1 cat q1”, “c1 cat q2” etc
        • Give “c1 cat q1” the tag “c1”
      8. Create 1 question in the “c1 subcategory” category
        • Name it something identifiable like “sub c2 cat q1”
        • Give it the tags “c1” and “sub”
      9. Create 1 question in the category “Default for Miscellaneous”
        • Name it something identifiable like “misc cat q1”
        • Give it the tags “c1” and “misc”

      Testing the preview section

      1. Go to quiz1 and edit it
      2. Open the “Add” menu and click “+ a random question” to open the modal
      3. In the “Existing category” tab
      4. Set the category to “Top for c1”
      5. Make sure no tags are added to the filter
      6. CONFIRM that you see both questions from the “Default for c1” category and the “c1 subcategory”
      7. CONFIRM that you don’t see the question from the “Default for Miscellaneous” category
      8. Add the tag “c1” to the filter
      9. CONFIRM that the question list is updated to only include the questions “c1 cat q1” and “sub c2 cat q1”
      10. Add the tag “sub”
      11. CONFIRM that the question list is updated to only include the question “sub c2 cat q1”
      12. Continue to change the values in the filter, selecting different combinations of Category, Tags, and including subcategories
        • Note: If you set the category to a top level category (e.g. “Top for c1”) the “include subcategories” checkbox will be hidden and the question list will always include subcategories. This is because top-level categories cannot have questions added to them directly and will always include questions from their subcategories if added.
      13. CONFIRM that the question preview section updates to show the list of questions matching whichever filters you set
      Show
      Set up Log in as admin Create a course (c1) Create a quiz activity (quiz1) in c1 View quiz1 and go to the question bank categories cog icon > question bank > categories Add a subcategory (c1 subcategory) to the “Default for c1” category Go to the questions tab in the question bank Create 2 questions (doesn’t matter the type) in the “Default for c1” category Name the questions something that identifies the category, such as “c1 cat q1”, “c1 cat q2” etc Give “c1 cat q1” the tag “c1” Create 1 question in the “c1 subcategory” category Name it something identifiable like “sub c2 cat q1” Give it the tags “c1” and “sub” Create 1 question in the category “Default for Miscellaneous” Name it something identifiable like “misc cat q1” Give it the tags “c1” and “misc” Testing the preview section Go to quiz1 and edit it Open the “Add” menu and click “+ a random question” to open the modal In the “Existing category” tab Set the category to “Top for c1” Make sure no tags are added to the filter CONFIRM that you see both questions from the “Default for c1” category and the “c1 subcategory” CONFIRM that you don’t see the question from the “Default for Miscellaneous” category Add the tag “c1” to the filter CONFIRM that the question list is updated to only include the questions “c1 cat q1” and “sub c2 cat q1” Add the tag “sub” CONFIRM that the question list is updated to only include the question “sub c2 cat q1” Continue to change the values in the filter, selecting different combinations of Category, Tags, and including subcategories Note: If you set the category to a top level category (e.g. “Top for c1”) the “include subcategories” checkbox will be hidden and the question list will always include subcategories. This is because top-level categories cannot have questions added to them directly and will always include questions from their subcategories if added. CONFIRM that the question preview section updates to show the list of questions matching whichever filters you set
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-62382-master

      Description

      The question list preview for the add random question modal doesn't include the subcategories when loading the list of questions. This means that the list always returns empty because top level categories can't ever have questions.

        Attachments

          Activity

            People

            • Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              Shamim Rezaie
              Integrator:
              Jun Pataleta
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m