diff --git a/src/admin/problem/components/TestcaseGenerator.vue b/src/admin/problem/components/TestcaseGenerator.vue
index 6e548f9..d3a33f5 100644
--- a/src/admin/problem/components/TestcaseGenerator.vue
+++ b/src/admin/problem/components/TestcaseGenerator.vue
@@ -121,9 +121,10 @@ async function upload() {
const res = await uploadTestcases(file)
const testcases: Testcase[] = res.data.info
- const scoreStr = (100 / testcases.length).toFixed(0)
- testcases.forEach((tc) => {
- tc.score = scoreStr
+ const baseScore = Math.floor(100 / testcases.length)
+ const remainder = 100 - baseScore * testcases.length
+ testcases.forEach((tc, i) => {
+ tc.score = String(i === testcases.length - 1 ? baseScore + remainder : baseScore)
})
emit("uploaded", res.data.id, testcases)
@@ -147,8 +148,8 @@ async function upload() {
placeholder="无答案"
/>
清空
- +1
- +5
+ +1
+ +5
@@ -197,7 +198,7 @@ async function upload() {