[Feature:InstructorUI] Add Manage Teams UI for Instructors#12909
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12909 +/- ##
============================================
- Coverage 21.49% 21.40% -0.10%
- Complexity 9896 9928 +32
============================================
Files 268 268
Lines 36992 37109 +117
Branches 495 495
============================================
- Hits 7953 7943 -10
- Misses 28548 28675 +127
Partials 491 491
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
NicholasCiuica
left a comment
There was a problem hiding this comment.
I tested this PR by making subsections spanning across registration sections and then using the "Create Teams from Registration Sections", "Create Single-Student Teams", and "Delete All Teams" buttons.
I found the following error: if an instructor joins a team, then leaves it using the "Leave Team" button on the "Manage Teams" page, the "Delete All Teams" button will no longer function, and clicking it gives this error in the console:
I also have a recommendation for wording: when deleting all teams, the alert popup does not mention that teams with instructors on them will not be deleted. I left comments on sections where this note about instructor teams isn't mentioned.
Besides what is listed above, worked correctly, and the code is well commented and organized.
| const url = buildCourseUrl(['gradeable', '{{ gradeable_id }}', 'team', 'delete_all_teams']); | ||
| const message = "WARNING: Are you sure you want to all teams for this gradeable?\n\n" + | ||
| "Teams that have already made a submission will be SKIPPED and preserved.\n" + | ||
| "Teams without any submissions will be permanently deleted."; |
There was a problem hiding this comment.
This alert does not include the fact that instructor teams also will not be deleted.
| $deleted_count++; | ||
| } | ||
|
|
||
| $result = "Successfully deleted {$deleted_count} teams. Skipped {$skipped_count} teams with submissions."; |
There was a problem hiding this comment.
The instructor team is mistakenly added to the skipped_count because they are not deleted regardless of submission.
@NicholasCiuica I fixed the above changes to wording / count calculation. As we discussed yesterday, I could not reproduce the error you were experiencing. Additionally, I have now added exception catching to deleteTeam() in DatabaseQueries.php. Here is what the error message looks like, except I did fix the spacing issue :) If you want to test the exception handling, just remove the |
NicholasCiuica
left a comment
There was a problem hiding this comment.
I tested this PR and approve of the changes made. I tested that making subsection teams worked correctly and did not add students in the null section to teams matching their subsection. The button to make solo teams for students not in teams also works and correctly ignored the null section. The button to delete all teams correctly ignores empty teams, teams with an instructor, and teams with a submission, and mentions why everything was deleted (except empty teams, which currently is intended behavior). I tested that teams that students had edited (made invitations, changed members, changed name) could still be properly deleted.
…12909) ### Why is this Change Important & Necessary? <!-- Include any GitHub issue that is fixed/closed using "Fixes #<number>" or "Closes #<number>" syntax. Alternately write "Partially addresses #<number>" or "Related to #<number>" as appropriate. --> Closes Submitty#12799 ### What is the New Behavior? Added a Manage Teams section in the Instructor View on Team Gradeables. Instructors can now see how many teams exist for the gradeable, and have some options to generate teams for their students: 1. Create Teams from Registration Subsections will group students into teams based on their registration subsection. Additionally it will set the team name to be the registration subsection name. 2. Create Single Student Teams will put each student without a team onto their own, personal team. 3. Delete All Teams will delete every team that hasn't made a submission yet, except for any team the Instructor-level user is on. <img width="1920" height="951" alt="Screenshot 2026-06-16 at 16-07-38 Manage Team For manage teams ui - Sample" src="https://github.com/user-attachments/assets/8d7de462-2a3e-48e2-8008-e9f294fa773f" /> ### What steps should a reviewer take to reproduce or test the bug or new feature? 1. checkout the branch and run submitty_install_site :) 2. Create a new team gradeable as instructor. You can see the new feature by navigating to the create / manage team page from the gradeables page. 3. Make some registration subsections in the Manage Students page, test different configurations of subsections across sections, etc. 4. Test the create teams from registration subsections feature and verify that: - the numbers on the confirm window make sense, and the numbers on the manage teams page update accordingly - teams are properly created from the subsections. if there is a team size limit, it is ignored and the entire subsection is put on one team. is this desired? - Students on a registration subsection that are already on a team should not be moved to the subsection team 5. Test the Create Single Student teams and verify that each teamless student is put on their own team 6. Test the Delete All Teams button and verify that teams with submissions are not deleted, and teams with the instructor on them are not deleted. All of these instructor features should work even if the team lock date has passed. Additionally, if you have any wording / UI suggestions, please let me know. ### Automated Testing & Documentation This feature is not covered by e2e tests, which should be made in a separate PR. ### Other information If there is some sort of connection to a team that is being deleted, the database will throw an error as the ajax JSON response (ie frog robot). Hopefully this never happens, but it does mean the feature is relatively safe. --------- Co-authored-by: Nick Ciuica <[email protected]>
### Why is this Change Important & Necessary? In #12909 I added some features for instructors to manage teams for their class. These features include: creating teams from subsections, creating single-student teams, and deleting all teams (without submissions). However, I did not add Cypress e2e testing for these features. ### What is the New Behavior? Cypress e2e testing has been added for the manage teams features. Creating teams from subsections and single student teams are tested for the instructor. It will also test that these teams have actually been created for their users. Then, it will test deleting these teams. ### What steps should a reviewer take to reproduce or test the bug or new feature? 1. run the spec locally and ensure it passes (both in headless and headful mode) 2. observe the spec passing on CI 3. Verify that the spec is written with Cypress best practices as this is the first time I've ever written a cypress test. Submitty guidelines I followed here: https://submitty.org/developer/testing/cypress ### Automated Testing & Documentation It sure is :) ### Other information This is not a breaking change. Luckily, this gradeable (grading team homework pdf) only starts off with teams with submissions, so the test is free to make and delete teams without disturbing the initial state of the gradeable (as long as it makes it to cleanup.)

Why is this Change Important & Necessary?
Closes #12799
What is the New Behavior?
Added a Manage Teams section in the Instructor View on Team Gradeables. Instructors can now see how many teams exist for the gradeable, and have some options to generate teams for their students:
What steps should a reviewer take to reproduce or test the bug or new feature?
All of these instructor features should work even if the team lock date has passed. Additionally, if you have any wording / UI suggestions, please let me know.
Automated Testing & Documentation
This feature is not covered by e2e tests, which should be made in a separate PR.
Other information
If there is some sort of connection to a team that is being deleted, the database will throw an error as the ajax JSON response (ie frog robot). Hopefully this never happens, but it does mean the feature is relatively safe.