Skip to content

feat: instructors can toggle between their assigned submissions and all submissions#8083

Open
YheChen wants to merge 8 commits into
MarkUsProject:masterfrom
YheChen:feat/instructors-toggle-assigned-submissions
Open

feat: instructors can toggle between their assigned submissions and all submissions#8083
YheChen wants to merge 8 commits into
MarkUsProject:masterfrom
YheChen:feat/instructors-toggle-assigned-submissions

Conversation

@YheChen

@YheChen YheChen commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)

Instructors can now switch between all submissions and only the submissions assigned to them in:

  • The assignment Submissions table
  • The assignment Grades summary table
  • The grading view's Next and Previous submission navigation

Instructors continue to see all submissions by default, while TAs retain their existing assigned-submissions default. Admin roles remain excluded because they cannot be assigned as graders.

This PR also:

  • Identifies instructor-assigned groupings in submission and summary data
  • Preserves saved grading-view submission scope preferences
  • Adds regression tests for instructor filtering, navigation, role defaults, and admin exclusion
  • Updates the instructor documentation to describe the new controls

This is the second incremental part of #1221.
Ref #1221

Screenshots of your changes (if applicable)

Assignment submissions view

image

Assignment grades view

image

Filter Submissions modal on grading view

image

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
📖 Documentation update (change that updates documentation) X
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • 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

(Include any questions or comments you have regarding your changes.)

@YheChen YheChen changed the title feat: instructors can toggle between their assigned submissions and all submissions WIP: feat: instructors can toggle between their assigned submissions and all submissions Jul 23, 2026
@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30213390512

Coverage increased (+0.02%) to 90.49%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 98 of 98 lines across 7 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: 51571
Covered Lines: 47694
Line Coverage: 92.48%
Relevant Branches: 2496
Covered Branches: 1231
Branch Coverage: 49.32%
Branches in Coverage %: Yes
Coverage Strength: 128.96 hits per line

💛 - Coveralls

@YheChen YheChen changed the title WIP: feat: instructors can toggle between their assigned submissions and all submissions feat: instructors can toggle between their assigned submissions and all submissions Jul 24, 2026
@YheChen
YheChen requested a review from david-yz-liu July 25, 2026 21:14
@YheChen

YheChen commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

i forgot to add screenshots, getting them right now

- **Section**: Filter submissions using the section of the associated group's inviter.
- **Graders**: Instructors can select multiple graders to filter all submissions that have at least one of the specified graders assigned to them.
- **Submission Scope**: Graders with the "Manage submissions" permission can choose whether the "Next" and "Previous" buttons navigate through "My assigned submissions" or "All submissions". The "My assigned submissions" option is enabled by default. Graders without this permission continue to navigate only their assigned submissions.
- **Submission Scope**: Instructors and graders with the "Manage submissions" permission can choose whether the "Next" and "Previous" buttons navigate through "My assigned submissions" or "All submissions". Instructors start with "All submissions" selected, while graders start with "My assigned submissions" selected. Graders without this permission continue to navigate only their assigned submissions.

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.

We should switch the language here to "TAs" instead of "Graders"

- The **"Tags"** column lists any tags created for the submission.

Graders with the **Manage submissions** permission can view all submissions for an assignment from this table. These graders can use the **"Display assigned submissions only"** checkbox to switch between all submissions and only the submissions assigned to them. Graders without this permission remain limited to their assigned submissions and do not see this control. Instructors continue to view all submissions.
Instructors and graders with the **Manage submissions** permission can use the **"Display assigned submissions only"** checkbox to switch between all submissions and only the submissions assigned to them. The checkbox is cleared by default for instructors and selected by default for graders. Graders without this permission remain limited to their assigned submissions and do not see this control.

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.

Same as above, let's say "TAs" instead of "Graders"

const filterData = restoreFilterData(this.props.role, filterStorageKey);

const filterChanged = JSON.stringify(this.state.filterData) !== JSON.stringify(filterData);
this.setState(

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.

This logic doesn't need to change this much. If filterChanged is true then call updateFilterData and let it handle the state updating and calling this.fetchGroupingIds. If filterChanged is false then no setState needs to be called, and instead the existing logic for prefetching the grouping ids in componentDidMount can remain the same. No need for an onComplete callback, just return from this function whether a change occurred or not.

@@ -0,0 +1,52 @@
export const getInitialFilterData = role => ({

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.

Creating a new file here is okay, but please add documentation for the functions moved into this file.

refreshFilterData = () => {
const storedFilter = localStorage.getItem(
`${this.props.user_id}_${this.state.assignment_id}_filterData`
filterStorageKey = () => getFilterStorageKey(this.props.user_id, this.state.assignment_id);

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.

You can keep filterStorageKey but inline the definition of getFilterStorageKey, I don't think that's useful

export const getFilterStorageKey = (userId, assignmentId) => `${userId}_${assignmentId}_filterData`;

export const restoreFilterData = (role, filterStorageKey) => {
const submissionScopeVersionKey = `${filterStorageKey}_submissionScopeVersion`;

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.

I don't think it's worth creating a versioning key for this. Instead, you can merge storedFilter with getInitialFilterData to fill in any new defaults.

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