From: thepurpleblob Date: Wed, 11 Jul 2007 13:57:59 +0000 (+0000) Subject: MDL-10380: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1d1e8f2bab6c317cc77a1148100b8ec29f9b43a6;p=moodle.git MDL-10380: Modified check for existence of renderedmatch plugin so that it sees it properly. Bodged weird parameter passing issue so that correct answer choices are found. --- diff --git a/question/format/blackboard_6/format.php b/question/format/blackboard_6/format.php index 779282518c..bdf4e298df 100644 --- a/question/format/blackboard_6/format.php +++ b/question/format/blackboard_6/format.php @@ -321,9 +321,12 @@ function create_raw_question($quest) { break; case 'RIGHT_MATCH_BLOCK': $matching_answerset = $pblock['#']['flow']; + $answerset = array(); foreach($matching_answerset as $answer) { - $this->process_block($answer, $bb_answer); + // $answerset[] = $this->process_block($answer, $bb_answer); + $bb_answer = null; + $bb_answer->text = $answer['#']['flow'][0]['#']['material'][0]['#']['mat_extension'][0]['#']['mat_formattedtext'][0]['#']; $answerset[] = $bb_answer; } $block->matching_answerset = $answerset; @@ -804,10 +807,13 @@ function process_essay($quest, &$questions) { // Process Matching Questions //---------------------------------------- function process_matching($quest, &$questions) { - if (defined("RENDEREDMATCH")) { + global $QTYPES; + + // renderedmatch is an optional plugin, so we need to check if it is defined + if (!empty($QTYPES['renderedmatch'])) { $question = $this->defaultquestion($this->defaultquestion()); $question->valid = true; - $question->qtype = RENDEREDMATCH; + $question->qtype = 'renderedmatch'; $question->defaultgrade = 1; $question->questiontext = addslashes($quest->QUESTION_BLOCK->text); $question->name = shorten_text($question->questiontext, 250);