Skip to content

Commit

Permalink
MDL-46600 core_grades: made it explicit in the error message that a f…
Browse files Browse the repository at this point in the history
…ailed grade import means nothing was imported.
  • Loading branch information
andyjdavis committed Aug 6, 2014
1 parent d29fb4a commit 23a62c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions grade/import/csv/index.php
Expand Up @@ -299,7 +299,7 @@
// 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;
}

Expand All @@ -320,7 +320,7 @@
// 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;
}

Expand Down Expand Up @@ -445,9 +445,11 @@
/// 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();
}
}
2 changes: 1 addition & 1 deletion lang/en/grades.php
Expand Up @@ -352,7 +352,7 @@
$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.';
Expand Down

0 comments on commit 23a62c4

Please sign in to comment.