Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Missing word question importer.

Copyright: 1999 onwards Martin Dougiamas {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 169 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

qformat_missingword:: (2 methods):
  provide_import()
  readquestion()


Class: qformat_missingword  - X-Ref

Missing word question importer.

This Moodle class provides all functions necessary to import and export
one-correct-answer multiple choice questions in this format:

As soon as we begin to explore our body parts as infants
we become students of {=anatomy and physiology ~reflexology
~science ~experiment}, and in a sense we remain students for life.

Each answer is separated with a tilde ~, and the correct answer is
prefixed with an equals sign =

Percentage weights can be included by following the tilde with the
desired percent.  Comments can be included for each choice by following
the comment with a hash mark ("#") and the comment.  Example:

This is {=the best answer#comment on the best answer ~75%a good
answer#comment on the good answer ~a wrong one#comment on the bad answer}

provide_import()   X-Ref
No description

readquestion($lines)   X-Ref
No description