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
119 lines (98 loc) · 5.66 KB
/
Copy pathedit_form.php
File metadata and controls
119 lines (98 loc) · 5.66 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
<?php
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'));
//Config title for the block.
$mform->addElement('text', 'config_title',
get_string('setblocktitle', 'block_fn_marking'));
$mform->setType('config_title', PARAM_MULTILANG);
$mform->setDefault('config_title', get_string('pluginname', 'block_fn_marking'));
$mform->addHelpButton('config_title', 'config_title', 'block_fn_marking');
$hideshow = array(0 => get_string('hide'), 1 => get_string('show'));
// 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_showsaved',
get_string('showsaved', 'block_fn_marking'), $hideshow);
$mform->setDefault('config_showsaved', 1);
$mform->addHelpButton('config_showsaved', 'config_showsaved', 'block_fn_marking');
// 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');
}
}