Línea 64... |
Línea 64... |
64 |
attempts_report::ENROLLED_ALL => get_string('reportuserswithorwithout', 'quiz'),
|
64 |
attempts_report::ENROLLED_ALL => get_string('reportuserswithorwithout', 'quiz'),
|
65 |
attempts_report::ALL_WITH => get_string('reportusersall', 'quiz'),
|
65 |
attempts_report::ALL_WITH => get_string('reportusersall', 'quiz'),
|
66 |
]);
|
66 |
]);
|
Línea 67... |
Línea 67... |
67 |
|
67 |
|
- |
|
68 |
$stategroup = [
|
- |
|
69 |
$mform->createElement('advcheckbox', 'statenotstarted', '',
|
68 |
$stategroup = [
|
70 |
get_string('statenotstarted', 'quiz')),
|
69 |
$mform->createElement('advcheckbox', 'stateinprogress', '',
|
71 |
$mform->createElement('advcheckbox', 'stateinprogress', '',
|
70 |
get_string('stateinprogress', 'quiz')),
|
72 |
get_string('stateinprogress', 'quiz')),
|
71 |
$mform->createElement('advcheckbox', 'stateoverdue', '',
|
73 |
$mform->createElement('advcheckbox', 'stateoverdue', '',
|
- |
|
74 |
get_string('stateoverdue', 'quiz')),
|
- |
|
75 |
$mform->createElement('advcheckbox', 'statesubmitted', '',
|
72 |
get_string('stateoverdue', 'quiz')),
|
76 |
get_string('statesubmitted', 'quiz')),
|
73 |
$mform->createElement('advcheckbox', 'statefinished', '',
|
77 |
$mform->createElement('advcheckbox', 'statefinished', '',
|
74 |
get_string('statefinished', 'quiz')),
|
78 |
get_string('statefinished', 'quiz')),
|
75 |
$mform->createElement('advcheckbox', 'stateabandoned', '',
|
79 |
$mform->createElement('advcheckbox', 'stateabandoned', '',
|
76 |
get_string('stateabandoned', 'quiz')),
|
80 |
get_string('stateabandoned', 'quiz')),
|
77 |
];
|
81 |
];
|
78 |
$mform->addGroup($stategroup, 'stateoptions',
|
82 |
$mform->addGroup($stategroup, 'stateoptions',
|
- |
|
83 |
get_string('reportattemptsthatare', 'quiz'), [' '], false);
|
- |
|
84 |
$mform->addHelpButton('stateoptions', 'stateoptions', 'quiz');
|
79 |
get_string('reportattemptsthatare', 'quiz'), [' '], false);
|
85 |
$mform->setDefault('statenotstarted', 1);
|
80 |
$mform->setDefault('stateinprogress', 1);
|
86 |
$mform->setDefault('stateinprogress', 1);
|
- |
|
87 |
$mform->setDefault('stateoverdue', 1);
|
81 |
$mform->setDefault('stateoverdue', 1);
|
88 |
$mform->setDefault('statesubmitted', 1);
|
82 |
$mform->setDefault('statefinished', 1);
|
89 |
$mform->setDefault('statefinished', 1);
|
- |
|
90 |
$mform->setDefault('stateabandoned', 1);
|
83 |
$mform->setDefault('stateabandoned', 1);
|
91 |
$mform->disabledIf('statenotstarted', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
84 |
$mform->disabledIf('stateinprogress', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
92 |
$mform->disabledIf('stateinprogress', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
- |
|
93 |
$mform->disabledIf('stateoverdue', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
85 |
$mform->disabledIf('stateoverdue', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
94 |
$mform->disabledIf('statesubmitted', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
86 |
$mform->disabledIf('statefinished', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
95 |
$mform->disabledIf('statefinished', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
Línea 87... |
Línea 96... |
87 |
$mform->disabledIf('stateabandoned', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
96 |
$mform->disabledIf('stateabandoned', 'attempts', 'eq', attempts_report::ENROLLED_WITHOUT);
|
88 |
|
97 |
|
Línea 124... |
Línea 133... |
124 |
}
|
133 |
}
|
Línea 125... |
Línea 134... |
125 |
|
134 |
|
126 |
public function validation($data, $files) {
|
135 |
public function validation($data, $files) {
|
Línea -... |
Línea 136... |
- |
|
136 |
$errors = parent::validation($data, $files);
|
127 |
$errors = parent::validation($data, $files);
|
137 |
|
- |
|
138 |
if (
|
- |
|
139 |
$data['attempts'] != attempts_report::ENROLLED_WITHOUT &&
|
- |
|
140 |
!(
|
- |
|
141 |
$data['stateinprogress']
|
128 |
|
142 |
|| $data['stateoverdue']
|
- |
|
143 |
|| $data['statefinished']
|
- |
|
144 |
|| $data['stateabandoned']
|
- |
|
145 |
|| $data['statenotstarted']
|
- |
|
146 |
|| $data['statesubmitted']
|
129 |
if ($data['attempts'] != attempts_report::ENROLLED_WITHOUT && !(
|
147 |
)
|
130 |
$data['stateinprogress'] || $data['stateoverdue'] || $data['statefinished'] || $data['stateabandoned'])) {
|
148 |
) {
|
Línea 131... |
Línea 149... |
131 |
$errors['stateoptions'] = get_string('reportmustselectstate', 'quiz');
|
149 |
$errors['stateoptions'] = get_string('reportmustselectstate', 'quiz');
|
132 |
}
|
150 |
}
|