-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
182 lines (136 loc) · 7.59 KB
/
settings.php
File metadata and controls
182 lines (136 loc) · 7.59 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?php // $Id:,v 2.0 2012/05/20 16:10:00 Serafim Panov
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/mod/reader/lib.php');
$pagetitle = get_string('modulename', 'reader');
$readercfg = get_config('reader');
$readersettings = new admin_settingpage('modsettingreader', $pagetitle, 'moodle/site:config');
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_quiztimeout',
'Quiz time out', '',
array('value' => $readercfg->reader_quiztimeout, 'fix' => false), PARAM_INT));
// Number of attempts
$options = array();
$options[0] = "Disallow";
$options[1] = "Allow";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_editingteacherrole',
'Use "Editing Teacher" role', '',
array('value' => $readercfg->reader_editingteacherrole, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_pointreport',
'Full point report', '',
array('value' => $readercfg->reader_pointreport, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_levelcheck',
'Use the quiz taking level restriction feature', '',
array('value' => $readercfg->reader_levelcheck, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_checkbox',
'Use checkboxes in student report', '',
array('value' => $readercfg->reader_checkbox, 'fix' => false), $options));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_percentforreading',
'Percent correct for making the book as read. (%)', '',
array('value' => $readercfg->reader_percentforreading, 'fix' => false), PARAM_INT));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_questionmark',
'Show question mark', '',
array('value' => $readercfg->reader_questionmark, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_bookcovers',
'Show book covers', '',
array('value' => $readercfg->reader_bookcovers, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "Show Word Count only";
$options[1] = "Show Points only";
$options[2] = "Show both Points and Word Count";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_reportwordspoints',
'Report', '',
array('value' => $readercfg->reader_reportwordspoints, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "Hide";
$options[1] = "Show";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_wordsprogressbar',
'Word Count Progress Bar', '',
array('value' => $readercfg->reader_wordsprogressbar, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "Off";
$options[1] = "1";
$options[2] = "2";
$options[3] = "3";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_attemptsofday',
'Quiz for days', '',
array('value' => $readercfg->reader_attemptsofday, 'fix' => false), $options));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_quiznextlevel',
'Give next level, when student answered more than correct quizzes.', '',
array('value' => $readercfg->reader_quiznextlevel, 'fix' => false), PARAM_INT));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_quizpreviouslevel',
'Allow to select quizzes of previous level.', '',
array('value' => $readercfg->reader_quizpreviouslevel, 'fix' => false), PARAM_INT));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_quizonnextlevel',
'Allow to select quizzes of next level.', '',
array('value' => $readercfg->reader_quizonnextlevel, 'fix' => false), PARAM_INT));
// Number of attempts
$options = array();
$options[0] = "Current course";
$courses = get_courses();
foreach ($courses as $course) {
$options[$course->id] = $course->fullname;
}
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_usecourse',
'Quiz location', '',
array('value' => $readercfg->reader_usecourse, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_update',
'Check server for quiz updates?', '',
array('value' => $readercfg->reader_update, 'fix' => false), $options));
// Number of attempts
$options = array();
$options[0] = "No";
$options[1] = "Yes";
$readersettings->add(new admin_setting_configselect_with_advanced('reader/reader_sendmessagesaboutcheating',
'Send messages about cheating?', '',
array('value' => $readercfg->reader_sendmessagesaboutcheating, 'fix' => false), $options));
$readersettings->add(new admin_setting_configtextarea('reader/reader_cheated_message',
'"Cheated" notice', '',
array('value' => stripslashes($readercfg->reader_cheated_message), 'fix' => false)));
$readersettings->add(new admin_setting_configtextarea('reader/reader_not_cheated_message',
'Points restored notice', '',
array('value' => stripslashes($readercfg->reader_not_cheated_message), 'fix' => false)));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_serverlink',
'Link to Reader server (with quizzes).', '',
array('value' => $readercfg->reader_serverlink, 'fix' => false), PARAM_TEXT));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_serverlogin',
'Reader server login.', '',
array('value' => $readercfg->reader_serverlogin, 'fix' => false), PARAM_TEXT));
// Time limit
$readersettings->add(new admin_setting_configtext_with_advanced('reader/reader_serverpassword',
'Reader server password.', '',
array('value' => $readercfg->reader_serverpassword, 'fix' => false), PARAM_TEXT));
$ADMIN->add('modsettings', $readersettings);
$settings = NULL; // we do not want standard settings link