Skip to content

Conversation

@m4teuk
Copy link

@m4teuk m4teuk commented Dec 31, 2025

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).
image
image

@m4teuk m4teuk marked this pull request as ready for review December 31, 2025 18:19
@m4teuk m4teuk requested a review from MasloMaslane as a code owner December 31, 2025 18:19
@m4teuk m4teuk requested a review from twalen December 31, 2025 18:19
Copy link
Member

@MasloMaslane MasloMaslane left a 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?

Comment on lines +173 to +188
# 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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants