]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10380:
authorthepurpleblob <thepurpleblob>
Wed, 11 Jul 2007 13:57:59 +0000 (13:57 +0000)
committerthepurpleblob <thepurpleblob>
Wed, 11 Jul 2007 13:57:59 +0000 (13:57 +0000)
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.

question/format/blackboard_6/format.php

index 779282518c2bad86d2de23bb499da0511ce356df..bdf4e298df2398bf5cdef19cd85ef82f1c1c08cf 100644 (file)
@@ -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);