2 require_once ($CFG->dirroot
.'/course/moodleform_mod.php');
4 require_once("$CFG->dirroot/mod/quiz/locallib.php");
6 class mod_quiz_mod_form
extends moodleform_mod
{
9 function definition() {
12 $mform =& $this->_form
;
14 //-------------------------------------------------------------------------------
15 $mform->addElement('header', 'general', get_string('general', 'form'));
17 $mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
18 if (!empty($CFG->formatstringstriptags
)) {
19 $mform->setType('name', PARAM_TEXT
);
21 $mform->setType('name', PARAM_CLEAN
);
23 $mform->addRule('name', null, 'required', null, 'client');
25 $mform->addElement('htmleditor', 'intro', get_string("introduction", "quiz"));
26 $mform->setType('intro', PARAM_RAW
);
27 $mform->setHelpButton('intro', array('richtext', get_string('helprichtext')));
29 //-------------------------------------------------------------------------------
30 $mform->addElement('header', 'timinghdr', get_string('timing', 'form'));
31 $mform->addElement('date_time_selector', 'timeopen', get_string('quizopen', 'quiz'), array('optional'=>true));
32 $mform->setHelpButton('timeopen', array('timeopen', get_string('quizopen', 'quiz'), 'quiz'));
34 $mform->addElement('date_time_selector', 'timeclose', get_string('quizclose', 'quiz'), array('optional'=>true));
35 $mform->setHelpButton('timeclose', array('timeopen', get_string('quizclose', 'quiz'), 'quiz'));
38 $timelimitgrp=array();
39 $timelimitgrp[] = &$mform->createElement('text', 'timelimit');
40 $timelimitgrp[] = &$mform->createElement('checkbox', 'timelimitenable', '', get_string('enable'));
41 $mform->addGroup($timelimitgrp, 'timelimitgrp', get_string('timelimitmin', 'quiz'), array(' '), false);
42 $mform->setType('timelimit', PARAM_TEXT
);
43 $timelimitgrprules = array();
44 $timelimitgrprules['timelimit'][] = array(null, 'numeric', null, 'client');
45 $mform->addGroupRule('timelimitgrp', $timelimitgrprules);
46 $mform->disabledIf('timelimitgrp', 'timelimitenable');
47 $mform->setAdvanced('timelimitgrp', $CFG->quiz_fix_timelimit
);
48 $mform->setHelpButton('timelimitgrp', array("timelimit", get_string("quiztimer","quiz"), "quiz"));
49 $mform->setDefault('timelimit', $CFG->quiz_timelimit
);
50 $mform->setDefault('timelimitenable', !empty($CFG->quiz_timelimit
));
53 //enforced time delay between quiz attempts add-on
54 $timedelayoptions = array();
55 $timedelayoptions[0] = get_string('none');
56 $timedelayoptions[1800] = get_string('numminutes', '', 30);
57 $timedelayoptions[3600] = get_string('numminutes', '', 60);
58 for($i=2; $i<=23; $i++
) {
60 $timedelayoptions[$seconds] = get_string('numhours', '', $i);
62 $timedelayoptions[86400] = get_string('numhours', '', 24);
63 for($i=2; $i<=7; $i++
) {
65 $timedelayoptions[$seconds] = get_string('numdays', '', $i);
67 $mform->addElement('select', 'delay1', get_string("delay1", "quiz"), $timedelayoptions);
68 $mform->setHelpButton('delay1', array("timedelay1", get_string("delay1", "quiz"), "quiz"));
69 $mform->setAdvanced('delay1', $CFG->quiz_fix_delay1
);
70 $mform->setDefault('delay1', $CFG->quiz_delay1
);
72 $mform->addElement('select', 'delay2', get_string("delay2", "quiz"), $timedelayoptions);
73 $mform->setHelpButton('delay2', array("timedelay2", get_string("delay2", "quiz"), "quiz"));
74 $mform->setAdvanced('delay2', $CFG->quiz_fix_delay2
);
75 $mform->setDefault('delay2', $CFG->quiz_delay2
);
77 //-------------------------------------------------------------------------------
78 $mform->addElement('header', 'displayhdr', get_string('display', 'form'));
80 for ($i = 0; $i <= 50; ++
$i) {
83 $perpage[0] = get_string('allinone', 'quiz');
84 $mform->addElement('select', 'questionsperpage', get_string('questionsperpage', 'quiz'), $perpage);
85 $mform->setHelpButton('questionsperpage', array('questionsperpage', get_string('questionsperpage', 'quiz'), 'quiz'));
86 $mform->setAdvanced('questionsperpage', $CFG->quiz_fix_questionsperpage
);
87 $mform->setDefault('questionsperpage', $CFG->quiz_questionsperpage
);
89 $mform->addElement('selectyesno', 'shufflequestions', get_string("shufflequestions", "quiz"));
90 $mform->setHelpButton('shufflequestions', array("shufflequestions", get_string("shufflequestions","quiz"), "quiz"));
91 $mform->setAdvanced('shufflequestions', $CFG->quiz_fix_shufflequestions
);
92 $mform->setDefault('shufflequestions', $CFG->quiz_shufflequestions
);
94 $mform->addElement('selectyesno', 'shuffleanswers', get_string("shufflewithin", "quiz"));
95 $mform->setHelpButton('shuffleanswers', array("shufflewithin", get_string("shufflewithin","quiz"), "quiz"));
96 $mform->setAdvanced('shuffleanswers', $CFG->quiz_fix_shuffleanswers
);
97 $mform->setDefault('shuffleanswers', $CFG->quiz_shuffleanswers
);
99 //-------------------------------------------------------------------------------
100 $mform->addElement('header', 'attemptshdr', get_string('attempts', 'quiz'));
101 $attemptoptions = array();
102 $attemptoptions[0] = get_string("attemptsunlimited", "quiz");
103 $attemptoptions[1] = "1 ".moodle_strtolower(get_string("attempt", "quiz"));
104 for ($i=2;$i<=6;$i++
) {
105 $attemptoptions[$i] = "$i ".moodle_strtolower(get_string("attempts", "quiz"));
107 $mform->addElement('select', 'attempts', get_string("attemptsallowed", "quiz"), $attemptoptions);
108 $mform->setHelpButton('attempts', array("attempts", get_string("attemptsallowed","quiz"), "quiz"));
109 $mform->setAdvanced('attempts', $CFG->quiz_fix_attempts
);
110 $mform->setDefault('attempts', $CFG->quiz_attempts
);
112 $mform->addElement('selectyesno', 'attemptonlast', get_string("eachattemptbuildsonthelast", "quiz"));
113 $mform->setHelpButton('attemptonlast', array("repeatattempts", get_string("eachattemptbuildsonthelast", "quiz"), "quiz"));
114 $mform->setAdvanced('attemptonlast', $CFG->quiz_fix_attemptonlast
);
115 $mform->setDefault('attemptonlast', $CFG->quiz_attemptonlast
);
117 $mform->addElement('selectyesno', 'adaptive', get_string("adaptive", "quiz"));
118 $mform->setHelpButton('adaptive', array("adaptive", get_string("adaptive","quiz"), "quiz"));
119 $mform->setAdvanced('adaptive', $CFG->quiz_fix_adaptive
);
120 $mform->setDefault('adaptive', $CFG->quiz_optionflags
& QUESTION_ADAPTIVE
);
123 //-------------------------------------------------------------------------------
124 $mform->addElement('header', 'gradeshdr', get_string('grades', 'grades'));
125 $mform->addElement('select', 'grademethod', get_string("grademethod", "quiz"), quiz_get_grading_options());
126 $mform->setHelpButton('grademethod', array("grademethod", get_string("grademethod","quiz"), "quiz"));
127 $mform->setAdvanced('grademethod', $CFG->quiz_fix_grademethod
);
128 $mform->setDefault('grademethod', $CFG->quiz_grademethod
);
130 $mform->addElement('selectyesno', 'penaltyscheme', get_string("penaltyscheme", "quiz"));
131 $mform->setHelpButton('penaltyscheme', array("penaltyscheme", get_string("penaltyscheme","quiz"), "quiz"));
132 $mform->setAdvanced('penaltyscheme', $CFG->quiz_fix_penaltyscheme
);
133 $mform->setDefault('penaltyscheme', $CFG->quiz_penaltyscheme
);
140 $mform->addElement('select', 'decimalpoints', get_string("decimaldigits", "quiz"), $options);
141 $mform->setHelpButton('decimalpoints', array("decimalpoints", get_string("decimaldigits","quiz"), "quiz"));
142 $mform->setAdvanced('decimalpoints', $CFG->quiz_fix_decimalpoints
);
143 $mform->setDefault('decimalpoints', $CFG->quiz_decimalpoints
);
145 $mform->addElement('hidden', 'grade', $CFG->quiz_maximumgrade
);
147 //-------------------------------------------------------------------------------
148 $mform->addElement('header', 'reviewoptionshdr', get_string('reviewoptionsheading', 'quiz'));
149 $mform->setHelpButton('reviewoptionshdr', array('reviewoptions', get_string('reviewoptionsheading','quiz'), 'quiz'));
150 $mform->setAdvanced('reviewoptionshdr', $CFG->quiz_fix_review
);
152 $immediatelyoptionsgrp=array();
153 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'responsesimmediately', '', get_string('responses', 'quiz'));
154 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'answersimmediately', '', get_string('answers', 'quiz'));
155 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'feedbackimmediately', '', get_string('feedback', 'quiz'));
156 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'generalfeedbackimmediately', '', get_string('generalfeedback', 'quiz'));
157 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'scoreimmediately', '', get_string('scores', 'quiz'));
158 $immediatelyoptionsgrp[] = &$mform->createElement('checkbox', 'overallfeedbackimmediately', '', get_string('overallfeedback', 'quiz'));
159 $mform->addGroup($immediatelyoptionsgrp, 'immediatelyoptionsgrp', get_string("reviewimmediately", "quiz"), null, false);
160 $mform->setDefault('responsesimmediately', $CFG->quiz_review
& QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_IMMEDIATELY
);
161 $mform->setDefault('answersimmediately', $CFG->quiz_review
& QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_IMMEDIATELY
);
162 $mform->setDefault('feedbackimmediately', $CFG->quiz_review
& QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
);
163 $mform->setDefault('generalfeedbackimmediately', $CFG->quiz_review
& QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
);
164 $mform->setDefault('scoreimmediately', $CFG->quiz_review
& QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_IMMEDIATELY
);
165 $mform->setDefault('overallfeedbackimmediately', $CFG->quiz_review
& QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
);
167 $openoptionsgrp=array();
168 $openoptionsgrp[] = &$mform->createElement('checkbox', 'responsesopen', '', get_string('responses', 'quiz'));
169 $openoptionsgrp[] = &$mform->createElement('checkbox', 'answersopen', '', get_string('answers', 'quiz'));
170 $openoptionsgrp[] = &$mform->createElement('checkbox', 'feedbackopen', '', get_string('feedback', 'quiz'));
171 $openoptionsgrp[] = &$mform->createElement('checkbox', 'generalfeedbackopen', '', get_string('generalfeedback', 'quiz'));
172 $openoptionsgrp[] = &$mform->createElement('checkbox', 'scoreopen', '', get_string('scores', 'quiz'));
173 $openoptionsgrp[] = &$mform->createElement('checkbox', 'overallfeedbackopen', '', get_string('overallfeedback', 'quiz'));
174 $mform->addGroup($openoptionsgrp, 'openoptionsgrp', get_string("reviewopen", "quiz"), array(' '), false);
175 $mform->setDefault('responsesopen', $CFG->quiz_review
& QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_OPEN
);
176 $mform->setDefault('answersopen', $CFG->quiz_review
& QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_OPEN
);
177 $mform->setDefault('feedbackopen', $CFG->quiz_review
& QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_OPEN
);
178 $mform->setDefault('generalfeedbackopen', $CFG->quiz_review
& QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_OPEN
);
179 $mform->setDefault('scoreopen', $CFG->quiz_review
& QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_OPEN
);
180 $mform->setDefault('overallfeedbackopen', $CFG->quiz_review
& QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_OPEN
);
183 $closedoptionsgrp=array();
184 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'responsesclosed', '', get_string('responses', 'quiz'));
185 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'answersclosed', '', get_string('answers', 'quiz'));
186 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'feedbackclosed', '', get_string('feedback', 'quiz'));
187 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'generalfeedbackclosed', '', get_string('generalfeedback', 'quiz'));
188 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'scoreclosed', '', get_string('scores', 'quiz'));
189 $closedoptionsgrp[] = &$mform->createElement('checkbox', 'overallfeedbackclosed', '', get_string('overallfeedback', 'quiz'));
190 $mform->addGroup($closedoptionsgrp, 'closedoptionsgrp', get_string("reviewclosed", "quiz"), array(' '), false);
191 $mform->setDefault('responsesclosed', $CFG->quiz_review
& QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_CLOSED
);
192 $mform->setDefault('answersclosed', $CFG->quiz_review
& QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_CLOSED
);
193 $mform->setDefault('feedbackclosed', $CFG->quiz_review
& QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_CLOSED
);
194 $mform->setDefault('generalfeedbackclosed', $CFG->quiz_review
& QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_CLOSED
);
195 $mform->setDefault('scoreclosed', $CFG->quiz_review
& QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_CLOSED
);
196 $mform->setDefault('overallfeedbackclosed', $CFG->quiz_review
& QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_CLOSED
);
198 //-------------------------------------------------------------------------------
199 $mform->addElement('header', 'security', get_string('security', 'form'));
201 $mform->addElement('selectyesno', 'popup', get_string("popup", "quiz"));
202 $mform->setHelpButton('popup', array("popup", get_string("popup", "quiz"), "quiz"));
203 $mform->setAdvanced('popup', $CFG->quiz_fix_popup
);
204 $mform->setDefault('popup', $CFG->quiz_popup
);
206 $mform->addElement('passwordunmask', 'quizpassword', get_string("requirepassword", "quiz"));
207 $mform->setType('quizpassword', PARAM_TEXT
);
208 $mform->setHelpButton('quizpassword', array("requirepassword", get_string("requirepassword", "quiz"), "quiz"));
209 $mform->setAdvanced('quizpassword', $CFG->quiz_fix_password
);
210 $mform->setDefault('quizpassword', $CFG->quiz_password
);
212 $mform->addElement('text', 'subnet', get_string("requiresubnet", "quiz"));
213 $mform->setType('subnet', PARAM_TEXT
);
214 $mform->setHelpButton('subnet', array("requiresubnet", get_string("requiresubnet", "quiz"), "quiz"));
215 $mform->setAdvanced('subnet', $CFG->quiz_fix_subnet
);
216 $mform->setDefault('subnet', $CFG->quiz_subnet
);
218 //-------------------------------------------------------------------------------
219 $features = new stdClass
;
220 $features->groups
= true;
221 $features->groupings
= true;
222 $features->groupmembersonly
= true;
223 $this->standard_coursemodule_elements($features);
224 //-------------------------------------------------------------------------------
225 $mform->addElement('header', 'overallfeedbackhdr', get_string('overallfeedback', 'quiz'));
226 $mform->setHelpButton('overallfeedbackhdr', array('overallfeedback', get_string('overallfeedback', 'quiz'), 'quiz'));
228 $mform->addElement('static', 'gradeboundarystatic1', get_string('gradeboundary', 'quiz'), '100%');
230 $repeatarray=array();
231 $repeatarray[] = &MoodleQuickForm
::createElement('text', 'feedbacktext', get_string('feedback', 'quiz'), array('size' => 50));
232 $repeatarray[] = &MoodleQuickForm
::createElement('text', 'feedbackboundaries', get_string('gradeboundary', 'quiz'), array('size' => 10));
234 if (!empty($this->_instance
)) {
235 $this->_feedbacks
= get_records('quiz_feedback', 'quizid', $this->_instance
, 'mingrade DESC');
237 $this->_feedbacks
= array();
239 $numfeedbacks = max(count($this->_feedbacks
) * 1.5, 5);
241 $mform->setType('feedbacktext', PARAM_RAW
);
242 $mform->setType('feedbackboundaries', PARAM_NOTAGS
);
244 $nextel=$this->repeat_elements($repeatarray, $numfeedbacks-1,
245 array(), 'boundary_repeats', 'boundary_add_fields', 3,
246 get_string('addmoreoverallfeedbacks', 'quiz'), true);
248 //put some extra elements in before the button
249 $insertEl = &MoodleQuickForm
::createElement('text', "feedbacktext[$nextel]", get_string('feedback', 'quiz'), array('size' => 50));
250 $mform->insertElementBefore($insertEl, 'boundary_add_fields');
252 $insertEl = &MoodleQuickForm
::createElement('static', 'gradeboundarystatic2', get_string('gradeboundary', 'quiz'), '0%');
253 $mform->insertElementBefore($insertEl, 'boundary_add_fields');
255 //-------------------------------------------------------------------------------
257 $this->add_action_buttons();
260 function data_preprocessing(&$default_values){
261 if (count($this->_feedbacks
)) {
263 foreach ($this->_feedbacks
as $feedback){
264 $default_values['feedbacktext['.$key.']'] = $feedback->feedbacktext
;
265 if ($feedback->mingrade
> 0) {
266 $default_values['feedbackboundaries['.$key.']'] = (100.0 * $feedback->mingrade
/ $default_values['grade']) . '%';
272 if (isset($default_values['timelimit'])) {
273 $default_values['timelimitenable'] = $default_values['timelimit'] > 0;
276 if (isset($default_values['review'])){
277 $review = (int)$default_values['review'];
278 unset($default_values['review']);
280 $default_values['responsesimmediately'] = $review & QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_IMMEDIATELY
;
281 $default_values['answersimmediately'] = $review & QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_IMMEDIATELY
;
282 $default_values['feedbackimmediately'] = $review & QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
;
283 $default_values['generalfeedbackimmediately'] = $review & QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
;
284 $default_values['scoreimmediately'] = $review & QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_IMMEDIATELY
;
285 $default_values['overallfeedbackimmediately'] = $review & QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_IMMEDIATELY
;
287 $default_values['responsesopen'] = $review & QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_OPEN
;
288 $default_values['answersopen'] = $review & QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_OPEN
;
289 $default_values['feedbackopen'] = $review & QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_OPEN
;
290 $default_values['generalfeedbackopen'] = $review & QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_OPEN
;
291 $default_values['scoreopen'] = $review & QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_OPEN
;
292 $default_values['overallfeedbackopen'] = $review & QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_OPEN
;
294 $default_values['responsesclosed'] = $review & QUIZ_REVIEW_RESPONSES
& QUIZ_REVIEW_CLOSED
;
295 $default_values['answersclosed'] = $review & QUIZ_REVIEW_ANSWERS
& QUIZ_REVIEW_CLOSED
;
296 $default_values['feedbackclosed'] = $review & QUIZ_REVIEW_FEEDBACK
& QUIZ_REVIEW_CLOSED
;
297 $default_values['generalfeedbackclosed'] = $review & QUIZ_REVIEW_GENERALFEEDBACK
& QUIZ_REVIEW_CLOSED
;
298 $default_values['scoreclosed'] = $review & QUIZ_REVIEW_SCORES
& QUIZ_REVIEW_CLOSED
;
299 $default_values['overallfeedbackclosed'] = $review & QUIZ_REVIEW_OVERALLFEEDBACK
& QUIZ_REVIEW_CLOSED
;
302 if (isset($default_values['optionflags'])){
303 $default_values['adaptive'] = $default_values['optionflags'] & QUESTION_ADAPTIVE
;
304 unset($default_values['optionflags']);
307 // Password field - different in form to stop browsers that remember passwords
309 if (isset($default_values['password'])) {
310 $default_values['quizpassword'] = $default_values['password'];
311 unset($default_values['password']);
315 function validation($data, $files) {
316 $errors = parent
::validation($data, $files);
318 // Check open and close times are consistent.
319 if ($data['timeopen'] != 0 && $data['timeclose'] != 0 && $data['timeclose'] < $data['timeopen']) {
320 $errors['timeclose'] = get_string('closebeforeopen', 'quiz');
323 // Check the boundary value is a number or a percentage, and in range.
325 while (!empty($data['feedbackboundaries'][$i] )) {
326 $boundary = trim($data['feedbackboundaries'][$i]);
327 if (strlen($boundary) > 0 && $boundary[strlen($boundary) - 1] == '%') {
328 $boundary = trim(substr($boundary, 0, -1));
329 if (is_numeric($boundary)) {
330 $boundary = $boundary * $data['grade'] / 100.0;
332 $errors["feedbackboundaries[$i]"] = get_string('feedbackerrorboundaryformat', 'quiz', $i +
1);
335 if (is_numeric($boundary) && $boundary <= 0 ||
$boundary >= $data['grade'] ) {
336 $errors["feedbackboundaries[$i]"] = get_string('feedbackerrorboundaryoutofrange', 'quiz', $i +
1);
338 if (is_numeric($boundary) && $i > 0 && $boundary >= $data['feedbackboundaries'][$i - 1]) {
339 $errors["feedbackboundaries[$i]"] = get_string('feedbackerrororder', 'quiz', $i +
1);
341 $data['feedbackboundaries'][$i] = $boundary;
346 // Check there is nothing in the remaining unused fields.
347 for ($i = $numboundaries; $i < count($data['feedbackboundaries'] ); $i +
= 1) {
348 if (!empty($data['feedbackboundaries'][$i] ) && trim($data['feedbackboundaries'][$i] ) != '') {
349 $errors["feedbackboundaries[$i]"] = get_string('feedbackerrorjunkinboundary', 'quiz', $i +
1);
352 for ($i = $numboundaries +
1; $i < count($data['feedbacktext'] ); $i +
= 1) {
353 if (!empty($data['feedbacktext'][$i] ) && trim($data['feedbacktext'][$i] ) != '') {
354 $errors["feedbacktext[$i]"] = get_string('feedbackerrorjunkinfeedback', 'quiz', $i +
1);
358 if (count($errors) == 0) {