diff --git a/pkg/problems/tasktype/batch/batch.go b/pkg/problems/tasktype/batch/batch.go index 2def1e3d..4ebec8fb 100644 --- a/pkg/problems/tasktype/batch/batch.go +++ b/pkg/problems/tasktype/batch/batch.go @@ -303,16 +303,17 @@ func (b Batch) Run(judging problems.Judgeable, sp *language.SandboxProvider, lan } if _, ok := testCache[tc.InputPath]; ok { - tmpIndex, tmpGroup := tc.Index, tc.Group - maxScore := tc.MaxScore - *tc = *testCache[tc.InputPath] - tc.Index = tmpIndex - tc.Group = tmpGroup - if tc.MaxScore > 0 { + if testCache[tc.InputPath].MaxScore > 0 { + tmpIndex, tmpGroup := tc.Index, tc.Group + maxScore := tc.MaxScore + *tc = *testCache[tc.InputPath] + tc.Index = tmpIndex + tc.Group = tmpGroup + tc.Score = tc.Score / tc.MaxScore * maxScore tc.MaxScore = maxScore + continue } - continue } testCache[tc.InputPath] = tc