Skip to content

[Feature:InstructorUI] Add Manage Teams UI for Instructors#12909

Merged
bmcutler merged 28 commits into
mainfrom
teams-from-registration-subsections
Jun 23, 2026
Merged

[Feature:InstructorUI] Add Manage Teams UI for Instructors#12909
bmcutler merged 28 commits into
mainfrom
teams-from-registration-subsections

Conversation

@roye2

@roye2 roye2 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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:

  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.
Screenshot 2026-06-16 at 16-07-38 Manage Team For manage teams ui - Sample

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
  1. Test the Create Single Student teams and verify that each teamless student is put on their own team
  2. 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.

@roye2 roye2 linked an issue Jun 12, 2026 that may be closed by this pull request
@github-project-automation github-project-automation Bot moved this to Seeking Reviewer in Submitty Development Jun 12, 2026
@roye2 roye2 changed the title [Feature:InstructorTeams from registration subsections [Feature:Instructor] Draft: Teams from registration subsections Jun 12, 2026
@roye2
roye2 marked this pull request as draft June 12, 2026 21:01
@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Jun 12, 2026
@roye2 roye2 changed the title [Feature:Instructor] Draft: Teams from registration subsections [Feature:InstructorUI] Draft: Teams from registration subsections Jun 12, 2026
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 118 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.40%. Comparing base (ed37322) to head (54e5758).

Additional details and impacted files

Impacted file tree graph

@@             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              
Flag Coverage Δ
autograder 21.16% <ø> (ø)
js 2.01% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.44% <0.00%> (-0.11%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roye2 roye2 changed the title [Feature:InstructorUI] Draft: Teams from registration subsections [Feature:InstructorUI] Teams from registration subsections Jun 15, 2026
@roye2 roye2 changed the title [Feature:InstructorUI] Teams from registration subsections [Feature:InstructorUI] Add Manage Teams UI for Instructors Jun 15, 2026
@roye2
roye2 marked this pull request as ready for review June 16, 2026 20:40
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to Seeking Reviewer in Submitty Development Jun 16, 2026
@NicholasCiuica
NicholasCiuica self-requested a review June 17, 2026 20:36
@automateprojectmangement automateprojectmangement Bot moved this from Seeking Reviewer to In Review in Submitty Development Jun 17, 2026

@NicholasCiuica NicholasCiuica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

Image

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.

Comment thread site/app/templates/submission/Team.twig Outdated
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.";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The instructor team is mistakenly added to the skipped_count because they are not deleted regardless of submission.

Comment thread site/app/controllers/student/TeamController.php
@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Jun 18, 2026
@roye2

roye2 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

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:
Image

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.

@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 :)
image

If you want to test the exception handling, just remove the continue; line in the deleteTeams() function (where it checks if teams have submissions) to force a bad delete.

@roye2
roye2 requested a review from NicholasCiuica June 19, 2026 15:43
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Jun 19, 2026

@NicholasCiuica NicholasCiuica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Maintainer Review in Submitty Development Jun 23, 2026
@bmcutler
bmcutler merged commit 803f035 into main Jun 23, 2026
25 of 27 checks passed
@bmcutler
bmcutler deleted the teams-from-registration-subsections branch June 23, 2026 16:14
jndlansh pushed a commit to jndlansh/Submitty that referenced this pull request Jul 1, 2026
…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]>
bmcutler pushed a commit that referenced this pull request Jul 23, 2026
### 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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Teams from Registration SubSections

3 participants