Skip to content
Permalink
Browse files

If random show also the total of questions see BT#15535

  • Loading branch information...
jmontoyaa committed Apr 11, 2019
1 parent 5979f12 commit f2b8f7336fa34de53843d035d538f6e2af06bc4d
Showing with 3 additions and 3 deletions.
  1. +3 −3 main/exercise/exercise.php
@@ -807,7 +807,7 @@
$sql = "SELECT count(*) count FROM $TBL_EXERCISE_QUESTION
WHERE c_id = $courseId AND exercice_id = $my_exercise_id";
$sqlresult = Database::query($sql);
$rowi = intval(Database :: result($sqlresult, 0, 0));
$rowi = (int) Database::result($sqlresult, 0, 0);
if ($sessionId == $row['session_id']) {
$actions = '';
@@ -1079,8 +1079,8 @@
$number_of_questions .= min(TestCategory::getNumberMaxQuestionByCat($my_exercise_id), $random_number_of_question).' '.get_lang('QuestionByCategory');
} else {
$random_label = ' ('.get_lang('Random').') ';
$number_of_questions = $random_number_of_question.' '.$random_label;
//Bug if we set a random value bigger than the real number of questions
$number_of_questions = $random_number_of_question.' '.$random_label.' / '.$rowi;
// Bug if we set a random value bigger than the real number of questions
if ($random_number_of_question > $rowi) {
$number_of_questions = $rowi.' '.$random_label;
}

0 comments on commit f2b8f73

Please sign in to comment.
You can’t perform that action at this time.