-
Notifications
You must be signed in to change notification settings - Fork 0
/
analytics.php
38 lines (34 loc) · 926 Bytes
/
analytics.php
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
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Created by PhpStorm.
* User: David
* Date: 17/05/2016
* Time: 20:01
*/
require_once '../../config.php';
require_once($CFG->dirroot.'/rating/lib.php');
/// basic access checks
if($_SERVER['REQUEST_METHOD'] === 'POST') {
$is_comparation = true;
$course_id = $_POST['course_id'];
$type = $_POST['type'];
} else {
$is_comparation = false;
$course_id = $_GET['course_id'];
$type = $_GET['type'];
}
if (!$course = $DB->get_record('course', array('id' => $course_id), '*', MUST_EXIST)) {
print_error('nocourseid');
}if (!$type) {
print_error('notype');
}
$PAGE->set_url('/moodlean/analytics.php', array('id' => $course->id));
require_login($course);
switch($type){
case 'student':
include 'views/student_analytics.php'; break;
case 'group':
include 'views/group_analytics.php'; break;
case 'class':
include 'views/class_analytics.php'; break;
}