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

Add a tag filter to the "Add from question bank" dialogue

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.5
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Test environment

      Please test on both the Clean and Boost themes.

      Set up

      1. Log in as admin
      2. Create a course (C1)
        • Enrol a user with the teacher role in the course (t1)
      3. Create a quiz activity (Q1)
      4. Go to the question bank
        1. View the course
        2. (On boost) Open the edit cog > select “more…” > click question bank
        3. (On clean) Click “question bank” in the navigation block
      5. Create a new sub quiz category (SQC1) for the default quiz category for C1
        1. Click the “Categories” tab (on boost) or the Categories node in the navigation block (on clean)
        2. In the “Add category” form at the bottom set the parent category to “Default for C1”
      6. Create a category question
        1. Click the “questions” tab
        2. Set “Select a category” to the default category, should be “Default for Miscellaneous”
        3. Click “Create a new question” and select a question type (doesn’t matter. True/False is easy to generate)
        4. Add the mandatory fields and in the “Tags” section add a tag “category”
      7. Create 2 course questions
        1. Set “Select a category” to the default course, should be “Default for C1”
        2. Follow steps above to create a question but in this case tag one question with “foo” and “cq1” and the other with “bar” and “cq2”
      8. Create a sub category question
        1. Set “Select a category” to the sub category you created above
        2. Follow steps above to create a question and set the tags to “foo” and “sub”

      Test question bank

      1. Log in as t1
      2. Go to the course C1 and view the question bank
      3. CONFIRM you can filter the visible questions using the “Filter by tags…” autocomplete section.
        • The tags should be additive, e.g. adding both “foo” and “bar” will filter the list to show only questions that have both tags, not either tag.
        • You can only pick tags from the list that are available (can’t filter by tags that aren’t used)
        • The list of questions should only contain questions that match the tag filter
      4. CONFIRM the other search features on the question bank all behave as they did previously and work in conjunction with the tags filter.
        • E.g. changing category, show/hide subcategories, sorting the questions table, moving questions to different categories etc

      Test question bank modal

      1. Log in as t1
      2. View the quiz activity
      3. Click “edit quiz”
      4. Add a question from the question bank
        • Click the “Add” dropdown > from question bank
      5. CONRIRM that a modal opens with the question bank in it
      6. CONFIRM that all of the searching / filtering works as described in “Test question bank” above
      7. CONFIRM that you can add a question to the quiz by clicking the “plus” icon on a question in the list
      8. CONFIRM that the question is added to the quiz under “Page 1”
      9. Open the modal from the top “Add” dropdown
      10. CONFIRM that the title of the modal says “Add from the question bank to page 1”
      11. CONFIRM that if you add another question using the “plus” icon that it adds it to page 1
        • note that you can’t add the same question twice
      12. Delete the question you just added
      13. Open the modal from the bottom “Add” dropdown
      14. CONFIRM that the title says “Add from the question bank at the end”
      15. CONFIRM that adding the question using the plus icon adds the question to a new page (Page 2)
      16. Delete all of the questions
      17. Repeat the above steps but add the question by selecting their checkboxes and clicking the “Add selected questions to the quiz” button
      18. Open the modal again
      19. CONFIRM that you can preview the questions from the modal (clicking the little preview button)

      Test pagination

      1. Create a scenario where the list of questions will be paginated, there are two ways to do this:
        1. Edit question/editlib.php and changed the DEFAULT_QUESTIONS_PER_PAGE constant from 20 to 1. This makes it show only 1 question per page, so the above set of questions would cause pagination
        2. Add 20 more questions (the default page size is 20) and tag them all with "foo"
      2. CONFIRM that you can view each of the pages of questions in both the question bank and question bank modal
      3. Add tag "foo" to the filter list
      4. CONFIRM that you see a paged list of questions but only ones that contain the tag "foo" (test both the question bank and question bank modal)
      Show
      Test environment Please test on both the Clean and Boost themes. Set up Log in as admin Create a course (C1) Enrol a user with the teacher role in the course (t1) Create a quiz activity (Q1) Go to the question bank View the course (On boost) Open the edit cog > select “more…” > click question bank (On clean) Click “question bank” in the navigation block Create a new sub quiz category (SQC1) for the default quiz category for C1 Click the “Categories” tab (on boost) or the Categories node in the navigation block (on clean) In the “Add category” form at the bottom set the parent category to “Default for C1” Create a category question Click the “questions” tab Set “Select a category” to the default category, should be “Default for Miscellaneous” Click “Create a new question” and select a question type (doesn’t matter. True/False is easy to generate) Add the mandatory fields and in the “Tags” section add a tag “category” Create 2 course questions Set “Select a category” to the default course, should be “Default for C1” Follow steps above to create a question but in this case tag one question with “foo” and “cq1” and the other with “bar” and “cq2” Create a sub category question Set “Select a category” to the sub category you created above Follow steps above to create a question and set the tags to “foo” and “sub” Test question bank Log in as t1 Go to the course C1 and view the question bank CONFIRM you can filter the visible questions using the “Filter by tags…” autocomplete section. The tags should be additive, e.g. adding both “foo” and “bar” will filter the list to show only questions that have both tags, not either tag. You can only pick tags from the list that are available (can’t filter by tags that aren’t used) The list of questions should only contain questions that match the tag filter CONFIRM the other search features on the question bank all behave as they did previously and work in conjunction with the tags filter. E.g. changing category, show/hide subcategories, sorting the questions table, moving questions to different categories etc Test question bank modal Log in as t1 View the quiz activity Click “edit quiz” Add a question from the question bank Click the “Add” dropdown > from question bank CONRIRM that a modal opens with the question bank in it CONFIRM that all of the searching / filtering works as described in “Test question bank” above CONFIRM that you can add a question to the quiz by clicking the “plus” icon on a question in the list CONFIRM that the question is added to the quiz under “Page 1” Open the modal from the top “Add” dropdown CONFIRM that the title of the modal says “Add from the question bank to page 1” CONFIRM that if you add another question using the “plus” icon that it adds it to page 1 note that you can’t add the same question twice Delete the question you just added Open the modal from the bottom “Add” dropdown CONFIRM that the title says “Add from the question bank at the end” CONFIRM that adding the question using the plus icon adds the question to a new page (Page 2) Delete all of the questions Repeat the above steps but add the question by selecting their checkboxes and clicking the “Add selected questions to the quiz” button Open the modal again CONFIRM that you can preview the questions from the modal (clicking the little preview button) Test pagination Create a scenario where the list of questions will be paginated, there are two ways to do this: Edit question/editlib.php and changed the DEFAULT_QUESTIONS_PER_PAGE constant from 20 to 1 . This makes it show only 1 question per page, so the above set of questions would cause pagination Add 20 more questions (the default page size is 20) and tag them all with "foo" CONFIRM that you can view each of the pages of questions in both the question bank and question bank modal Add tag "foo" to the filter list CONFIRM that you see a paged list of questions but only ones that contain the tag "foo" (test both the question bank and question bank modal)
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-61135-master

      Description

      As a teacher, I can filter my question in courses based on tags.

      • I should be able to filter by tag when adding questions to a quiz, either by entering free text or selecting from a dropdown.
      • The list fo tags should provide suggestions based on the tag containers for both the question tags and course question tags

        Attachments

        1. 1.PNG
          180 kB
          Janelle Barcega
        2. 2.PNG
          132 kB
          Janelle Barcega
        3. 3.PNG
          194 kB
          Janelle Barcega
        4. 4.PNG
          59 kB
          Janelle Barcega
        5. label-icon.png
          61 kB
          David Monllaó
        6. question-bank-no-selection.png
          43 kB
          David Monllaó

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 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 - 2 weeks, 2 days, 2 hours, 15 minutes
                  2w 2d 2h 15m