Skip to content

Commit

Permalink
SAK-47743 Make GradingService.updateExternalAssessment accept a categ…
Browse files Browse the repository at this point in the history
…ory parameter (sakaiproject#10833)
  • Loading branch information
jkozar2 authored Oct 3, 2022
1 parent 68c75df commit 2c41110
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@ public void updateExternalAssessment(String gradebookUid, String externalId, Str
String title, Double points, Date dueDate, Boolean ungraded)
throws AssessmentNotFoundException, ConflictingAssignmentNameException, AssignmentHasIllegalPointsException;

public void updateExternalAssessment(String gradebookUid, String externalId, String externalUrl, String externalData, String title, Long categoryId, Double points, Date dueDate, Boolean ungraded)
throws AssessmentNotFoundException, ConflictingAssignmentNameException, AssignmentHasIllegalPointsException;

/**
* Remove the assessment reference from the gradebook. Although Samigo
* doesn't currently delete assessments, an instructor can retract an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4289,7 +4289,13 @@ public void addExternalAssessment(final String gradebookUid, final String extern
}

@Override
public void updateExternalAssessment(final String gradebookUid, final String externalId, final String externalUrl, String externalData, final String title,
public void updateExternalAssessment(String gradebookUid, String externalId, String externalUrl, String externalData, String title, Double points, Date dueDate, Boolean ungraded)
throws AssessmentNotFoundException, ConflictingAssignmentNameException, AssignmentHasIllegalPointsException {
updateExternalAssessment(gradebookUid, externalId, externalUrl, externalData, title, null, points, dueDate, ungraded);
}

@Override
public void updateExternalAssessment(final String gradebookUid, final String externalId, final String externalUrl, String externalData, final String title, Long categoryId,
final Double points, final Date dueDate, final Boolean ungraded)
throws AssessmentNotFoundException, ConflictingAssignmentNameException, AssignmentHasIllegalPointsException {
final Optional<GradebookAssignment> optAsn = getDbExternalAssignment(gradebookUid, externalId);
Expand Down Expand Up @@ -4328,6 +4334,9 @@ public void updateExternalAssessment(final String gradebookUid, final String ext
} else {
asn.setUngraded(false);
}
if (categoryId != null) {
asn.setCategory(getCategory(categoryId));
}
gradingPersistenceManager.saveGradebookAssignment(asn);

log.info("External assessment updated in gradebookUid={}, externalId={} by userUid={}", gradebookUid, externalId, getUserUid());
Expand Down

0 comments on commit 2c41110

Please sign in to comment.