Minor: improved return value to be able to manage errors more gracefully in exercises results

skala
Yannick Warnier 12 years ago
parent d48cef6291
commit 0aa989490b
  1. 3
      main/exercice/exercise.class.php
  2. 5
      main/exercice/exercise.lib.php
  3. 2
      main/exercice/question.class.php

@ -1935,6 +1935,9 @@ class Exercise {
// Creates a temporary Question object
$course_id = api_get_course_int_id();
$objQuestionTmp = Question::read($questionId, $course_id);
if ($objQuestionTmp === false) {
return false;
}
$questionName = $objQuestionTmp->selectTitle();
$questionWeighting = $objQuestionTmp->selectWeighting();

@ -2137,6 +2137,9 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu
// We're inside *one* question. Go through each possible answer for this question
$result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null, 'exercise_result', array(), $save_user_result, true, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result);
if (empty($result)) {
continue;
}
$total_score += $result['score'];
$total_weight += $result['weight'];
@ -2289,4 +2292,4 @@ function get_question_ribbon($objExercise, $score, $weight, $check_pass_percenta
$ribbon .= '</div>';
return $ribbon;
}
}

@ -1602,4 +1602,4 @@ abstract class Question
}
return $html;
}
}
}

Loading…
Cancel
Save