Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Blackboard V5 and V6 question importer.

Copyright: 2005 Michael Penney
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 914 lines (40 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: qformat_blackboard_six_qti  - X-Ref

Blackboard 6.0 question importer.

readquestions($text)   X-Ref
Parse the xml document into an array of questions
this *could* burn memory - but it won't happen that much
so fingers crossed!

param: array $text array of lines from the input file.
return: array (of objects) questions objects.

create_raw_question($quest)   X-Ref
Creates a cleaner object to deal with for processing into Moodle.
The object returned is NOT a moodle question object.

param: array $quest XML <item> question  data
return: object rawquestion

process_block($curblock, $block)   X-Ref
Helper function to process an XML block into an object.
Can call himself recursively if necessary to parse this branch of the XML tree.

param: array $curblock XML block to parse
param: object $block block already parsed so far
return: object $block parsed

process_choices($bbchoices, &$choices)   X-Ref
Preprocess XML blocks containing data for questions' choices.
Called by {@link create_raw_question()}
for matching, multichoice and fill in the blank questions.

param: array $bbchoices XML block to parse
param: array $choices array of choices suitable for a rawquestion.

process_matching_responses($bbresponses, &$responses)   X-Ref
Preprocess XML blocks containing data for subanswers
Called by {@link create_raw_question()}
for matching questions only.

param: array $bbresponses XML block to parse
param: array $responses array of responses suitable for a matching rawquestion.

process_responses($bbresponses, &$responses)   X-Ref
Preprocess XML blocks containing data for responses processing.
Called by {@link create_raw_question()}
for all questions types.

param: array $bbresponses XML block to parse
param: array $responses array of responses suitable for a rawquestion.

process_feedback($feedbackset, &$feedbacks)   X-Ref
Preprocess XML blocks containing data for responses feedbacks.
Called by {@link create_raw_question()}
for all questions types.

param: array $feedbackset XML block to parse
param: array $feedbacks array of feedbacks suitable for a rawquestion.

process_common($quest)   X-Ref
Create common parts of question

param: object $quest rawquestion
return: object Moodle question.

process_tf($quest, &$questions)   X-Ref
Process True / False Questions
Parse a truefalse rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done

process_fblank($quest, &$questions)   X-Ref
Process Fill in the Blank Questions
Parse a fillintheblank rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done.

process_mc($quest, &$questions)   X-Ref
Process Multichoice Questions
Parse a multichoice single answer rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done.

process_ma($quest, &$questions)   X-Ref
Process Multiple Choice Questions With Multiple Answers.
Parse a multichoice multianswer rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done.

process_essay($quest, &$questions)   X-Ref
Process Essay Questions
Parse an essay rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done.

process_matching($quest, &$questions)   X-Ref
Process Matching Questions
Parse a matching rawquestion and add the result
to the array of questions already parsed.

param: object $quest rawquestion
param: array $questions array of Moodle questions already done.

process_category($xml, &$questions)   X-Ref
Add a category question entry based on the assessment title

param: array $xml the xml tree
param: array $questions the questions already parsed

strip_applet_tags_get_mathml($string)   X-Ref
Strip the applet tag used by Blackboard to render mathml formulas,
keeping the mathml tag.

param: string $string
return: string