forked from turnitin/moodle-plagiarism_turnitin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextras.php
84 lines (67 loc) · 2.53 KB
/
extras.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package turnitintooltwo
* @copyright 2012 iParadigms LLC
*/
require_once(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/tablelib.php');
require_once(__DIR__."/lib.php");
require_once($CFG->dirroot."/mod/turnitintooltwo/lib.php");
require_once($CFG->dirroot."/mod/turnitintooltwo/turnitintooltwo_view.class.php");
$turnitintooltwoview = new turnitintooltwo_view();
$cmd = optional_param('cmd', "", PARAM_ALPHAEXT);
$viewcontext = optional_param('view_context', "window", PARAM_ALPHAEXT);
// Initialise variables.
$output = "";
$jsrequired = false;
$cmid = required_param('cmid', PARAM_INT);
$cm = get_coursemodule_from_id('', $cmid);
$context = context_course::instance($cm->course);
$PAGE->set_context(context_system::instance());
require_login();
switch ($cmd) {
case "useragreement":
$PAGE->set_pagelayout('embedded');
$PAGE->requires->jquery();
$PAGE->requires->jquery_plugin('ui');
$PAGE->requires->jquery_plugin('plagiarism-turnitin_module', 'plagiarism_turnitin');
$user = new turnitintooltwo_user($USER->id, "Learner");
$output .= $OUTPUT->box_start('tii_eula_launch');
$output .= turnitintooltwo_view::output_dv_launch_form("useragreement", 0, $user->tii_user_id, "Learner", '');
$output .= $OUTPUT->box_end(true);
echo $output;
echo html_writer::script("<!--
window.document.forms[0].submit();
//-->");
exit;
break;
}
// Build page.
echo $turnitintooltwoview->output_header(null,
null,
$_SERVER["REQUEST_URI"],
'',
'',
array(),
"",
"",
true,
'',
'');
echo html_writer::tag("div", $viewcontext, array("id" => "tii_view_context"));
echo $output;
echo $OUTPUT->footer();