MDL-46600 core_grades: made it explicit in the error message that a failed grade import means nothing was imported.

This commit is contained in:
Andrew Davis
2014-08-07 09:17:04 +08:00
parent 6b7a5f86a0
commit 5bfbec5521
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -299,7 +299,7 @@ if ($formdata = $mform2->get_data()) {
// had to pick mapping
$status = false;
import_cleanup($importcode);
echo $OUTPUT->notification(get_string('importfailed', 'grades'));
// Relying on the default import failed message below.
break 3;
}
@@ -320,7 +320,7 @@ if ($formdata = $mform2->get_data()) {
// had to pick mapping
$status = false;
import_cleanup($importcode);
echo $OUTPUT->notification(get_string('importfailed', 'grades'));
// Relying on the default import failed message below.
break 3;
}
@@ -445,9 +445,11 @@ if ($formdata = $mform2->get_data()) {
/// at this stage if things are all ok, we commit the changes from temp table
if ($status) {
grade_import_commit($course->id, $importcode);
} else {
echo $OUTPUT->notification(get_string('importfailed', 'grades'));
}
} else {
// If data hasn't been submitted then display the data mapping form.
$mform2->display();
echo $OUTPUT->footer();
}
}
+1 -1
View File
@@ -351,7 +351,7 @@ $string['import'] = 'Import';
$string['importcsv'] = 'Import CSV';
$string['importcustom'] = 'Import as custom outcomes (only this course)';
$string['importerror'] = 'An error occurred, this script wasn\'t called with the right parameters.';
$string['importfailed'] = 'Import failed';
$string['importfailed'] = 'Import failed. No data was imported.';
$string['importfeedback'] = 'Import feedback';
$string['importfile'] = 'Import file';
$string['importfilemissing'] = 'No file was received, go back to the form and make sure to upload a valid file.';