Skip to content
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

Add problem type voting feature #386

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

magnified103
Copy link
Contributor

@magnified103 magnified103 commented Mar 23, 2024

Solved users are able to suggest problem types. These votes are aggregated per-type and the numbers are shown in the problem edit.

Only public problems (is_public=True and is_organization_private=False) are able to use this feature.

Add automated problem type voting
If the number of distinct voters exceeds VNOJ_PROBLEM_TYPE_VOTING_VOTERS_THRESHOLD:

  • Sort the votes of each type in descending order

  • Filter the types whose number of votes exceeds VNOJ_PROBLEM_TYPE_VOTING_VOTES_LOWERBOUND

  • Get the first VNOJ_PROBLEM_TYPE_VOTING_TYPES_UPPERBOUND records

Show problem types after solving

Description

Type of change: new feature

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have explained the purpose of this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the README/documentation
  • Any dependent changes have been merged and published in downstream modules
  • Informed of breaking changes, testing and migrations (if applicable).
  • Attached screenshots (if applicable).

By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.

@magnified103 magnified103 force-pushed the tag-suggestion branch 5 times, most recently from 24f7e45 to f961e0d Compare March 24, 2024 15:37
Solved users are able to suggest problem types. These votes are aggregated per-type and the numbers are shown in the problem edit.

Only public problems (is_public=True and is_organization_private=False) are able to use this feature.

Migration: set type voting as default for all public problems
If the number of distinct voters exceeds VNOJ_PROBLEM_TYPE_VOTING_VOTERS_THRESHOLD:
  - Sort the votes of each type in descending order
  - Filter the types whose number of votes exceeds VNOJ_PROBLEM_TYPE_VOTING_VOTES_LOWERBOUND
  - Get the first VNOJ_PROBLEM_TYPE_VOTING_TYPES_UPPERBOUND records
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.

1 participant