Skip to content

bugfix: random assignment after grader filtering#8073

Merged
david-yz-liu merged 3 commits into
MarkUsProject:masterfrom
YheChen:bug/random-assignment-filtered-graders
Jul 23, 2026
Merged

bugfix: random assignment after grader filtering#8073
david-yz-liu merged 3 commits into
MarkUsProject:masterfrom
YheChen:bug/random-assignment-filtered-graders

Conversation

@YheChen

@YheChen YheChen commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Ensure random grader assignment uses only the TA IDs accepted by Grouping.assign_tas.

Previously, randomly_assign_tas calculated assignment counts from the original submitted IDs and ignored the filtered TA IDs yielded by assign_tas. A filtered-out role, such as a student, could therefore be reintroduced into the generated membership pairs. Its requested weight also remained part of the workload calculation.

This PR:

  • preserves each submitted weight by role ID;
  • calculates the total and assignment counts after assign_tas filters the IDs;
  • constructs membership pairs using only the filtered IDs;
  • returns no assignments when no eligible weighted TAs remain; and
  • adds a regression test confirming that an invalid role with a larger weight is excluded and the valid TA receives all selected groups.

Valid random-assignment requests retain the existing relative weighting behavior. This is a focused follow-up to the review discussion in #8060 and is independent of #8072.

Screenshots of your changes (if applicable)

Type of Change

Type Applies?
🚨 Breaking change
✨ New feature
🐛 Bug fix X
🎨 User interface change
♻️ Refactoring
🚦 Test update
📦 Dependency update
📖 Documentation update
🔧 Internal

Checklist

Before opening this pull request:

  • I have performed a self-review of my changes.
  • I have added tests for my changes.
  • I have updated the project documentation, if applicable.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening this pull request:

  • I have updated the project Changelog.
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

@coveralls

coveralls commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29963842412

Coverage increased (+0.001%) to 90.415%

Details

  • Coverage increased (+0.001%) from the base build.
  • Patch coverage: 13 of 13 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 51302
Covered Lines: 47400
Line Coverage: 92.39%
Relevant Branches: 2470
Covered Branches: 1218
Branch Coverage: 49.31%
Branches in Coverage %: Yes
Coverage Strength: 127.86 hits per line

💛 - Coveralls

@YheChen YheChen changed the title Fix random assignment after grader filtering bugfix: random assignment after grader filtering Jul 21, 2026
@YheChen
YheChen requested a review from david-yz-liu July 21, 2026 23:47

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work, @YheChen!

@david-yz-liu
david-yz-liu merged commit 099a27e into MarkUsProject:master Jul 23, 2026
8 checks passed
@YheChen
YheChen deleted the bug/random-assignment-filtered-graders branch July 23, 2026 21:13
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