Skip to content

Conversation

@Jankwi
Copy link

@Jankwi Jankwi commented Dec 17, 2025

This PR expands the mass_create_tool's capabilities, by enabling creating a contest and populating it with submissions from auto generated users. This should make testing new features easier for developers.

E.G.
mass_create_tool -cn demo -cc -pp test_full_package.tgz -u 10 -sf sum-correct.cpp sum-various-results.cpp -spu 3 --wipe
This command wipes all other mass generated data, creates a contest called "demo" and adds 10 users to it, with 3 submissions (drawn randomly out of [ sum-correct.cpp, sum-various-results.cpp]) to the example problem each.

Commands for the mass_create_tool can be called through manage.py.

Closes #603

twalen and others added 7 commits December 17, 2025 14:30
This commit allows for creating and populating (with users & problems) contests,
using the mass_create_tool management command. Two new arguments are added:
--createcontest (-cc) to enable contest creation, and --contestname (-cn) to specify the contest's name.
Previously, the mass_create_tool only created empty problems.

This commit changes that by adding a list of problem_packages (-pp)
as an option to the tool. The tool searches the oioioi/sinolpack/files/ directory
for the specified problem packages and uploads them to the created contest.

Example command enabled by this commit:

    python3 manage.py mass_create_tool -cn=quite_useful_contest -cc -pp=test_full_package.tgz -u=10 --wipe

    ^ (This will create a contest named 'quite_useful_contest' with 10 users,
       and upload 'test_full_package.tgz' to a new round in that contest.)
Previously the mass_create_tool could only be used for creating uers, problems and contests.
This commit makes it possible to automatically generate code submissions on behalf of users.
@Jankwi Jankwi force-pushed the mct_expansion branch 4 times, most recently from 150bfe9 to cbfd117 Compare January 6, 2026 18:55
This commit also  removes the unnecessary line change in admin.py - it was experimental.
@Jankwi Jankwi marked this pull request as ready for review January 7, 2026 13:41
@Jankwi Jankwi requested a review from MasloMaslane as a code owner January 7, 2026 13:41
Copilot AI review requested due to automatic review settings January 7, 2026 13:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request expands the mass_create_tool management command to create contests populated with automatically generated submissions, enabling more comprehensive testing and benchmarking scenarios.

Key Changes:

  • Added contest creation functionality with automatic user registration and submission generation
  • Introduced support for creating problems from package files
  • Extended the wipe functionality to clean up generated contests and submissions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.

File Description
oioioi/problems/tests/test_commands.py Added test cases for contest creation with problem packages, users, and submissions; updated assertion logic to handle submissions from auto-generated users
oioioi/problems/management/commands/mass_create_tool.py Implemented contest creation with problem instances, user registration, and submission generation; added methods for package-based problem creation and submission file handling; extended cleanup to remove generated contests and submissions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jankwi
Copy link
Author

Jankwi commented Jan 7, 2026

Unit tests were added, and the PR is now ready for review.

This PR expands the mass_create_tool's capabilities, by enabling creating a contest and populating it with submissions from auto generated users. This should make testing new features easier for developers.

E.G.
mass_create_tool -cn demo -cc -pp test_full_package.tgz -u 10 -sf sum-correct.cpp sum-various-results.cpp -spu 3 --wipe
This command wipes all other mass generated data, creates a contest called "demo" and adds 10 users to it, with 3 submissions (drawn randomly out of [ sum-correct.cpp, sum-various-results.cpp]) to the example problem each.

Commands for the mass_create_tool can be called through manage.py.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Jankwi Jankwi self-assigned this Jan 7, 2026
@Jankwi Jankwi requested a review from twalen January 7, 2026 14:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Expand mass_create_tool's capabilities

2 participants