-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
143 lines (118 loc) · 6.44 KB
/
Copy pathsettings.php
File metadata and controls
143 lines (118 loc) · 6.44 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
// This file is part of mod_offlinequiz 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/>.
/**
* Administration settings definitions for the offlinequiz module.
*
* @package mod
* @subpackage offlinequiz
* @author Juergen Zimmer <zimmerj7@univie.ac.at>
* @copyright 2015 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org}
* @since Moodle 2.2+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/mod/offlinequiz/lib.php');
require_once($CFG->dirroot.'/mod/offlinequiz/settingslib.php');
// Introductory explanation that all the settings are defaults for the add offlinequiz form.
$settings->add(new admin_setting_heading('offlinequizintro', '', get_string('configintro', 'offlinequiz')));
// User identification.
$settings->add(new admin_setting_configtext_user_formula('offlinequiz/useridentification',
get_string('useridentification', 'offlinequiz'), get_string('configuseridentification', 'offlinequiz'),
'[7]=idnumber' , PARAM_RAW, 30));
// Print study code field.
$settings->add(new admin_setting_configcheckbox('offlinequiz/printstudycodefield',
get_string('printstudycodefield', 'offlinequiz'), get_string('printstudycodefield_help', 'offlinequiz'),
1));
// Shuffle questions.
$settings->add(new admin_setting_configcheckbox('offlinequiz/shufflequestions',
get_string('shufflequestions', 'offlinequiz'), get_string('configshufflequestions', 'offlinequiz'),
0));
// Shuffle within questions.
$settings->add(new admin_setting_configcheckbox('offlinequiz/shuffleanswers',
get_string('shufflewithin', 'offlinequiz'), get_string('configshufflewithin', 'offlinequiz'),
1));
// Logo image URL setting.
$settings->add(new admin_setting_configtext('offlinequiz/logourl', get_string('logourl', 'offlinequiz'),
get_string('logourldesc', 'offlinequiz'), '', PARAM_URL));
// Admin setting to disable display of copyright statement.
$settings->add(new admin_setting_configcheckbox('offlinequiz/showcopyright', get_string('showcopyright', 'offlinequiz'),
get_string('showcopyrightdesc', 'offlinequiz'), 1));
// Disable newlines around images.
$settings->add(new admin_setting_configcheckbox('offlinequiz/disableimgnewlines',
get_string('disableimgnewlines', 'offlinequiz'), get_string('configdisableimgnewlines', 'offlinequiz'),
0));
// Review options.
$settings->add(new admin_setting_heading('reviewheading',
get_string('reviewoptionsheading', 'offlinequiz'), ''));
foreach (mod_offlinequiz_admin_review_setting::fields() as $field => $name) {
$default = mod_offlinequiz_admin_review_setting::all_on();
$forceduring = null;
if ($field == 'attempt') {
$forceduring = true;
} else if ($field == 'overallfeedback') {
$default = $default ^ mod_offlinequiz_admin_review_setting::DURING;
$forceduring = false;
}
$settings->add(new mod_offlinequiz_admin_review_setting('offlinequiz/review' . $field,
$name, '', $default, $forceduring));
}
// Decimal places for overall grades.
$settings->add(new admin_setting_heading('gradingheading',
get_string('gradingoptionsheading', 'offlinequiz'), ''));
$options = array();
for ($i = 0; $i <= 3; $i++) {
$options[$i] = $i;
}
$settings->add(new admin_setting_configselect('offlinequiz/decimalpoints',
get_string('decimalplaces', 'offlinequiz'), get_string('configdecimalplaces', 'offlinequiz'),
2, $options));
$settings->add(new admin_setting_heading('scanningheading',
get_string('scanningoptionsheading', 'offlinequiz'), ''));
$options = array();
$options[610] = get_string("darkgray", "offlinequiz");
$options[640] = get_string("lightgray", "offlinequiz");
$options[670] = get_string("standard", "offlinequiz");
$options[680] = get_string("white", "offlinequiz");
$options[700] = get_string("pearlywhite", "offlinequiz");
$settings->add(new admin_setting_configselect('offlinequiz/papergray', get_string('papergray', 'offlinequiz'),
get_string('configpapergray', 'offlinequiz'), 670, $options));
$settings->add(new admin_setting_heading('correctionheading',
get_string('correctionoptionsheading', 'offlinequiz'), ''));
// Admin setting to allow teachers to enrol users with one click while correcting answer forms.
$settings->add(new admin_setting_configcheckbox('offlinequiz/oneclickenrol', get_string('oneclickenrol', 'offlinequiz'),
get_string('oneclickenroldesc', 'offlinequiz'), 0));
$studentroles = $DB->get_records('role', array('archetype' => 'student'), 'sortorder');
$options = array();
$default = null;
foreach ($studentroles as $role) {
if ($role->name) {
$name = $role->name;
} else {
$name = $role->shortname;
}
$options[$role->id] = $name;
if (!$default) {
$default = $role->id;
}
}
$settings->add(new admin_setting_configselect('offlinequiz/oneclickrole', get_string('oneclickrole', 'offlinequiz'),
get_string('oneclickroledesc', 'offlinequiz'), $default, $options));
$settings->add(new admin_setting_configtext('offlinequiz/keepfilesfordays', get_string('keepfilesfordays', 'offlinequiz'),
get_string('configkeepfilesfordays', 'offlinequiz'), 8, PARAM_INT));
$settings->add(new admin_setting_configcheckbox('offlinequiz/experimentalevaluation', get_string('configexperimentalevaluation','offlinequiz'),
get_string('configexperimentalevaluationdesc','offlinequiz'), 0));
}