Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit 252252a

Browse files
authored
floor of 0; fix cwid issue where cwids are sometimes ints (#67)
1 parent 16510b7 commit 252252a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

FileHelpers/csvLoaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def loadGradescope(_filename):
113113

114114
gradescopeDF.rename(columns={'Lateness': 'hours_late'}, inplace=True)
115115
# All NaN values should be handled at this point
116-
gradescopeDF = gradescopeDF.astype({'hours_late': "float"}, copy=False)
116+
gradescopeDF = gradescopeDF.astype({'hours_late': "float", 'SID': "string"}, copy=False)
117117

118118
gradescopeDF.rename(columns={'SID': 'multipass'}, inplace=True)
119119
print("Done.")

Grade/grade.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ def calculateLatePenalty(_gradescopeDF: pd.DataFrame, _specialCasesDF: pd.DataFr
321321
_gradescopeDF.at[i, 'lateness_comment'] = \
322322
f"-{(1 - latePenalty[daysLate]) * 100:02.0f}%25: {daysLate} {pluralizedDays} late"
323323

324+
_gradescopeDF.at[i, 'Total Score'] = max(_gradescopeDF.at[i, 'Total Score'], 0)
325+
326+
324327
# the only possible case here is if a student has a special case requested but was not found in gradescope
325328
if not _specialCasesDF.empty and specialCaseStudents != len(
326329

0 commit comments

Comments
 (0)