-
Notifications
You must be signed in to change notification settings - Fork 95
Feature: last submission status #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
MasloMaslane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I don't really like that the badge is next to the title. Maybe it could be immediately to the left of the score?
| # Bulk fetch user's submissions for the problem instances and build a map | ||
| # of latest submission per problem instance. Submissions are ordered by | ||
| # date descending, so the first occurrence for a given problem_instance | ||
| # is the latest one. | ||
| submissions_qs = ( | ||
| Submission.objects.filter( | ||
| user__id=request.user.id, | ||
| problem_instance_id__in=pi_ids, | ||
| kind="NORMAL" # ignore ignored submissions | ||
| ) | ||
| .order_by("-date") | ||
| ) | ||
| for s in submissions_qs: | ||
| pid = s.problem_instance_id | ||
| if pid not in last_submission_map: | ||
| last_submission_map[pid] = s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it shouldn't always fetch last submission, for example in some contests max submission counts as the score (OI, OIJ).
In this PR #405 there are functions implemented that return scored submission effectively. Maybe you can copy them here.
Added a badge to each problem row in the problems tab. The badge display the status of the users last submission for that problem, like "Initial tests: failed" or "Pending". It is displayed only for normal (not ignored submissions).

