Skip to content

Commit

Permalink
SAK-40363: Assignments > Upload All > silent failure if grades file i…
Browse files Browse the repository at this point in the history
…s wrong type
  • Loading branch information
dnhutchins authored and bjones86 committed Jul 23, 2018
1 parent 6dfacfb commit f8de0a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions assignment/bundles/resources/assignment.properties
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ uploadall.alert.wrongZipFormat=ZIP file is not in correct format. Please ensure
uploadall.alert.incorrectFormat=ZIP file is not in correct format.
uploadall.alert.invalidUserId=Please ensure that user id's correctly match those in the site and the folders are in the top level of the zip (not nested).
uploadall.alert.noGradeFile=Please ensure there is a grade file and correct folder structure.
uploadall.alert.nocsv=CSV grades file format was selected, but no grades.csv file was found at the root level.
uploadall.alert.noexcel=Excel grades file format was selected, but no grades.xls file was found at the root level.
downloadall.alert.choose.element=You must choose at lease one element in the download options.
uploadall.alert.zipFile=You have not selected a zip archive file. You must select either a .zip or a .sit archive file as the upload file.
uploadall.note=NOTICE: If you switch between languages in your preferences, for example English to Spanish, you will need to upload this archive in the same language as it was downloaded (or re-download and use a new archive).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13473,6 +13473,16 @@ else if (gradeType == PASS_FAIL_GRADE_TYPE) {

boolean zipError = false;

// generate error when there is no grade file yet it was selected
if (!zipHasGradeFile && hasGradeFile) {
if ("csv".equals(gradeFileFormat)) {
addAlert(state, rb.getString("uploadall.alert.nocsv"));
} else {
addAlert(state, rb.getString("uploadall.alert.noexcel"));
}
zipError = true;
}

// generate error when there is no grade file and no folder structure
if (!zipHasGradeFile && !zipHasFolder) {
addAlert(state, rb.getString("uploadall.alert.incorrectFormat"));
Expand Down

0 comments on commit f8de0a7

Please sign in to comment.