-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.php
More file actions
29 lines (22 loc) · 957 Bytes
/
report.php
File metadata and controls
29 lines (22 loc) · 957 Bytes
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
<?php // $Id:,v 2.0 2012/05/20 16:10:00 Serafim Panov
require_once("../../config.php");
require_once("lib.php");
$b = optional_param('b', 0, PARAM_INT);
if (!empty($b)) {
if ($data = $DB->get_records("reader_attempts", array("quizid" => $b))) {
if ($datapub = $DB->get_record("reader_publisher", array("id" => $b))) {
$quizid = $datapub->quizid;
}
while(list($key,$value)=each($data)){
reader_put_to_quiz_attempt($value->id);
}
}
}
if (!empty($quizid)) {
if ($cm = get_coursemodule_from_instance("quiz", $quizid)) {
$site_url = new moodle_url('/mod/quiz/report.php', array("id" => $cm->id, "mode" => "responses"));
echo html_writer::script("top.location.href='{$site_url}'");
}
} else {
echo html_writer::tag('h1', 'No attempts found');
}