forked from danmarsden/moodle-plagiarism_new
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptout.php
More file actions
54 lines (46 loc) · 1.82 KB
/
optout.php
File metadata and controls
54 lines (46 loc) · 1.82 KB
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
<?php
// This file is part of the Plagscan plugin for 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/>.
/**
* Allows students to opt-out of plagiarism detection
*
* @package plagiarism_plagscan
* @author Davo Smith
* @copyright @2012 Synergy Learning
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require(__DIR__ . '/../../config.php');
$optout = required_param('optout', PARAM_BOOL);
$cmid = required_param('cmid', PARAM_INT);
$return = $CFG->wwwroot . '/mod/assign/view.php?id=' . $cmid . '&action=editsubmission';
$PAGE->set_url($return);
if ($CFG->version < 2011120100) {
$context = get_context_instance(CONTEXT_SYSTEM);
} else {
$context = context_system::instance();
}
$PAGE->set_context($context);
require_login();
require_sesskey();
set_user_preference('plagiarism_mcopyfind_optout', $optout);
$PAGE->set_title(get_string('pluginname', 'plagiarism_mcopyfind'));
if ($optout) {
$PAGE->set_heading(get_string('optout', 'plagiarism_mcopyfind'));
$msg = get_string('optout_explanation', 'plagiarism_mcopyfind');
} else {
$PAGE->set_heading(get_string('optin', 'plagiarism_mcopyfind'));
$msg = get_string('optin_explanation', 'plagiarism_mcopyfind');
}
redirect($return, $msg);