Question banks in upgraded sites

From MoodleDocs


In Moodle 5.0 onwards, course question banks enable teachers to reuse and share questions across courses.

See Question banks for an introduction, including question sharing across courses. Read on to find out the changes to question banks in upgraded sites.

Question banks after upgrading

In Moodle 4.5 or lower, questions are stored in one question bank in the course, and may be organised into categories and subcategories in the course, course category or system context.

After upgrading to Moodle 5.0, a course can have more than one question bank in Course navigation > More > Question banks.

Any questions previously created in the course context are saved in a '[Course name] shared question bank', which is created automatically when the site is upgraded. Any quizzes in the course are listed under 'Other activities with questions'. Each quiz has a question bank.

Question banks in 5.0 - a shared question bank and other activities with questions.

Where are questions saved in 5.0?

  • Questions previously created in the course context are saved in a course shared question bank.
  • Questions previously created in the activity context are saved in a quiz question bank.
  • Questions previously created in the course category context are saved in a course shared question bank in a new course named 'Shared teaching resources for category: [Category name]'.
  • Questions previously created in the system context are saved in a course shared question bank in the site home page.

5.0 question banks contain the same question bank categories and subcategories as previously.

How can I tell which question bank a question is from?

If you look in a quiz at Quiz navigation > Questions, each question is labelled with the question bank it is from.

Quiz navigation > Questions with questions labelled with the question bank it is from

Question sharing with teachers in other courses

To enable teachers to share questions with teachers in other courses, as described the section 'Question sharing with teachers in other courses' in Question banks, the capabilities 'Use all questions' (moodle/question:useall) and 'Use your own questions' (moodle/question:usemine) should be allowed for the non-editing teacher role as follows:

  1. Go to Site administration > Users > Define roles.
  2. Edit the non-editing teacher role and allow the capabilities moodle/question:useall and moodle/question:usemine.

These capabilities are allowed for the non-editing teacher role for new installs of Moodle 5.0, but need to be allowed for sites upgrading to 5.0.

Any users who previously had the role of Question sharer will lose access to shared questions after the site is upgraded, and need to be given access as described in the section 'Question sharing with teachers in other courses' in Question banks.

Problems with question banks after upgrading to 5.0?

See the following:

  • Error when migrating question banks with multi-byte characters names - MDL-85881 (fixed in 5.0.2)
  • Long running adhoc task: transfer_question_categories - MDL-84466 (fixed in 5.0.2)
  • After upgrading to 5.0 quiz coding error: Invalid context id specified context::instance_by_id() - MDL-85931
  • Adhoc task mod_qbank\task\transfer_question_categories fails with "Duplicate entry" error after upgrade to Moodle 5.0.1+ - MDL-85869
  • Moodle 5.0 qbank migration task has failed to migrate 3 root (parent=0) question categories of context level 50 - MDL-86226
  • Forum discussion Question banks empty after upgrading to Moodle 5

Any questions?

Please post in the Quiz forum on moodle.org.