break;
}
} else {
- print_error($xmldb_action->getError());
+ //TODO: need more detailed error info
+ print_error('xmldberror');
}
} else {
error ("Error: cannot instantiate class (actions/$action/$actionclass)");
$string['wrongroleid'] = 'Incorrect role ID!';
$string['wrongsourcebase'] = 'Wrong source URL base.';
$string['wrongzipfilename'] = 'Wrong ZIP filename.';
+$string['xmldberror'] = 'XMLDB Error!';
?>
// can't continue if there is no course or reference
if (empty($this->course) || empty($this->reference)) {
- $this->error = get_string('error_nocourseorfilename', 'hotpot');
if ($this->report_errors) {
- print_error($this->error);
+ print_error('error_nocourseorfilename', 'hotpot');
}
return;
}
if ($this->read_file) {
if (!file_exists($this->filepath) || !is_readable($this->filepath)) {
- $this->error = get_string('error_couldnotopensourcefile', 'hotpot', $this->filepath);
if ($this->report_errors) {
- print_error($this->error, '', $this->course_homeurl);
+ print_error('error_couldnotopensourcefile', 'hotpot');
}
return;
}
// check template class exists
if (!file_exists($this->template_filepath) || !is_readable($this->template_filepath)) {
- $this->error = get_string('error_couldnotopentemplate', 'hotpot', $this->template_dir);
if ($this->report_errors) {
- print_error($this->error, '', $this->course_homeurl);
+ print_error('error_couldnotopentemplate', 'hotpot', $this->course_homeurl);
}
return;
}
$messages = $accessmanager->prevent_access() +
$accessmanager->prevent_new_attempt($attemptnumber - 1, $lastattempt);
if (!$canpreview && $messages) {
- print_error($accessmanager->print_messages($messages, true), '',
- $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
+ //TODO: need more detailed error info
+ print_error('attempterror', 'quiz', $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
}
$accessmanager->do_password_check($canpreview);
if (!$newattempt) {
$messages = $accessmanager->prevent_access();
if (!$canpreview && $messages) {
- print_error($accessmanager->print_messages($messages, true), '',
- $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
+ //TODO: need more detailed error info
+ print_error('attempterror', 'quiz', $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
}
$accessmanager->do_password_check($canpreview);
}