Tracking: Remove exams selector if only one exam available - loosely refs BT#18555

pull/3823/head
Yannick Warnier 5 years ago
parent 019ab44923
commit 2baeccf1c6
  1. 4
      main/tracking/exams.php

@ -68,13 +68,15 @@ if ($global) {
$sessionCondition $sessionCondition
ORDER BY quiz.title ASC"; ORDER BY quiz.title ASC";
$result = Database::query($sql); $result = Database::query($sql);
// Only show select bar if there is more than one test
if (Database::num_rows($result) > 0) {
$exerciseList = [get_lang('All')]; $exerciseList = [get_lang('All')];
while ($row = Database::fetch_array($result)) { while ($row = Database::fetch_array($result)) {
$exerciseList[$row['id']] = $row['title']; $exerciseList[$row['id']] = $row['title'];
} }
$form->addElement('select', 'exercise_id', get_lang('Exercise'), $exerciseList); $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exerciseList);
} }
}
$form->addButton('filter', get_lang('Filter'), 'filter', 'primary', null, null, ['style' => 'margin-top: 5px; margin-left: 15px;']); $form->addButton('filter', get_lang('Filter'), 'filter', 'primary', null, null, ['style' => 'margin-top: 5px; margin-left: 15px;']);
$filter_score = isset($_REQUEST['score']) ? intval($_REQUEST['score']) : 70; $filter_score = isset($_REQUEST['score']) ? intval($_REQUEST['score']) : 70;

Loading…
Cancel
Save