Skip to content

Commit d3829bf

Browse files
authored
chore: mark auto-graded assignments as received (#64)
* chore: mark auto-graded assignments as received Signed-off-by: Anthony D. Mays <[email protected]> * chore: replace magic value Signed-off-by: Anthony D. Mays <[email protected]> --------- Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 07614fc commit d3829bf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/javascript/grader/src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ const GITHUB_CONFIG = {
2828
API_BASE: "https://api.github.com"
2929
} as const;
3030

31+
const GRADING_STATUS = {
32+
RECEIVED: "Received",
33+
GRADED: "Graded",
34+
INCOMPLETE: "Incomplete"
35+
} as const;
36+
37+
3138
/**
3239
* Main function to sync GitHub PRs with the grading sheet
3340
* This can be called manually or set up as a time-driven trigger
@@ -139,7 +146,7 @@ function processPullRequest(pr: any): {updated: boolean, message?: string} {
139146
// Update scores and status
140147
sheet.getRange(targetRow, GRADES_COLUMNS.FUNCTIONAL_SCORE).setValue(gradingResult.functionalScore);
141148
sheet.getRange(targetRow, GRADES_COLUMNS.TECHNICAL_SCORE).setValue(gradingResult.technicalScore);
142-
sheet.getRange(targetRow, GRADES_COLUMNS.GRADING_STATUS).setValue("Y");
149+
sheet.getRange(targetRow, GRADES_COLUMNS.GRADING_STATUS).setValue(GRADING_STATUS.RECEIVED);
143150

144151
return {updated: true, message: `Graded: F${gradingResult.functionalScore}/T${gradingResult.technicalScore}`};
145152
} else if (gradingResult.error && !gradingResult.error.includes("No grading instructions found")) {

0 commit comments

Comments
 (0)