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

Better searching/filtering in the question bank, so more flexible randomisation in quizzes

    XMLWordPrintable

Details

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_403_STABLE
    • MDL-72321_master-squashed
    • Hide

      Instance setup

      Fresh install an instance using this repo or
      Upgrade the current instance using this repo

      Set Up

      Restore the attached "Moodle Activity Examples.mbz" to a new course.

      Test scenario 1 - Apply filters in question bank view:

      1. Go to the restored course
      2. Navigate back to the question bank
      3. Remove the default category from the Type of select selection in the question bank filter
      4. "Default for questions" in the category filter
      5. Click apply filters
      6. Confirm that the 8 questions of that category are visible
      7. Confirm that other questions from different categories not visible
      8. Change the selection to "Top for activity examples"
      9. Click apply filters
      10. Confirm that no questions are visible
      11. Check "also show questions from subcategories"
      12. Click apply filters
      13. Confirm that questions from all child categories are visible
      14. Press "Add condition"
      15. Set the new filter's "Select" menu to "Tag"
      16. Add the tag "Drag and drop" to the Tag filter
      17. Click apply filters
      18. Confirm that you only see the 2 questions tagged "drag and drop"
      19. Set the "Match" parameter of the tag filter to "None"
      20. Click apply filters
      21. Confirm that you only see the questions with tags other than "drag and drop"
      22. Set the "Match" parameter of the tag filter to "All"
      23. Add the tag "cloze" to the Tag filter
      24. Click apply filters
      25. Confirm that you see no questions
      26. Set the "Match" parameter of the tag filter to "Any"
      27. Click apply filters
      28. Confirm that you see all questions tagged with either "drag and drop" or "cloze"
      29. Press "Add condition"
      30. Set the new filter's "Select" menu to "Show question text in the question list?"
      31. Set the question text filter to "Yes"
      32. Click apply filters
      33. Confirm that you see the question text below each question
      34. Set the question text filter to "No"
      35. Click apply filters
      36. Confirm that you don't see the question text below each question
      37. Reload the page
      38. Confirm that the existing filters are re-applied
      39. Click "Clear Filters"
      40. Add the following filter conditions:
        1. Category: 3.0 new question types
        2. Show hidden questions: No
      41. Click "Apply filters"
      42. Delete the question "Recreate the river thames"
      43. You should not see the deleted question
      44. Set the "Show hidden questions" filter to "Yes"
      45. Click "Apply filters"
      46. You should now see the deleted question as well

      Test scenario 2 - Adding questions to a quiz from question bank

      1. Go to the above course
      2. Create a quiz
      3. Go to Quiz > Questions > Add question "from question bank"
      4. Set the Category filter to "Default for questions"
      5. Click apply filters
      6. Select questions
      7. Click on "Add selected questions to the quiz"
      8. Expected: those question are added to the quiz

      Test scenario 3 - Adding random questions  to a quiz

      1. Go to the above course
      2. Create another quiz
      3. Go to Quiz > Questions > Add question using "a random question"
      4. Set the Category filter to "Default for questions"
      5. Click apply filters
      6. Scroll down and select number of random question
      7. Click on "Add random question"
      8. Expected: random questions are added to the quiz

      Test scenario 4 - filters persist via URL

      1. Go to the above course
      2. Go to the question bank
      3. Apply a set of filters and take a note of their values
      4. Refresh the page
      5. The same filters should be re-applied
      6. Turn editing mode on and off
      7. The same filters should be re-applied each time
      8. Copy the URL and open it in a new browser, logging in if necessary
      9. The same filters should be re-applied
      Show
      Instance setup Fresh install an instance using this repo or Upgrade the current instance using this repo Set Up Restore the attached "Moodle Activity Examples.mbz" to a new course. Test scenario 1 - Apply filters in question bank view: Go to the restored course Navigate back to the question bank Remove the default category from the Type of select selection in the question bank filter "Default for questions" in the category filter Click apply filters Confirm that the 8 questions of that category are visible Confirm that other questions from different categories not visible Change the selection to "Top for activity examples" Click apply filters Confirm that no questions are visible Check "also show questions from subcategories" Click apply filters Confirm that questions from all child categories are visible Press "Add condition" Set the new filter's "Select" menu to "Tag" Add the tag "Drag and drop" to the Tag filter Click apply filters Confirm that you only see the 2 questions tagged "drag and drop" Set the "Match" parameter of the tag filter to "None" Click apply filters Confirm that you only see the questions with tags other than "drag and drop" Set the "Match" parameter of the tag filter to "All" Add the tag "cloze" to the Tag filter Click apply filters Confirm that you see no questions Set the "Match" parameter of the tag filter to "Any" Click apply filters Confirm that you see all questions tagged with either "drag and drop" or "cloze" Press "Add condition" Set the new filter's "Select" menu to "Show question text in the question list?" Set the question text filter to "Yes" Click apply filters Confirm that you see the question text below each question Set the question text filter to "No" Click apply filters Confirm that you don't see the question text below each question Reload the page Confirm that the existing filters are re-applied Click "Clear Filters" Add the following filter conditions: Category: 3.0 new question types Show hidden questions: No Click "Apply filters" Delete the question "Recreate the river thames" You should not see the deleted question Set the "Show hidden questions" filter to "Yes" Click "Apply filters" You should now see the deleted question as well Test scenario 2 - Adding questions to a quiz from question bank Go to the above course Create a quiz Go to Quiz > Questions > Add question "from question bank" Set the Category filter to "Default for questions" Click apply filters Select questions Click on "Add selected questions to the quiz" Expected: those question are added to the quiz Test scenario 3 - Adding random questions  to a quiz Go to the above course Create another quiz Go to Quiz > Questions > Add question using "a random question" Set the Category filter to "Default for questions" Click apply filters Scroll down and select number of random question Click on "Add random question" Expected: random questions are added to the quiz Test scenario 4 - filters persist via URL Go to the above course Go to the question bank Apply a set of filters and take a note of their values Refresh the page The same filters should be re-applied Turn editing mode on and off The same filters should be re-applied each time Copy the URL and open it in a new browser, logging in if necessary The same filters should be re-applied

    Description

      MDL-67743 introduced a new filter UI for the participants page which was refactored into a reusable core API in MDL-72509.

      This issue continues that work by converting the question bank's filters to the use new API, with each condition implemented in the appropriate qbank plugin. This then allows any plugin to define its own filter conditions.

      The scope of this issue covers just the conversion of the current filters, adding additional filters based on other question bank columns is out of scope, but these will be added in follow-up tracker issues (MDL-78220).

      In particular, we will have the following filter conditions:

      • Question bank category (optionally including subcategories)
      • Show hidden questions
      • Tags
      • Show question text in question list

      "Show question text in question list" is not technically a filter, since it controls which which fields of each record are displayed, rather than which record. However, this was included in the existing question bank filter UI, so for simplicity we will just convert it to the new filter UI within this issue. Once MDL-74054 is resolved we will hopefully have a method to show and hide fields, so will have a more logical place for this option to live, and can convert it in a subsequent issue (MDL-78409).

      "Show hidden questions" and "Show question text in question list" are a simple yes/no choice. Rather than using an autocomplete with just these choices, we have implemented an additional datafilter class for a binary filter. This allows us to use a Yes/No select instead for these filters.

      "Question bank category" requires an additional checkbox to indicate whether or not the results should include questions from subcategories of the selected category well. To support this, datafilters now support an additional "filteroptions" parameter, to allow filters to add custom options to modify the filter's behaviour.

      Currently, all filters used on the Participants page have the option to match on the join types "All", "Any" or "None". These options do not make sense for most of the filters use in the question bank (all except Tags). Datafilters can now define the list of jointypes they support, and if only one is available the option will be hidden in the UI.

      In the question bank, we must always have a category filter, and the "Show hidden questions" filter should always be shown to make it clear which state it is in. To support this, datafilters can now be defined as "required", in which case the "remove" button will be hidden and they will not be removed by the "Clear filters" button.

      Aside from the main question bank UI, these changes also impact how questions are added to the quiz. The "Add from the question bank" and "Add a random question" modals now use the new filter UI to allow filtering of questions by categories and tags. For random questions, these filters are saved to the question set reference. This can be extended in the future to support more filters.

      None of these changes should impact on the existing filters on the Participants page.

      Balsamiq Wireframes

        Attachments

          Issue Links

            Activity

              People

                marxjohnson Mark Johnson
                safatshahin Safat Shahin
                Tim Hunt Tim Hunt
                Andrew Lyons Andrew Lyons
                Kim Jared Lucas Kim Jared Lucas
                Votes:
                3 Vote for this issue
                Watchers:
                25 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 0 minutes
                    0m
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 week, 5 hours, 56 minutes
                    1w 5h 56m

                    Clockify

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