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

Question bank - question filtering API for flexibility, plugins

    Details

    • Testing Instructions:
      Hide

      To test standard functions:
      Under Course > Question Bank,add or use a question bank with some subcategories
      Ensure at least one question is deleted (hidden)
      Toggle the controls "Also show questions from sub-categories" and "Show question text in the question list"
      Ensure that each control operates as labeled

      To test plugin API:
      Install the searchbytags plugin linked to this issue
      Add some tags to some questions
      Search for questions by tags using the new UI element on the Question Bank form
      Ensure that questions which match the searched tags are shown

      Select a quiz, choose Edit Quiz, and repeat the tests with that view of the question bank.

      Show
      To test standard functions: Under Course > Question Bank,add or use a question bank with some subcategories Ensure at least one question is deleted (hidden) Toggle the controls "Also show questions from sub-categories" and "Show question text in the question list" Ensure that each control operates as labeled To test plugin API: Install the searchbytags plugin linked to this issue Add some tags to some questions Search for questions by tags using the new UI element on the Question Bank form Ensure that questions which match the searched tags are shown Select a quiz, choose Edit Quiz, and repeat the tests with that view of the question bank.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This API adjustment makes it possible for code to search/filter questions in the question bank by any criteria. It introduces a new "question_bank_search_condition" class.

      Example usage includes plugins or future code finding questions based on tags, a text search, or finding questions of a certain type. Ie, show all true/false questions in a category, all questions tagged "PHP", or all questions which mention "SimpleTest".

      For illustration, the category filter and the "show old questions" filter have been converted to question_bank_search_condition subclasses. A test subclass to find questions based on tags also exists using this API.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  3 Vote for this issue
                  Watchers:
                  10 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/May/14