4772: During import, matching answers are not imported correctly into the db. This...
authorharris wong <hwong@ocad.ca>
Thu, 25 Aug 2011 17:31:36 +0000 (17:31 -0000)
committerharris wong <hwong@ocad.ca>
Thu, 25 Aug 2011 17:31:36 +0000 (17:31 -0000)
docs/mods/_core/imsqti/classes/QTIParser.class.php

index 318a556..f69c7ac 100644 (file)
@@ -248,8 +248,9 @@ class QTIParser {
 
                                //closing this tag means a selection of choices have ended.  Assign the correct answer in this case.
                                $tv = $this->temp_answer[$this->attributes[$this->item_num]['varequal']['respident']];
-//                             debug($tv, 'harris'.$this->item_num);
-//                             debug($this->answers_for_matching[$this->item_num], 'answers');
+                               //debug($tv, 'harris'.$this->item_num);
+                //debug($this->choices[$this->item_num], 'choices');
+                               //debug($this->answers_for_matching[$this->item_num], 'answers');
 
                                //If matching, then attribute = 'Respondus_correct'; otherwise it is 'que_score'
                                if ($this->getQuestionType($this->item_num) == 5){
@@ -285,7 +286,7 @@ class QTIParser {
                                                        $this->answers_for_matching[$this->item_num] = array();
                                                }                                                       
 //                                                     if (!in_array($tv['name'][$val_id], $this->answers_for_matching[$this->item_num])){
-                                                       array_push($this->answers_for_matching[$this->item_num], $tv['name'][$pos]);
+                                                       array_push($this->answers_for_matching[$this->item_num], $tv['name'][$this->item_num]);
                                                        
                                                        //add mark
                                                        $this->weights[$this->item_num] += floatval($current_answer);