Skip to content
Snippets Groups Projects
Commit 04c153a0 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

don't trigger exam mode when vips is hidden, fixes #205

parent 919c0f51
No related branches found
No related tags found
No related merge requests found
...@@ -310,8 +310,9 @@ function get_courses_with_running_exams($user_id) ...@@ -310,8 +310,9 @@ function get_courses_with_running_exams($user_id)
foreach ($stmt as $row) { foreach ($stmt as $row) {
$assignment = VipsAssignment::find($row['id']); $assignment = VipsAssignment::find($row['id']);
$ip_range = $assignment->options['ip_range']; $ip_range = $assignment->options['ip_range'];
$settings = CourseConfig::get($row['Seminar_id']);
if ($assignment->isVisible($user_id)) { if ($assignment->isVisible($user_id) && $settings->VIPS_TAB_VISIBLE) {
if (strlen($ip_range) > 0 && $assignment->checkIPAccess($_SERVER['REMOTE_ADDR'])) { if (strlen($ip_range) > 0 && $assignment->checkIPAccess($_SERVER['REMOTE_ADDR'])) {
$courses[$row['Seminar_id']] = $row['Name']; $courses[$row['Seminar_id']] = $row['Name'];
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<tbody> <tbody>
<? foreach ($courses as $course_id => $course_name) : ?> <? foreach ($courses as $course_id => $course_name) : ?>
<? $nav = VipsPlugin::$instance->getIconNavigation($course_id, null, null) ?> <? $nav = VipsPlugin::$instance->getIconNavigation($course_id, null, null) ?>
<? if ($nav): ?>
<tr> <tr>
<td> <td>
<?= CourseAvatar::getAvatar($course_id)->getImageTag(Avatar::SMALL) ?> <?= CourseAvatar::getAvatar($course_id)->getImageTag(Avatar::SMALL) ?>
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
</a> </a>
</td> </td>
</tr> </tr>
<? endif ?>
<? endforeach ?> <? endforeach ?>
</tbody> </tbody>
</table> </table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment