Skip to content

Commit

Permalink
SAK-47866 Changing the name of a published test associated to a grade…
Browse files Browse the repository at this point in the history
…book item, and republishing it will cause the gradebook item not to be updated
  • Loading branch information
josecebe authored and Miguel Pellicer committed Sep 22, 2022
1 parent be2ed72 commit 085450e
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,14 @@ private void updateGB(PublishedAssessmentFacade assessment) {
if (evaluation.getToGradeBook() != null && evaluation.getToGradeBook().equals(EvaluationModelIfc.TO_DEFAULT_GRADEBOOK.toString())) {

String assessmentName = TextFormat.convertPlaintextToFormattedTextNoHighUnicode(assessment.getTitle().trim());
boolean gbItemExists = false;
try {
gbItemExists = gbsHelper.isAssignmentDefined(assessmentName, g);
} catch (Exception e1) {
log.info("assessment does not exist: {}", assessmentName);
}


try {
if (!gbItemExists) {
log.debug("before gbsHelper.addToGradebook()");
gbsHelper.addToGradebook((PublishedAssessmentData) assessment.getData(), null, g);
} else {
try {
log.debug("before gbsHelper.updateGradebook()");
gbsHelper.updateGradebook((PublishedAssessmentData) assessment.getData(), g);
} catch (Exception ex) {
log.warn("Gradebook item does not exist for assessment {}, creating a new gradebook item", assessment.getAssessmentId());
gbsHelper.addToGradebook((PublishedAssessmentData) assessment.getData(), null, g);
}

// any score to copy over? get all the assessmentGradingData and copy over
Expand Down

0 comments on commit 085450e

Please sign in to comment.