Skip to content

Commit 06629ac

Browse files
committed
Velocity: Zero score on module fail
Downstream modules might expect a score!
1 parent 8bd2c7c commit 06629ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bsag/steps/gradescope/limit_velocity.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from bsag.bsagio import BSAGIO
99
from bsag.utils.datetimes import ZERO_TD, format_datetime
1010

11-
from ._types import METADATA_KEY, SubmissionMetadata
11+
from ._types import METADATA_KEY, SubmissionMetadata, Results, RESULTS_KEY
1212

1313
EXTRA_TOKENS_KEY = "extra_tokens"
1414
"""Used by `gradescope.limit_velocity` to add extra velocity tokens. If not present, then 0 tokens are added.
@@ -130,4 +130,8 @@ def run(cls, bsagio: BSAGIO, config: LimitVelocityConfig) -> bool:
130130
recharge_time = format_datetime(recharge_at, config.time_zone, config.time_format)
131131
bsagio.student.info(f"Your next recharge will occur at {recharge_time}.")
132132

133+
if tokens_avail >= 0:
134+
res: Results = bsagio.data[RESULTS_KEY]
135+
res.score = 0
136+
133137
return tokens_avail >= 0

0 commit comments

Comments
 (0)