ソースを参照

Fixing hotspot error see BT#7058

Julio Montoya 11 年 前
コミット
fc77d243ed
1 ファイル変更13 行追加15 行削除
  1. 13 15
      main/exercice/exercise.class.php

+ 13 - 15
main/exercice/exercise.class.php

@@ -2572,23 +2572,21 @@ class Exercise {
                     }
                 case HOT_SPOT :
                     if ($from_database) {
-                        if ($show_result) {
-                            $TBL_TRACK_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
-                            $sql = "SELECT hotspot_correct
-                                    FROM $TBL_TRACK_HOTSPOT
-                                    WHERE
-                                        hotspot_exe_id = '".$exeId."' AND
-                                        hotspot_question_id= '".$questionId."' AND
-                                        hotspot_answer_id = '".Database::escape_string($answerId)."'";
-                            $result = Database::query($sql);
-                            $studentChoice = Database::result($result, 0, "hotspot_correct");
+                        $TBL_TRACK_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
+                        $sql = "SELECT hotspot_correct
+                                FROM $TBL_TRACK_HOTSPOT
+                                WHERE
+                                    hotspot_exe_id = '".$exeId."' AND
+                                    hotspot_question_id= '".$questionId."' AND
+                                    hotspot_answer_id = '".Database::escape_string($answerId)."'";
+                        $result = Database::query($sql);
+                        $studentChoice = Database::result($result, 0, "hotspot_correct");
 
-                            if ($studentChoice) {
-                                $questionScore  += $answerWeighting;
-                                $totalScore     += $answerWeighting;
-                            }
+                        if ($studentChoice) {
+                            $questionScore  += $answerWeighting;
+                            $totalScore     += $answerWeighting;
                         }
-                    }  else {
+                    } else {
                         $studentChoice = $choice[$answerId];
                         if ($studentChoice) {
                             $questionScore  += $answerWeighting;