Question formats: Microsoft Word File Import/Export (Question Format)

Maintained by Picture of Eoin CampbellEoin Campbell
Import questions (including images and equations) from structured tables in a Word file (.docx format) into a course question bank, and also export questions to a Word file, allowing for round-trip editing.

Microsoft Word File Import/Export (Question Format) 3.6.3 (Build: 2020071101)

Release notes

# Change log

Date Version Comment
2020/07/10 3.6.3 Stop leaving temporary files lying around.
2020/07/10 3.6.2 Add support for Office MML m:deg element, which caused an error.
2020/06/18 3.6.1 Add support for 'No online text' responses and accepted file types.
2019/07/15 3.6.0 Add support for optional ID number field in Moodle 3.6, plus small Missing Word type bug-fixes.
2018/08/03 3.5.23 Clean Moodle question type explanatory text XHTML exported to Word, for more robust operation.
2018/06/04 3.5.22 Support Privacy API for GDPR compliance.
2017/09/02 3.5.21 Fix handling of hints.
2017/08/31 3.5.20 Don't raise the memory limit for XSLT any more, fix roman uppercase numbering import bug.
2017/08/14 3.5.19 Handle list item duplication bug inside adjacent table cells
2017/08/06 3.5.18 Handle Bootstrap Alert components.
2017/05/21 3.5.17 Handle penalty value of 0% on multiple tries.
2017/04/17 3.5.16 Use canonical reference to temp directory, start using PHPStorm IDE.
2017/01/05 3.5.15 Fix error when handling empty table cells.
2016/12/16 3.5.14 Improve RTL language support again.
2016/11/14 3.5.13 Improve localisation by adding more strings for use in Word template, improve RTL language support.
2016/11/05 3.5.12 Fix Hebrew support for True/False question import.
2016/11/02 3.5.11 Replace "
" with "
" in the Moodle text strings used for exporting Word files (for Polish issue).
2016/10/31 3.5.10 Retain table border style, handle WMF images better, support pre-formatted text.
2016/09/09 3.5.9 Strip out OfficeMath revision control markup from Word 2010 files.
2016/09/08 3.5.8 Strip out VML/drawingML markup from Word 2010 files.
2016/06/12 3.5.7 Fix equation problem, improve table handling and Cloze question formatting.
2016/01/14 3.5.6 Add PHPUnit tests for exports, remove debugging.
2016/01/08 3.5.5 Fix incorrect conversion of Cloze text.
2016/01/05 3.5.4 Improve handling of exported images to avoid bookmark name clashes.
2016/01/05 3.5.3 Improve handling of adjacent bold/italic formatting when importing Cloze questions.
2015/12/30 3.5.2 Fix error in Cloze MC/SA subquestion import processing, and '--' in text in export processing.
2015/12/15 3.5.1 Fix error in non-ASCII characters and alignment when exporting questions.
2015/12/14 3.5.0 Support OU question types 'Drag and drop onto image,' 'Drag and drop markers',
'Drag and drop into text' and 'Select missing words',
clean code to pass Travis codechecker.
2015/09/30 3.4.3 Support RTL equations in MathML conversion.
2015/09/24 3.4.2 Minimise empty attributes in Pass 1 of conversion.
2015/09/21 3.4.1 Handle unusual WordML markup (w:dir) in RTL (e.g. Arabic) text.
2015/09/21 3.4.0 Convert Microsoft Equation Editor equations into MathML for display by MathJax.
2015/09/16 3.3.2 Improve code formatting to comply better with Moodle guidelines.
2015/09/16 3.3.1 Support target attribute in hyperlinks to allow links to open in new window.
2015/09/01 3.3.0 Improve reliability of the question exports if question text content is badly formatted.
2015/08/19 3.2.2 Grab extra memory to allow very large Word files to be exported, handle HTML markup in exports better.
2015/08/04 3.2.1 Grab extra memory to allow very large Word files to be imported,
fix Essay and All-or-Nothing question type issues.
2015/08/01 3.2.0 Support All-or-Nothing Multiple Choice import and export.
2015/07/27 3.1.11 Support question export for all built-in question types.
2015/07/25 3.1.10 Support question import in Lessons.
2015/07/17 3.1.9 Minor change to delete old and unused configuration values from config_plugins table.
2015/07/15 3.1.8 Improve export formatting to handle paragraph attributes better (alignment, etc.).
2015/07/13 3.1.7 On import, retain the size of images as defined within Word, and retain text alignment.
2015/07/04 3.1.6 Support the new 'Require text' field added to Essay questions in Moodle 2.9.
2015/07/03 3.1.5 Improve export of far-eastern languages like Chinese and Japanese.
2015/04/02 3.1.4 Fix text direction in non-Arabic Word templates, handle strikethrough better.
2015/03/11 3.1.3 Fix image handling, including external images not embedded in Word file, and hyperlinked images.
2015/03/03 3.1.2 Fix for Moodle 2.7/2.8 to improve handling of attachments in essay questions.
2015/03/03 3.1.1 Fix for Moodle 2.7/2.8 to enable question import, by deleting superfluous namespace attributes.
2015/03/02 3.1.0 Keep original uploaded Word file in debug mode. Fix handling of Cloze questions.
Handle hyperlinks and other character formatting properly, support questions created
in Word language versions other than English, fix Cloze questions.
2015/02/20 3.0.0 Support import of Word 2010 (.docx) documents, remove all question import limits,
and use of an external conversion server.
Also add support for tables and lists inside item components.

2014/10/08 2.10.1 Fix bug in handling of image filenames containing spaces.
2014/08/12 2.10 Support case-sensitivity and selection style and orientation in Cloze SA and MC subquestions.
Support specification of default mark in Cloze questions. Fix merging of paragraphs.
2014/07/10 2.9.2 Fix syntax error in db/install.php.
2014/07/10 2.9.1 Fix error in registration process set-up, which prevented registration to set 10-question limit.

2014/06/17 2.9 Use default username and password for importing Word files to make Registration optional.
Handle named numeric entities (e.g.  ) by converting them to numeric entities
instead (i.e.  ) to avoid XSLT processing errors.

2014/05/12 2.8.5 Handle invalid 'complete="true"' attribute in images, fix loop through all CDATA
sections, keep tr elements when cleaning HTML manually.

2014/05/07 2.8.4 Fix error in image handling in Moodle 1.9, add work-around to cope with XSLT
idiosyncrasies that insert namespace declaration on wrong element, breaking the
Word export facility. Fix mishandling of Hints in Short Answer export.

2014/05/04 2.8.3 Improve image handling to properly export any images used inside feedback text.

2014/05/03 2.8.2 Handle images with names that include spaces or other non-alphanumeric characters.

2014/05/02 2.8.1 CONTRIB-5028: clean up HTML markup better (using strip_tags) if the PHP tidy
extension is not installed.

2014/04/28 2.8 Use the PHP tidy extension to ensure that any HTML inside CDATA sections is well-formed
XHTML, otherwise Word export fails.

2014/02/27 2.7.1 Add Word export support for RTL languages such as Arabic and Hebrew.

2014/02/03 2.7 Add Word export support for languages other than English, using labels in the language
of the users' current interface language selection. Also support new Moodle 2.x
question features such as Hints and Tags.

2014/01/03 2.6 Add support for including any images used in questions exported into a Word file, in a
two-stage process that also requires using a command in the Moodle2Word Word template to
embed the encoded images into the file.

2013/12/20 2.5 Improve handling of CDATA text that includes HTML markup, and the Moodle 1.9 question
textancillary image element.

2013/03/15 2.4 Improve handling of Cloze question formatting when exporting to Word format.
Moodle 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8

Version information

Version build number
Version release name
3.6.3 (Build: 2020071101)
Stable version
MD5 Sum
Supported software
Moodle 3.1, Moodle 3.2, Moodle 3.3, Moodle 3.4, Moodle 3.5, Moodle 3.6, Moodle 3.7, Moodle 3.8
  • This is the latest release for Moodle 3.1
  • This is the latest release for Moodle 3.2
  • This is the latest release for Moodle 3.3
  • This is the latest release for Moodle 3.4
  • This is the latest release for Moodle 3.5
  • This is the latest release for Moodle 3.6
  • This is the latest release for Moodle 3.7
  • This is the latest release for Moodle 3.8

Version control information

Version control system (VCS)
VCS repository URL
VCS tag

Default installation instructions for plugins of the type Question formats

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder (eg "myformat") in the "question/format" subdirectory.
  4. Visit to finish the installation