feat: instructors can toggle between their assigned submissions and all submissions#8083
Conversation
Coverage Report for CI Build 30213390512Coverage increased (+0.02%) to 90.49%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
|
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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 => ({ | |||
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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.
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:
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:
This is the second incremental part of #1221.
Ref #1221
Screenshots of your changes (if applicable)
Assignment submissions view
Assignment grades view
Filter Submissions modal on grading view
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)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:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)