unset($content);
if ($readcount === false) {
- print_error($cir->get_error(), '', $returnurl);
+ //TODO: need more detailed error info
+ print_error('csvloaderror', '', $returnurl);
} else if ($readcount == 0) {
print_error('csvemptyfile', 'error', $returnurl);
}
break;
}
if (!empty($authorizeerror)) {
- print_error($authorizeerror);
+ print_error('authorizeerror');
}
}
$frmenrol->display();
}
} else {
- print_error($error);
+ print_error('error', 'gradeimport_xml');
}
?>
$string['adminprimarynoedit'] = 'The primary admin cannot be edited by others';
+$string['authorizeerror'] = 'Authorize Error';
$string['blockdoesnotexist'] = 'This block does not exist';
$string['blockcannotinistantiate'] = 'Problem in instantiating block object';
$string['blockcannotread'] = 'Could not read data for blockid= $a ';
$string['csvinvalidcolsnum'] = 'INVALID CSV FILE; Each line must include 49 or 70 fields';
$string['csvinvalidcols'] = '<b>INVALID CSV FILE:</b> First line must include "Header Fields" and the file must be type of <br />"Expanded Fields/Comma Separated"<br />or<br /> "Expanded Fields with CAVV Result Code/Comma Separated"';
$string['csvweirdcolumns'] = 'Invalid CSV file format - number of columns is not constant!';
+$string['csvloaderror'] = 'Error occur during loading vcs file!';
$string['dbconnectionfailed'] = '<p>Error: Database connection failed.</p>
<p>It is possible that the database is overloaded or otherwise not running properly.</p>
<p>The site administrator should also check that the database details have been correctly specified in config.php</p>$a';
<?PHP // $Id$
+$string['error'] = 'Errors occur';
$string['errbadxmlformat'] = 'Error - bad XML format';
$string['errduplicateidnumber'] = 'Error - duplicate idnumber';
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
$string['errorupdatingattempt'] = 'Error updating attempt $a->id in the database.';
$string['emptyxml'] = 'Unkown error - empty imsmanifest.xml';
$string['exportcategory'] = 'Export category';
+$string['exporterror'] = 'Errors occur during exporting!';
$string['filesareasite']= 'the site files area';
$string['filesareacourse']= 'the course files area';
$string['filestomove']= 'Move / copy files to $a?';
$string['questioncategory'] = 'Question category';
$string['questioncatsfor'] = 'Question Categories for \'$a\'';
$string['questiondoesnotexist'] = 'This question does not exist';
+$string['questionsaveerror'] = 'Errors occur during saving question - ($a)';
$string['questionsmovedto'] = 'Questions still in use moved to "$a" in the parent course category.';
$string['questionsrescuedfrom'] = 'Questions saved from context $a.';
$string['questionsrescuedfrominfo'] = 'These questions (some of which may be hidden) where saved when context $a was deleted because they are still used by some quizzes or other activities.';
$string['attemptclosed'] = 'Attempt has not closed yet';
$string['attemptduration'] = 'Time taken';
$string['attemptedon'] = 'Attempted on';
+$string['attempterror'] = 'Attempt error';
$string['attemptfirst'] = 'First attempt';
$string['attemptincomplete'] = 'That attempt (by $a) is not yet completed.';
$string['attemptlast'] = 'Last attempt';
$string['forceregeneration'] = 'force regeneration';
$string['formatnotfound'] = 'Import/export format $a not found';
$string['formatnotimplemented'] = 'This format has not been correctly implemented, please post a bug report';
+$string['formulaerror'] = 'Formula errors!';
$string['fractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%%<br />Instead, they add up to $a%%<br />Do you want to go back and fix this question?';
$string['fractionsnomax'] = 'One of the answers should be 100%%, so that it is<br />possible to get a full grade for this question.<br />Do you want to go back and fix this question?';
$string['fromfile'] = 'from file:';
$qformat->setContexttofile(!empty($from_form->contexttofile));
if (! $qformat->exportpreprocess()) { // Do anything before that we need to
- print_error($txt->exporterror, '', $thispageurl->out());
+ print_error('exporterror', 'question', $thispageurl->out());
}
if (! $qformat->exportprocess()) { // Process the export data
- print_error($txt->exporterror, '', $thispageurl->out());
+ print_error('exporterror', 'question', $thispageurl->out());
}
if (! $qformat->exportpostprocess()) { // In case anything needs to be done after
- print_error($txt->exporterror, '', $thispageurl->out());
+ print_error('exporterror', 'question', $thispageurl->out());
}
echo "<hr />";
// In case anything needs to be done after
if (! $qformat->importpostprocess()) {
- print_error($txt->importerror, '', $thispageurl->out());
+ //TODO: need more detailed error info
+ print_error('cannotimport', '', $thispageurl->out());
}
echo "<hr />";
function validate_form($form) {
switch($form->wizardpage) {
case 'question':
- $calculatedmessages = array();
if (empty($form->name)) {
- $calculatedmessages[] = get_string('missingname', 'quiz');
+ print_error('missingname', 'quiz');
}
if (empty($form->questiontext)) {
- $calculatedmessages[] = get_string('missingquestiontext', 'quiz');
+ print_error('missingquestiontext', 'quiz');
}
// Verify formulas
foreach ($form->answers as $key => $answer) {
if ('' === trim($answer)) {
- $calculatedmessages[] =
- get_string('missingformula', 'quiz');
+ print_error('missingformula', 'quiz');
}
- if ($formulaerrors =
- qtype_calculated_find_formula_errors($answer)) {
- $calculatedmessages[] = $formulaerrors;
+ if ($formulaerrors = qtype_calculated_find_formula_errors($answer)) {
+ print_error('formulaerror', 'quiz');
}
if (! isset($form->tolerance[$key])) {
$form->tolerance[$key] = 0.0;
}
if (! is_numeric($form->tolerance[$key])) {
- $calculatedmessages[] =
- get_string('tolerancemustbenumeric', 'quiz');
+ print_error('tolerancemustbenumeric', 'quiz');
}
}
- if (!empty($calculatedmessages)) {
- $errorstring = "The following errors were found:<br />";
- foreach ($calculatedmessages as $msg) {
- $errorstring .= $msg . '<br />';
- }
- print_error($errorstring);
- }
-
break;
default:
return parent::validate_form($form);
$result = $this->save_question_options($form);
if (!empty($result->error)) {
- print_error($result->error);
+ print_error('questionsaveerror', 'question', '', $result->error);
}
if (!empty($result->notice)) {