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. 12
      main/tracking/exams.php

@ -68,12 +68,14 @@ 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
$exerciseList = [get_lang('All')]; if (Database::num_rows($result) > 0) {
while ($row = Database::fetch_array($result)) { $exerciseList = [get_lang('All')];
$exerciseList[$row['id']] = $row['title']; while ($row = Database::fetch_array($result)) {
$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;']);

Loading…
Cancel
Save