Skip to content

Commit 672b500

Browse files
committed
ci: ensure consistent test scoring
1 parent 6bbd85c commit 672b500

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/classroom-autograding.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ env:
77
GRADING_REPO: cbfacademy/autograding-java-exercises
88
GRADING_REPO_PATH: grading-repo
99
STUDENT_REPO_PATH: student-repo
10+
MAX_TESTS: ${{ vars.MAX_TESTS || 42 }}
11+
TEST_SCORE_MARKS: ${{ vars.TEST_SCORE_MARKS || 70 }}
12+
AGENT_SCORE_MARKS: ${{ vars.AGENT_SCORE_MARKS || 30 }}
1013

1114
jobs:
1215
autograding:
@@ -71,7 +74,7 @@ jobs:
7174
const passed = parseInt(${{ steps.parse.outputs.passed || 0 }}, 10);
7275
const failed = parseInt(${{ steps.parse.outputs.failed || 0 }}, 10);
7376
const skipped = parseInt(${{ steps.parse.outputs.skipped || 0 }}, 10);
74-
const total = (passed + failed + skipped) || 70;
77+
const total = ${env.MAX_TESTS};
7578
const result = `${passed}/${total}`
7679
7780
core.setOutput('total', total);
@@ -286,12 +289,12 @@ jobs:
286289
return { earned, available };
287290
}
288291
289-
// Parse grade-tests result (e.g., 34/42)
292+
// Parse get-tests-score result (e.g., 34/42), scale to 70%
290293
const testsResult = '${{ steps.get-tests-score.outputs.result }}';
291-
const tests = parseResult(testsResult, 70);
292-
// Parse grade-ai result (e.g., 27/100), scale to 30
294+
const tests = parseResult(testsResult, ${env.TEST_SCORE_MARKS});
295+
// Parse get-agent-score result (e.g., 27/100), scale to 30%
293296
const aiResult = '${{ steps.get-agent-score.outputs.result }}';
294-
const ai = parseResult(aiResult, 30);
297+
const ai = parseResult(aiResult, ${env.AGENT_SCORE_MARKS});
295298
// Sum
296299
const totalEarned = tests.earned + ai.earned;
297300
const totalAvailable = tests.available + ai.available;

0 commit comments

Comments
 (0)