-
Notifications
You must be signed in to change notification settings - Fork 8
/
settings.php
120 lines (107 loc) · 5.9 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
<?php
// This file is part of mod_checkmark for Moodle - http://moodle.org/
//
// It 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.
//
// It 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/>.
/**
* settings.php contains admin-Settings for checkmark
*
* @package mod_checkmark
* @author Philipp Hager
* @copyright 2014 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configtext('checkmark/stdexamplecount',
get_string('strstdexamplecount', 'checkmark'),
get_string('strstdexamplecountdesc', 'checkmark'),
'10'));
$settings->add(new admin_setting_configtext('checkmark/stdexamplestart',
get_string('strstdexamplestart', 'checkmark'),
get_string('strstdexamplestartdesc', 'checkmark'),
'1'));
/*
* TODO tscpr: instead of having the default values hardcoded, you can "calculate" them with
* the delimiter set in the checkmark class.. just in case :)
*/
$settings->add(new admin_setting_configtext('checkmark/stdnames',
get_string('strstdnames', 'checkmark'),
get_string('strstdnamesdesc', 'checkmark'),
'a,b,c,d,e,f'));
$settings->add(new admin_setting_configtext('checkmark/stdgrades',
get_string('strstdgrades', 'checkmark'),
get_string('strstdgradesdesc', 'checkmark'),
'10,10,20,20,20,20'));
$settings->add(new admin_setting_configtext('checkmark/validmsgtime',
get_string('strvalidmsgtime', 'checkmark'),
get_string('strvalidmsgtimedesc', 'checkmark'),
'2'));
$settings->add(new admin_setting_configcheckbox('checkmark/showrecentsubmissions',
get_string('showrecentsubmissions', 'checkmark'),
get_string('configshowrecentsubmissions', 'checkmark'), 0));
// Determines the amount of examples in a checkmark instance over which a export warning will be displayed!
/* Trial'n'error determined maximum amount of standard examples without other columns: 48,
* so we should have some place left for everything else!*/
$options = array(0 => get_string('cfg_nowarning', 'checkmark')) + array_combine(range(10, 50, 1), range(10, 50, 1));
$settings->add(new admin_setting_configselect('checkmark/pdfexampleswarning',
get_string('cfg_pdfexampleswarning', 'checkmark'),
get_string('cfg_pdfexampleswarning_desc', 'checkmark'),
25,
$options));
/*
* Default settings for availability
*/
$name = get_string('defaultsettings', 'checkmark');
$description = get_string('defaultsettings_help', 'checkmark');
$settings->add(new admin_setting_heading('defaultsettings', $name, $description));
$name = new lang_string('alwaysshowdescription', 'checkmark');
$description = new lang_string('alwaysshowdescription_help', 'checkmark');
$setting = new admin_setting_configcheckbox('checkmark/alwaysshowdescription',
$name,
$description,
1);
$settings->add($setting);
$name = new lang_string('allowsubmissionsfromdate', 'checkmark');
$description = new lang_string('allowsubmissionsfromdate_help', 'checkmark');
$setting = new admin_setting_configduration('checkmark/allowsubmissionsfromdate',
$name,
$description,
0);
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, true);
$settings->add($setting);
$name = new lang_string('duedate', 'checkmark');
$description = new lang_string('duedate_help', 'checkmark');
$setting = new admin_setting_configduration('checkmark/duedate',
$name,
$description,
604800);
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, true);
$settings->add($setting);
$name = new lang_string('cutoffdate', 'checkmark');
$description = new lang_string('cutoffdate_help', 'checkmark');
$setting = new admin_setting_configduration('checkmark/cutoffdate',
$name,
$description,
604800);
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
$name = new lang_string('gradingdue', 'checkmark');
$description = new lang_string('gradingdue_help', 'checkmark');
$setting = new admin_setting_configduration('checkmark/gradingduedate',
$name,
$description,
3024000);
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, false);
$settings->add($setting);
}