Skip to content

Commit

Permalink
fix score display and no comment bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
19mdavenport committed Jun 22, 2024
1 parent fa39fde commit f96a236
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/main/java/edu/byu/cs/autograder/score/Scorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Submission score(Rubric rubric, CommitVerificationResult commitVerificati

int daysLate = new LateDayCalculator().calculateLateDays(gradingContext.phase(), gradingContext.netId());
applyLatePenalty(rubric.items(), daysLate);
float thisScore = calculateScoreWithLatePenalty(rubric, daysLate);
float thisScore = getScore(rubric);

// Validate several conditions before submitting to the grade-book
if (!rubric.passed()) {
Expand Down Expand Up @@ -141,13 +141,10 @@ public void attemptSendToCanvas(Rubric rubric, int penaltyPct, String commitPena
* {@link Scorer#setCommitVerificationPenalty(CanvasRubricAssessment, GradingContext, CommitVerificationResult)}
* to reduce the score based on the latest data from the grade-book.
*/
CommitVerificationResult verification = null;
if (penaltyPct > 0) {
verification = new CommitVerificationResult(
CommitVerificationResult verification = new CommitVerificationResult(
true, true, 0, 0, 0,
penaltyPct, commitPenaltyMsg,
null, null, null, null);
}
attemptSendToCanvas(rubric, verification, forceSendScore);
}

Expand Down Expand Up @@ -331,13 +328,6 @@ private static float totalPoints(CanvasRubricAssessment assessment) {
return points;
}

private float calculateScoreWithLatePenalty(Rubric rubric, int numDaysLate) throws GradingException, DataAccessException {
float score = getScore(rubric);
score *= 1 - (numDaysLate * PER_DAY_LATE_PENALTY);
if (score < 0) score = 0;
return score;
}

/**
* Gets the score for the phase
*
Expand Down Expand Up @@ -389,7 +379,7 @@ private Submission generateSubmissionObject(Rubric rubric, CommitVerificationRes
String netId = gradingContext.netId();

if (numDaysLate > 0)
notes += numDaysLate + " days late. -" + (int)(numDaysLate * PER_DAY_LATE_PENALTY * 100) + "%";
notes += " " + numDaysLate + " days late. -" + (int)(numDaysLate * PER_DAY_LATE_PENALTY * 100) + "%";

ZonedDateTime handInDate = ScorerHelper.getHandInDateZoned(netId);
Submission.VerifiedStatus verifiedStatus;
Expand Down

0 comments on commit f96a236

Please sign in to comment.