diff --git a/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php b/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php
index 0033c9bf42..0b73fbb946 100644
--- a/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php
+++ b/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php
@@ -501,12 +501,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
}
// get the max height of item to have each table the same height if displayed side by side
- $testCategory = new TestCategory();
foreach ($scoreList as $categoryId => $scoreListForCategory) {
- $category = $testCategory->getCategory($categoryId);
- if ($category) {
- $categoryQuestionName = $category->name;
- }
[$noValue, $height] = self::displayDegreeChartChildren(
$scoreListForCategory,
300,
@@ -522,12 +517,6 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
}
}
- if (count($scoreList) > 1) {
- $boxWidth = $sizeRatio * 300 * 2 + 54;
- } else {
- $boxWidth = $sizeRatio * 300 + 54;
- }
-
$html = '
';
$html .= '
'.$title.'
';
diff --git a/public/main/exercise/TestCategory.php b/public/main/exercise/TestCategory.php
index 47a188bd52..5320d7bc49 100644
--- a/public/main/exercise/TestCategory.php
+++ b/public/main/exercise/TestCategory.php
@@ -44,7 +44,7 @@ class TestCategory
$id = (int) $id;
$courseId = empty($courseId) ? api_get_course_int_id() : (int) $courseId;
$sql = "SELECT * FROM $table
- WHERE iid = $id AND c_id = ".$courseId;
+ WHERE iid = $id";
$res = Database::query($sql);
if (Database::num_rows($res)) {
diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php
index e823413997..b1afec2388 100644
--- a/public/main/exercise/exercise.class.php
+++ b/public/main/exercise/exercise.class.php
@@ -3768,17 +3768,16 @@ class Exercise
$choice = [];
$choiceDegreeCertainty = [];
$sql = "SELECT answer
- FROM $TBL_TRACK_ATTEMPT
- WHERE
- exe_id = $exeId AND question_id = $questionId";
+ FROM $TBL_TRACK_ATTEMPT
+ WHERE exe_id = $exeId AND question_id = $questionId";
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
$ind = $row['answer'];
$values = explode(':', $ind);
- $myAnswerId = $values[0];
- $option = $values[1];
- $percent = $values[2];
+ $myAnswerId = $values[0] ?? null;
+ $option = $values[1] ?? null;
+ $percent = $values[2] ?? null;
$choice[$myAnswerId] = $option;
$choiceDegreeCertainty[$myAnswerId] = $percent;
}
diff --git a/public/main/exercise/exercise_show.php b/public/main/exercise/exercise_show.php
index 1382c949b2..574601aabb 100644
--- a/public/main/exercise/exercise_show.php
+++ b/public/main/exercise/exercise_show.php
@@ -337,13 +337,11 @@ $sql = "SELECT attempts.question_id, answer
ON stats_exercises.exe_id = attempts.exe_id
INNER JOIN $TBL_EXERCISE_QUESTION AS quizz_rel_questions
ON
- quizz_rel_questions.quiz_id=stats_exercises.exe_exo_id AND
- quizz_rel_questions.question_id = attempts.question_id AND
- quizz_rel_questions.c_id=".api_get_course_int_id()."
+ quizz_rel_questions.quiz_id = stats_exercises.exe_exo_id AND
+ quizz_rel_questions.question_id = attempts.question_id
INNER JOIN $TBL_QUESTIONS AS questions
ON
- questions.iid = quizz_rel_questions.question_id AND
- questions.c_id = ".api_get_course_int_id()."
+ questions.iid = quizz_rel_questions.question_id
WHERE
attempts.exe_id = $id $user_restriction
GROUP BY quizz_rel_questions.question_order, attempts.question_id";