Skip to content

Commit

Permalink
fix wrong access check, improve debugging experience
Browse files Browse the repository at this point in the history
  • Loading branch information
Feuermagier committed Nov 14, 2024
1 parent bf92b0a commit 3ebd784
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private boolean canAssess(ResultDTO result) throws ArtemisNetworkException {
// or if we are an instructor (who can overwrite any assessment)
var assessor = this.getConnection().getAssessor();
return result.assessor() == null
|| result.assessor().id() != assessor.getId()
|| result.assessor().id() == assessor.getId()
|| this.getCourse().isInstructor(assessor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public int hashCode() {
@Override
public String toString() {
return "RatingGroup[" + "id=" + id + ", " + "displayName=" + displayName.getDefaultTranslationPattern() + ", "
+ "minPenalty=" + minPenalty + ", " + "getMaxPenalty=" + maxPenalty + ", " + "mistakeTypes="
+ mistakeTypes + ']';
+ "minPenalty=" + minPenalty + ", " + "getMaxPenalty=" + maxPenalty + ']';
}

record RatingGroupDTO(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ public Points calculatePoints(List<Annotation> annotations) {
double penaltyPoints = multiplier * -this.penalty;
return new Points(penaltyPoints, this.maxUses != null && annotations.size() > this.maxUses);
}

public int getMaxUses() {
return maxUses;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public String getDefaultTranslationPattern() {

@Override
public String toString() {
throw new IllegalStateException("Format & translate this string before using it.");
return "!!!Format & translate this string before using it!!!";
}

private static MessageFormat escapeStringForMessageFormat(String string, Locale locale) {
Expand Down

0 comments on commit 3ebd784

Please sign in to comment.