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

Question Bank - Allow plugins to add columns to question bank view

    Details

    • Testing Instructions:
      Hide

      Attached is a local plugin which uses this API to display the last-modified-date of questions. Install the plugin.

      1. Go to Course admin -> Question bank
      2. Ensure there are some visible questions in the bank.
      3. Verify there is not a column showing the last modified date in the Question Bank display

      4. In config.php, add: $CFG->questionbankcolumns = 'checkbox_column,question_type_column,question_name_column,edit_action_column,preview_action_column,copy_action_column,delete_action_column,creator_name_column,modifier_name_column,local_questionbankmodified_question_bank_column';

      5. Verify there is now a column showing the last modified date in the Question Bank display.

      6. Create or find a quiz
      7. Go to its Edit quiz page
      8. Verify you can see the question bank there and no regressions.
      9. Add to config.php $CFG->quizquestionbankcolumns = 'add_to_quiz_action_column,checkbox_column,question_type_column,question_name_column,edit_action_column,preview_action_column,copy_action_column,local_questionbankmodified_question_bank_column';
      10. Ensure the question bank where you can select questions to add now has the last modified date column.

      Show
      Attached is a local plugin which uses this API to display the last-modified-date of questions. Install the plugin. 1. Go to Course admin -> Question bank 2. Ensure there are some visible questions in the bank. 3. Verify there is not a column showing the last modified date in the Question Bank display 4. In config.php, add: $CFG->questionbankcolumns = 'checkbox_column,question_type_column,question_name_column,edit_action_column,preview_action_column,copy_action_column,delete_action_column,creator_name_column,modifier_name_column,local_questionbankmodified_question_bank_column'; 5. Verify there is now a column showing the last modified date in the Question Bank display. 6. Create or find a quiz 7. Go to its Edit quiz page 8. Verify you can see the question bank there and no regressions. 9. Add to config.php $CFG->quizquestionbankcolumns = 'add_to_quiz_action_column,checkbox_column,question_type_column,question_name_column,edit_action_column,preview_action_column,copy_action_column,local_questionbankmodified_question_bank_column'; 10. Ensure the question bank where you can select questions to add now has the last modified date column.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-40457-question_bank_plugins_columns

      Description

      This short patch allows plugins to add columns to be displayed in the question bank view. Along with the existing information like question name, creator, and type, a plugin could add a column to display any tags associated with the question, for example, or any other information about questions.

      This complements MDL-40313, which allows plugins to add filtering criteria.
      So for example a plugin could display the creation date of the question, and allow the user to filter questions by creation date, or by tags.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Nov/14