forked from ned-code/moodle-block_marking_manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_form.php
More file actions
159 lines (132 loc) · 7.64 KB
/
Copy pathedit_form.php
File metadata and controls
159 lines (132 loc) · 7.64 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
<?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/>.
/**
* @package block_fn_marking
* @copyright Michael Gardener <mgardener@cissq.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(dirname(__FILE__) . '/../../config.php');
/**
* Simple fn_marking block config form definition
*
* @package contrib
* @subpackage block_fn_marking
* @copyright 2011 MoodleFN
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Simple fn_marking block config form class
*
* @copyright 2011 MoodleFN
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class block_fn_marking_edit_form extends block_edit_form {
protected function specific_definition($mform) {
// Section header title according to language file.
$mform->addElement('header', 'configheader',
get_string('blocksettings', 'block_fn_marking'));
$mform->addElement('static', 'blockinfo', get_string('blockinfo', 'block_fn_marking'),
'<a target="_blank" href="http://ned.ca/marking-manager">http://ned.ca/marking-manager</a>');
// Config title for the block.
$mform->addElement('text', 'config_title',
get_string('setblocktitle', 'block_fn_marking'));
$mform->setType('config_title', PARAM_TEXT);
$mform->setDefault('config_title', get_string('plugintitle', 'block_fn_marking'));
$mform->addHelpButton('config_title', 'config_title', 'block_fn_marking');
// Section Titles.
$mform->addElement('text', 'config_sectiontitles', get_string('sectiontitles', 'block_fn_marking'));
$mform->setType('config_sectiontitles', PARAM_TEXT);
$mform->addHelpButton('config_sectiontitles', 'config_sectiontitles', 'block_fn_marking');
$hideshow = array(0 => get_string('hide'), 1 => get_string('show'));
$yesno = array(0 => get_string('no'), 1 => get_string('yes'));
// Control the visibility of the unmarked activities.
$mform->addElement('select', 'config_showunmarked',
get_string('showunmarked', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showunmarked', 1);
$mform->addHelpButton('config_showunmarked', 'config_showunmarked', 'block_fn_marking');
// Control the visibility of the marked activities.
$mform->addElement('select', 'config_showmarked',
get_string('showmarked', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showunmarked', 1);
$mform->addHelpButton('config_showmarked', 'config_showmarked', 'block_fn_marking');
// Control the visibility of the notsubmitted activities.
$mform->addElement('select', 'config_showunsubmitted',
get_string('showunsubmitted', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showunmarked', 1);
$mform->addHelpButton('config_showunsubmitted', 'config_unsubmitted', 'block_fn_marking');
// Control the visibility of the saved activities.
$mform->addElement('select', 'config_keepseparate',
get_string('keepseparate', 'block_fn_marking'), $yesno);
$mform->setDefault('config_keepseparate', 1);
// Control the visibility of the grade link activities.
$mform->addElement('select', 'config_showgradeslink',
get_string('showgradeslink', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showunmarked', 0);
$mform->addHelpButton('config_showgradeslink', 'config_showgradeslink', 'block_fn_marking');
// Control the visibility of the report link activities.
$mform->addElement('select', 'config_showreportslink',
get_string('showreportslink', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showreportslink', 0);
$mform->addHelpButton('config_showreportslink', 'config_showreportlink',
'block_fn_marking');
// Control the visibility of the show not loggedin user.
$mform->addElement('select', 'config_shownotloggedinuser',
get_string('shownotloggedinuser', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_shownotloggedinuser', 1);
$mform->addHelpButton('config_shownotloggedinuser', 'config_shownotloggedinuser',
'block_fn_marking');
// Control the visibility of the "show student not submitted assignment in last x days".
$mform->addElement('select', 'config_showstudentnotsubmittedassignment',
get_string('showstudentnotsubmittedassignment', 'block_fn_marking')
, $hideshow);
$mform->addHelpButton('config_showstudentnotsubmittedassignment',
'config_showstudentnotsubmittedassignment', 'block_fn_marking');
// Control the visibility of the "show student marks less than fifty percent".
$mform->addElement('select', 'config_showstudentmarkslessthanfiftypercent',
get_string('showstudentmarkslessthanfiftypercent', 'block_fn_marking')
, $hideshow);
$mform->addHelpButton('config_showstudentmarkslessthanfiftypercent',
'config_showstudentmarkslessthanfiftypercent', 'block_fn_marking');
$numberofdays = array();
for ($i = 1; $i <= 100; $i++) {
$numberofdays[$i] = $i;
}
// Set the number of days.
$mform->addElement('select', 'config_days',
get_string('setnumberofdays', 'block_fn_marking'), $numberofdays);
$mform->setDefault('config_days', $numberofdays[7]);
$mform->addHelpButton('config_days', 'config_days', 'block_fn_marking');
$numberofpercent = array();
for ($i = 1; $i <= 100; $i++) {
$numberofpercent[$i] = $i;
}
// Set the percent of marks.
$mform->addElement('select', 'config_percent',
get_string('setpercentmarks', 'block_fn_marking'), $numberofpercent);
$mform->setDefault('config_percent', $numberofpercent[50]);
$mform->addHelpButton('config_percent', 'config_percent', 'block_fn_marking');
// Set the number of days.
$mform->addElement('select', 'config_showtopmessage',
get_string('showtopmessage', 'block_fn_marking'), array('0' => 'No', '1' => 'Yes'));
$mform->setDefault('config_showtopmessage', 0);
$mform->addElement('select', 'config_listcourseszeroungraded',
get_string('listcourseszeroungraded', 'block_fn_marking'), array('0' => 'No', '1' => 'Yes'));
$mform->setDefault('config_listcourseszeroungraded', 0);
$mform->addElement('editor', 'config_topmessage', get_string('topmessage', 'block_fn_marking'));
$mform->setType('config_topmessage', PARAM_RAW);
}
}