-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.php
129 lines (122 loc) · 5.2 KB
/
settings.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?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/>.
require_once(dirname(dirname(__FILE__)).'/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/plagiarismlib.php');
require_once($CFG->dirroot.'/plagiarism/vericite/lib.php');
require_once($CFG->dirroot.'/plagiarism/vericite/plagiarism_form.php');
require_login();
admin_externalpage_setup('plagiarismvericite');
$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
require_once('plagiarism_form.php');
$mform = new plagiarism_setup_form();
$plagiarismplugin = new plagiarism_plugin_vericite();
if ($mform->is_cancelled()) {
redirect('');
}
echo $OUTPUT->header();
if (($data = $mform->get_data()) && confirm_sesskey()) {
// Set checkboxes to 0 if they aren't set.
if (!isset($data->vericite_use)) {
$data->vericite_use = 0;
}
if (!isset($data->vericite_disable_dynamic_inline)) {
$data->vericite_disable_dynamic_inline = 0;
}
if (!isset($data->vericite_enable_debugging)) {
$data->vericite_enable_debugging = 0;
}
if (!isset($data->vericite_use_default)) {
$data->vericite_use_default = 0;
}
if (!isset($data->vericite_preliminary_report)) {
$data->vericite_preliminary_report = 0;
}
if (!isset($data->vericite_student_score_default)) {
$data->vericite_student_score_default = 0;
}
if (!isset($data->vericite_student_report_default)) {
$data->vericite_student_report_default = 0;
}
if (!isset($data->vericite_exclude_quotes_default)) {
$data->vericite_exclude_quotes_default = 0;
}
if (!isset($data->vericite_exclude_quotes_default_hideinstructor)) {
$data->vericite_exclude_quotes_default_hideinstructor = 0;
}
if (!isset($data->vericite_exclude_self_plag_default)) {
$data->vericite_exclude_self_plag_default = 0;
}
if (!isset($data->vericite_exclude_self_plag_default_hideinstructor)) {
$data->vericite_exclude_self_plag_default_hideinstructor = 0;
}
if (!isset($data->vericite_store_inst_index_default)) {
$data->vericite_store_inst_index_default = 0;
}
if (!isset($data->vericite_store_inst_index_default_hideinstructor)) {
$data->vericite_store_inst_index_default_hideinstructor = 0;
}
if (!isset($data->vericite_enabled_student_preview_default)) {
$data->vericite_enabled_student_preview_default = 0;
}
if (!isset($data->vericite_enabled_student_preview_default_hideinstructor)) {
$data->vericite_enabled_student_preview_default_hideinstructor = 0;
}
if (!isset($data->vericite_student_score_default_forums)) {
$data->vericite_student_score_default_forums = 0;
}
if (!isset($data->vericite_student_report_default_forums)) {
$data->vericite_student_report_default_forums = 0;
}
if (!isset($data->vericite_exclude_quotes_default_forums)) {
$data->vericite_exclude_quotes_default_forums = 0;
}
if (!isset($data->vericite_exclude_quotes_default_forums_hideinstructor)) {
$data->vericite_exclude_quotes_default_forums_hideinstructor = 0;
}
if (!isset($data->vericite_exclude_self_plag_default_forums)) {
$data->vericite_exclude_self_plag_default_forums = 0;
}
if (!isset($data->vericite_exclude_self_plag_default_forums_hideinstructor)) {
$data->vericite_exclude_self_plag_default_forums_hideinstructor = 0;
}
if (!isset($data->vericite_store_inst_index_default_forums)) {
$data->vericite_store_inst_index_default_forums = 0;
}
if (!isset($data->vericite_store_inst_index_default_forums_hideinstructor)) {
$data->vericite_store_inst_index_default_forums_hideinstructor = 0;
}
if (!isset($data->vericite_enabled_student_preview_default_forums)) {
$data->vericite_enabled_student_preview_default_forums = 0;
}
if (!isset($data->vericite_enabled_student_preview_default_forums_hideinstructor)) {
$data->vericite_enabled_student_preview_default_forums_hideinstructor = 0;
}
// Save each setting.
foreach ($data as $field => $value) {
if (strpos($field, 'vericite') === 0) {
set_config($field, $value, 'plagiarism');
}
}
$OUTPUT->notification(get_string('savedconfigsuccess', 'plagiarism_vericite'), \core\output\notification::NOTIFY_SUCCESS);
}
$plagiarismsettings = (array)get_config('plagiarism');
$mform->set_data($plagiarismsettings);
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
$mform->display();
echo $OUTPUT->box_end();
echo $OUTPUT->footer();