You are here

function qformat_blackboard::readquestions in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/question/format/blackboard/format.php \qformat_blackboard::readquestions()

Parses an array of lines into an array of questions, where each item is a question object as defined by readquestion(). Questions are defined as anything between blank lines.

If your format does not use blank lines as a delimiter then you will need to override this method. Even then try to use readquestion for each question

Parameters

array lines array of lines from readdata:

Return value

array array of question objects

Overrides qformat_default::readquestions

File

includes/moodle/question/format/blackboard/format.php, line 60

Class

qformat_blackboard

Code

function readquestions($lines) {

  /// Parses an array of lines into an array of questions,

  /// where each item is a question object as defined by

  /// readquestion().
  $text = implode($lines, " ");
  $xml = xmlize($text, 0);
  $questions = array();
  $this
    ->process_tf($xml, $questions);
  $this
    ->process_mc($xml, $questions);
  $this
    ->process_ma($xml, $questions);
  $this
    ->process_fib($xml, $questions);
  $this
    ->process_matching($xml, $questions);
  $this
    ->process_essay($xml, $questions);
  return $questions;
}