Skip to content

Commit

Permalink
SAK-50432 Assignment conditions doesn't work on Spanish language (sak…
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusmmp authored Aug 28, 2024
1 parent f81422d commit 3519cec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.sakaiproject.site.api.Site;
import org.sakaiproject.timesheet.api.TimeSheetEntry;
import org.sakaiproject.user.api.User;
import org.sakaiproject.util.api.FormattedText;

/**
* <p>
Expand Down Expand Up @@ -888,5 +889,6 @@ public String getDeepLinkWithPermissions(String context, String assignmentId, bo
public String getAssignmentModifier(String modifier);

public boolean allowAddTags(String context);


public FormattedText getFormattedText();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5253,4 +5253,8 @@ public boolean allowAddTags(String context) {
String resourceString = AssignmentReferenceReckoner.reckoner().context(context).reckon().getReference();
return permissionCheck(TagService.TAGSERVICE_MANAGE_PERMISSION, resourceString, null);
}

public FormattedText getFormattedText() {
return formattedText;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public boolean evaluateCondition(Condition condition, String userId) {
// Filter by grades that have been released to the student
.filter(AssignmentSubmission::getGradeReleased)
// Map to grade
.map(submission -> assignmentService.getGradeForSubmitter(submission, userId))
.map(submission -> {
String grade = assignmentService.getGradeForSubmitter(submission, userId);
return StringUtils.replace(assignmentService.getGradeDisplay(grade, assignment.getTypeOfGrade(), assignment.getScaleFactor()), assignmentService.getFormattedText().getDecimalSeparator(), ".");
})
// Filter by valid values
.filter(NumberUtils::isParsable)
// Map to double
Expand Down

0 comments on commit 3519cec

Please sign in to comment.