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

improve navigation for exam mode, fixes #82

parent 391b0238
No related branches found
No related tags found
No related merge requests found
...@@ -127,19 +127,20 @@ class VipsPlugin extends StudIPPlugin implements StandardPlugin, SystemPlugin, P ...@@ -127,19 +127,20 @@ class VipsPlugin extends StudIPPlugin implements StandardPlugin, SystemPlugin, P
$course_id = Context::getId(); $course_id = Context::getId();
// redirect page calls if necessary // redirect page calls if necessary
if ($page !== 'plugins.php' || strpos($path_info, '/vipsplugin/exam_mode') !== 0) { if (isset($course_id) && in_array($course_id, array_keys($courses))) {
// course with running exam is selected // course with running exam is selected, allow all exam actions
if (isset($course_id) && in_array($course_id, array_keys($courses))) { if ($page !== 'plugins.php' || strpos($path_info, '/vipsplugin/sheets') !== 0) {
// allow all exam actions header('Location: ' . $this->url_for('sheets'));
if ($page !== 'plugins.php' || strpos($path_info, '/vipsplugin/sheets') !== 0) {
header('Location: ' . $this->url_for('sheets'));
die();
}
} else {
// forward to overview of all running courses with exams
header('Location: ' . $this->url_for('exam_mode'));
die(); die();
} }
} else if (count($courses) == 1) {
// only one course with running exam, redirect there
header('Location: ' . $this->url_for('sheets', ['cid' => key($courses)]));
die();
} else if ($page !== 'plugins.php' || strpos($path_info, '/vipsplugin/exam_mode') !== 0) {
// forward to overview of all running courses with exams
header('Location: ' . $this->url_for('exam_mode'));
die();
} }
} }
} }
...@@ -178,6 +179,7 @@ class VipsPlugin extends StudIPPlugin implements StandardPlugin, SystemPlugin, P ...@@ -178,6 +179,7 @@ class VipsPlugin extends StudIPPlugin implements StandardPlugin, SystemPlugin, P
$navigation->addSubNavigation('links', $links); $navigation->addSubNavigation('links', $links);
Config::get()->PERSONAL_NOTIFICATIONS_ACTIVATED = 0; Config::get()->PERSONAL_NOTIFICATIONS_ACTIVATED = 0;
PageLayout::addStyle('#layout_wrapper #flex-header, #tabs { display: none; }');
PageLayout::addCustomQuicksearch('<div style="width: 64px;"></div>'); PageLayout::addCustomQuicksearch('<div style="width: 64px;"></div>');
Navigation::setRootNavigation($navigation); Navigation::setRootNavigation($navigation);
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</td> </td>
<td> <td>
<a href="<?= URLHelper::getLink($nav->getURL(), ['cid' => $course_id]) ?>"> <a href="<?= URLHelper::getLink($nav->getURL(), ['cid' => $course_id]) ?>">
<?= $nav->getImageTag() ?> <?= $nav->getImage()->asImg(20, $nav->getLinkAttributes()) ?>
</a> </a>
</td> </td>
</tr> </tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment