Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

Aiken format question importer.

Copyright: 2003 Tom Robb <tom@robb.net>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 206 lines (8 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class

qformat_aiken:: (8 methods):
  provide_import()
  provide_export()
  validate_file()
  readquestions()
  text_field()
  readquestion()
  exportpreprocess()
  writequestion()


Class: qformat_aiken  - X-Ref

Aiken format - a simple format for creating multiple choice questions (with
only one correct choice, and no feedback).

The format looks like this:

Question text
A) Choice #1
B) Choice #2
C) Choice #3
D) Choice #4
ANSWER: B

That is,
+ question text all one one line.
+ then a number of choices, one to a line. Each line must comprise a letter,
then ')' or '.', then a space, then the choice text.
+ Then a line of the form 'ANSWER: X' to indicate the correct answer.

Be sure to word "All of the above" type choices like "All of these" in
case choices are being shuffled.

provide_import()   X-Ref
No description

provide_export()   X-Ref
No description

validate_file(stored_file $file)   X-Ref
No description

readquestions($lines)   X-Ref
No description

text_field($text)   X-Ref
No description

readquestion($lines)   X-Ref
No description

exportpreprocess()   X-Ref
No description

writequestion($question)   X-Ref
No description