Skip to content

Commit

Permalink
simplified json output
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverLok committed Aug 6, 2024
1 parent aa881a9 commit 8c372c5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions testdata/course-languages/bash/grader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,17 @@ function grade() {
test_add -1 2 1 "one negative" || { score=$((score-2)); message+="Missed test case 'one negative'. "; }
test_add -1 -2 -3 "all negative" || { score=$((score-2)); message+="Missed test case 'all negative'. "; }

local json_output=$(cat <<EOF
{
local json_output='{
"name": "bash",
"questions": [
{
"name": "Task 1: add()",
"max_points": 10,
"score": $score,
"message": "$message"
"score": '"$score"',
"message": "'"$message"'"
}
]
}
EOF
)
}'

echo "$json_output"
}
Expand Down

0 comments on commit 8c372c5

Please sign in to comment.