Esempio n. 1
0
     }
 }
 // Number of questions
 $random_label = null;
 if ($row['random'] > 0 || $row['random'] == -1) {
     // if random == -1 means use random questions with all questions
     $random_number_of_question = $row['random'];
     if ($random_number_of_question == -1) {
         $random_number_of_question = $rowi;
     }
     if ($row['random_by_category'] > 0) {
         $nbQuestionsTotal = Testcategory::getNumberOfQuestionRandomByCategory($my_exercise_id, $random_number_of_question);
         $number_of_questions = $nbQuestionsTotal . " ";
         $number_of_questions .= $nbQuestionsTotal > 1 ? get_lang("QuestionsLowerCase") : get_lang("QuestionLowerCase");
         $number_of_questions .= " - ";
         $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
         if ($random_number_of_question > $rowi) {
             $number_of_questions = $rowi . ' ' . $random_label;
         }
     }
 } else {
     $number_of_questions = $rowi;
 }
 //Attempts
 //$attempts = get_count_exam_results($row['id']).' '.get_lang('Attempts');
 //$item .=  Display::tag('td',$attempts);
 $item .= Display::tag('td align="center"', $number_of_questions);