Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

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