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

Make 'create_problem' command work and add options #2256

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

Conversation

DapperX
Copy link

@DapperX DapperX commented May 12, 2023

Corresponding to the issue #2255

Commit details:

  • properly assign types to match Django's new rules
  • initialize fields of time_limit, memory_limit, and points to be able to save the model
  • add options --partial-points and --all-languages to make added problems immediately usable in automation

properly assign 'types' to match Django's new rules
initialize fields of 'time_limit', 'memory_limit', and 'points' to be able to save the model
add options '--partial-points' and '--all-languages' to make added problems immediately usable in automation
judge/management/commands/create_problem.py Outdated Show resolved Hide resolved
judge/management/commands/create_problem.py Outdated Show resolved Hide resolved
problem.time_limit = options["time_limit"]
problem.memory_limit = options["memory_limit"]
problem.points = options["points"]
if options['pr_pts']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this if necessary? It seems we can just do

problem.partial = options['pr_pts']

Copy link
Author

@DapperX DapperX May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this for not assuming the default value of this field, i.e., if Allows partial points is enabled by default at some points, the code should still work, though I don't have strong opinions about this.

judge/management/commands/create_problem.py Outdated Show resolved Hide resolved
Correction for the build #5492
Copy link
Author

@DapperX DapperX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed for the build #5492

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.05 ⚠️

Comparison is base (81f3c90) 47.05% compared to head (52342c7) 47.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2256      +/-   ##
==========================================
- Coverage   47.05%   47.00%   -0.05%     
==========================================
  Files         249      249              
  Lines       13209    13222      +13     
==========================================
  Hits         6215     6215              
- Misses       6994     7007      +13     
Impacted Files Coverage Δ
judge/management/commands/create_problem.py 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

3 participants