Skip to content

Commit

Permalink
Autograder now correctly handles if extra data does not exist in rate…
Browse files Browse the repository at this point in the history
…limiting
  • Loading branch information
ThaumicMekanism committed Mar 3, 2021
1 parent 111da51 commit 7f63c4f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Autograder.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,15 @@ def pretty_time_str(s, m, h, d):
print(str(self.metadata["previous_submissions"][i].keys()))
print("Current submission data: " + str(self.metadata["previous_submissions"][i]["results"]["extra_data"]))
ed = self.metadata["previous_submissions"][i]["results"]["extra_data"]
subID = ed.get("id")
if (ed["sub_counts"] == 1) and (subID and (subID not in self.rate_limit.submission_id_exclude)):
if oldest_counted_submission is None:
oldest_counted_submission = subm_time
tokens_used = tokens_used + 1
if ed is not None:
subID = ed.get("id")
if (ed["sub_counts"] == 1) and (subID and (subID not in self.rate_limit.submission_id_exclude)):
if oldest_counted_submission is None:
oldest_counted_submission = subm_time
tokens_used = tokens_used + 1
else:
if verbose:
print(f"Extra data not available in previous submission {i}!")
except Exception as e:
import traceback
traceback.print_exc()
Expand Down

0 comments on commit 7f63c4f

Please sign in to comment.