Screenshot showing the use of a code editor to find and replace non-accessible HTML tags in question bank XML files.

July 1, 2024, by Ben Atkinson

Bulk Editing Moodle Question Banks

In today’s post, I want to discuss the process of making of bulk editing Moodle question bank questions, primarily to make them more accessible. This is a topic we have been discussing for a number of months in the Faculty of Science. We are currently in the middle of the Moodle Rollover ahead of the 24-25 academic year which will begin in September 2024, and are also coming to the end of the first phase of our accessibility work in the faculty which has focused on Moodle module sites and resolving issues raised through the Brickfield reporting tool.

Question banks are relied upon quite heavily in the Faculty of Science at Nottingham, especially in disciplines such as Chemistry, Physics and Computer Science. Traditionally, Moodle takes a non-destructive editing approach to questions created in the Question Bank. This has lead to an increase in the number of errors on our Brickfield report, because each time a question is edited to improve accessibility, a copy is made and the old question remains in its inaccessible format. Added to this, at Nottingham we have a process whereby we disabled the ability for teaching staff to delete question bank questions to avoid the loss of any important assessment data. These were the two big issues that we had to resolve when considering how to make Question Bank questions accessible in Moodle for the Faculty of Science.

What is the Question Bank?

The Question bank allows a teacher to create, preview and edit questions in a database and use them in the Quiz activity. Questions are organized in categories and subcategories similar to the way files are stored in folders and subfolders. These categories may be limited to being used on the site, course or quiz level. The quiz activity is often used for formative assessment where a number of questions will be asked of students on different topics, to assess their understanding and inform future teaching and revision.

Screenshot showing the question bank on Moodle.

Fig 1. The question bank on Moodle contains many different types of questions which sit in categories and can be imported or exported from one site to another.

What kind of questions do we have in Faculty of Science?

In the Faculty of Science we largely have very straight forward text based questions for use in formative quizzes. However, many of these questions contain elements of bold and italic formatting (such as for certain scientific formula) and this lead to large number of errors in Brickfield (several hundred for each site) along with the inability to bulk fix these issues because of the non-destructive editing of Question Banks in Moodle. Many questions also had images in them, but in this approach we did not fix the image ALT text, recommending instead that academics add their own ALT text on questions in their 24-25 sites.

How did we approach this project?

It was clear in schools within Faculty of Science that a large number of questions had been copied between Question Banks over a number of years. Many of these questions were no longer used, but could not be deleted. There was also a number of accessibility issues to resolve as outlined above.

The first task was to assess in each school, with the help of Digital Learning Leads, which modules wanted to use Question Banks going forward and which no longer needed them. In this way we were able to remove question banks on a lot of modules, simply by not copying them over during the 2024 summer rollover. This greatly reduced the number of sites we were working with. After this work was completed it was found that the School of Chemistry only had 34 modules out of over 100 which wanted to continue using Question Banks. The School of Computer Science opted to remove all question banks and instead upload their own new questions each year.

Note: when following the steps outlined below, quizzes will not be copied over and you will need to create new quizzes using the sanitised accessible question bank questions. If you wish to retain your pre-created quizzes, you will need to bulk fix all your errors in Brickfield Accessibility + Toolkit, instead of following the approach outlined in this post.

A screenshot showing the import process on Moodle with the question bank option disabled.

Fig 2. Turn off the option to import the question bank when copying content to the new Moodle module.

The second task involved sanitising question bank sets outside of Moodle, and then reuploading them once accessibility errors had been resolved. To do this we followed a simple process for each module that used a question bank:

  1. Consult the Gradebook on the module site to identify any quizzes that had run in the previous academic year.
  2. Navigate to each quiz and open the ‘Questions’ menu to see all the questions used on that quiz. Use the gear icon on any question to open the settings and from here identify the category to which the question belongs. Repeat for all other quizzes and note down the categories.
  3. Navigate to the main module page and click ‘More…’ and ‘Question Bank’ to open the question bank manager for the module.
  4. From the category dropdown menu, locate each category in your list and use the import/export function to export a ‘Moodle XML’ format of the questions in that category.
  5. Open the XML file in a local code editor on your device, or use Notepad (although this option can be more complicated). Use the Find + Replace menu to locate any troublesome accessibility issues and replace them with the correct formatting e.g. replace <b> and </b> with <strong> and </strong>, replace <i> and </i> with <em> and </em>. Save the XML file.
  6. Navigate to the new module, in this case the 24-25 version and repeat step 4 above but this time importing the question bank which you have just edited locally.
  7. Repeat the above steps for all other modules that require a sanitised and accessible set of question bank questions.

Screenshot showing the use of a code editor to find and replace non-accessible HTML tags in question bank XML files.

Fig 3. Use a code editor to find and replace the HTML tags you want to switch, such as <b> for <strong>.

Conclusion

While I anticipate that this work will only need to be done once to remove any old <b> or <i> tags from our question bank questions, it is very useful to know that there is a workable solution for bulk editing question bank content offline and then re-importing back into Moodle. This process has greatly improved our efficiency in Faculty of Science and meant that we can move ahead quickly with the Moodle rollover for 24-25.

Posted in AccessibilityAssessmentMoodleTeaching and Learning