aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/course/gradebook/overview.php
blob: e017226c8d80e90bac62ea2833b361e51d836161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

require_once __DIR__.'/template_helpers.php';

/**
 * @SuppressWarnings(PHPMD.CamelCaseClassName)
 */
class Course_Gradebook_OverviewController extends AuthenticatedController
{
    use GradebookTemplateHelpers;

    /**
     * @SuppressWarnings(PHPMD.CamelCaseMethodName)
     */
    public function index_action()
    {
        if ($this->viewerIsStudent()) {
            $route = 'course/gradebook/students';
        } elseif ($this->viewerIsLecturer()) {
            $route = 'course/gradebook/lecturers';
        } else {
            throw new AccessDeniedException();
        }

        $this->redirect($route);
    }
}