Skip to content

Commit

Permalink
task_yaml: accept float scores in score_type_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed May 2, 2024
1 parent b9e9d88 commit 185ae80
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/problems/config/task_yaml/task_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,15 @@ func (p Problem) StatusSkeleton(name string) (*problems.Status, error) {

if len(testsLeft) == 1 {
if !isSum {
tc.MaxScore = float64(p.ScoreTypeParameters[subtask][0].(int))
v := p.ScoreTypeParameters[subtask][0]
switch v.(type) {
case float64:
tc.MaxScore = v.(float64)
case int:
tc.MaxScore = float64(v.(int))
default:
return nil, errors.New("task_yaml: wrong score format")
}
}
subtask++
testsLeft = testsLeft[1:]
Expand Down

0 comments on commit 185ae80

Please sign in to comment.