#!/bin/bash # Reward 1 if /app/answer.txt holds one exact number equal to the hidden reference (grader.py, exact sympy proof). # 0 is written before anything runs, so a crash, a timeout or a missing/linked/oversized answer scores 0. # Python runs isolated (-I -S); sympy/mpmath come from the pinned wheels in this directory (hash-checked, unpacked # offline into a new directory): nothing is installed and no network is used. ANSWER and VERIFIER_DIR override # the paths, to test the grader locally. case $0 in */*) here=${0%/*} ;; *) here=. ;; esac export ANSWER=${ANSWER:-/app/answer.txt} export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier} export TESTS_DIR=$here [ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt" timeout 150 python3 -B -I -S "$here/grade_task.py" || true