CSC/ECE 517 Spring 2025 - E2527. Mentor-meeting management: assignments with topics
Background
In Project E2504, implementation was added for mentors to record their meetings with the teams they were mentoring. It worked for projects where mentors were automatically assigned. To expand the functionality of the mentor management system, we want to incorporate mentors into assignment topics.
Project Overview
The main objective of this project is to extend the mentor management system by having it collaborate with the assignment topics system. When an assignment with topics is created, topics are imported from a spreadsheet into the assignment table. This project will focus on including pre-selected mentors (entered in the spreadsheet) in the assignment table and having the mentor assigned to the team automatically upon topic selection. On top of this, mentors should be able to be unassigned from topics on command and automatically when there are no more member as part of a team.
Implementation
Checkbox to alter the Assignment Creation or Import
Implementation will include adding a checkbox option when importing topics to include mentors. This checkbox will toggle whether or not the mentors will be included in the assignment/import. This checkbox will also reload the table to include the additional column required for the mentor's name. Once saved, these mentor names will be stored as an additional attribute in the sign_up_topic.

It's important to note that this will not affect how teams and mentors are managed for projects where the entire class has the same project. That will still be handled by the mentors being assigned to a team once that team has reached half capacity. This feature will allow mentors to be associated with project topics in projects where each team has a different topic (e.g., ECE 517 Expertiza-based projects).
Automatic Assignment of Mentors
After a team has been created and is allowed to choose a topic from the assignment, the mentor who was assigned to the topic will automatically be assigned to the team. This will be done by adding the mentor to the team (likely via the `TeamsUser` association) and ensuring their `can_mentor` participant value is true. Given the logic of the previous mentor management implementations, this ensures the participant on the team is recognized as a mentor.
The outcome should be that the assigned mentor appears associated with the team in relevant views.

This automatic assignment upon topic selection complements the existing logic where mentors are assigned when a team reaches half strength, as seen in the `MentorManagement` model: MentorManagement#assign_mentor.
Mentors may also be manually assigned after a topic is created as per the addition button for topics that need a mentor
Removal of Mentors
Mentors that are assigned to teams are able to be removed manually or automatically when a team drops the topic and the mentor is the only one left on the team.
The manual removal of mentors can be achieved by clicking the 'X' next to their name as they appear in the 'Mentor' column as part of the Topics tab within certain assignments.
Importing Topics
In order for assignments/topics to have mentors assigned to them before teams are formed, there needs to be a minor change to the way that topics are imported into Expertiza (accessible from the Topics tab of an assignment, e.g., `http://152.7.178.121:8080/assignments/1028/edit`).
There should be an optional field in the import file (spreadsheet) that, when included, associates a mentor with a topic. This requires modifying the import logic to handle this optional mentor column.



The system should still support importing topics without mentors. Furthermore, there should be a way to manually add or edit the assigned mentor for a topic after it has been created or imported, whether it initially had a mentor or not.


Database
We will likely leverage the existing `teams_users` table structure, potentially using the `duty_id` field or similar mechanisms to signify the mentor role within the context of a team, consistent with how other roles might be managed. The `SignUpTopic` model will need an attribute to store the pre-assigned mentor's identifier before a team signs up.
Files That Have Been Modified
The following files have been updated for this implementation:
Models:
- SignedUpTeam - Potentially modified to trigger mentor assignment upon topic selection.
- SignUpTopic - To add an attribute for storing the assigned mentor identifier.
- SignUpSheet
- Team
Controller:
- assignments_controller.rb - Used to unassign mentor with the X button
- import_file_controller.rb - To handle the new import format including the optional mentor column and the checkbox logic.
- sign_up_sheet_controller.rb
Views:
- views/assignments/edit/_topics.html.erb - To display the mentor column when editing topics if the feature is enabled.
- views/import_file/start.html.erb - To add the "include mentors" checkbox and potentially update instructions.
- views/sign_up_sheet/_add_topics.html.erb - To include mentor information when adding/displaying topics.
- views/sign_up_sheet/_table_line.html.erb - To display the mentor associated with a topic in the sign-up sheet.
- views/sign_up_sheet/_table_header.html.erb - To add a header for the mentor column in the sign-up sheet.
- views/sign_up_sheet/_topic_names.html.erb - Potentially adjust topic display.
- views/sign_up_sheet/_add_topic.html.erb
- views/sign_up_sheet/add_mentor_to_topic.html.erb - Used to assign a mentor to an existing topic
- views/sign_up_sheet/_topic.html.erb
- app/views/import_file/_sign_up_topic.html.erb
- app/views/sign_up_sheet/new.html.erb
Helpers:
Migrations:
- db/migrate/20250301220548_create_meetings
- db/migrate/20250301220548_create_meetings.rb
- db/migrate/20250415151755_add_mentor_id_to_sign_up_topics.rb
- db/schema.rb
Config:
- routes.rb - Added routes to controller for the add and remove mentor buttons
Testing
Test Plan
The overarching purpose of these tests is to verify that the system correctly handles mentor assignments in projects where mentors are associated with topics. Tests should cover both success and failure scenarios for each feature. Key areas include:
- Storing Mentors with Topics:
- Ensuring that topics can hold information about their assigned mentors (e.g., via the new attribute in `SignUpTopic`).
assign_mentor_to_topic_action Team.add_mentor
- Assigning Mentors During Topic Sign-up:
- Confirming that when a team chooses a topic, the topic's pre-assigned mentor is automatically added to the team with the correct role/permissions.
- Compatibility with Existing Assignment Logic:
- Ensuring that the existing logic for assigning mentors (e.g., when teams reach half strength in non-topic-based assignments) remains unaffected or correctly integrated if applicable.
- Displaying Mentor Information:
- Validating that team views and topic views accurately show mentor information for mentored assignments and topics, and correctly hide or omit it otherwise.
- Importing Topics with Mentors:
- Checking that topics imported from files correctly capture and store mentor assignments when the mentor column is present.
- Verifying that topics are imported correctly when the mentor column is absent.
- Confirming the "Include mentors" checkbox correctly updates the UI (e.g., topic table columns) and influences the import behavior.
- Manual Mentor Assignment: Testing the ability to manually add or edit a mentor for a topic via the UI.
Test Coverage
Once tests are created and modifications are implemented, we will run the test suite and provide evidence (e.g., screenshots of coverage reports) demonstrating the extent to which the new and modified code paths are covered by automated tests. The goal is comprehensive coverage for the implemented features.
Relevant Links
- Github Repository: https://github.com/jmwinte3/expertiza
- E2504 Wiki (Previous Project): https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2504._Mentor-meeting_management
- Project Description Document: https://docs.google.com/document/d/1jjbqggRDiOHrxdsMlliY62JnP34bGTNHVWAZNz89kT8/edit?tab=t.0#heading=h.yeys674t35p3
Team
Mentor
- Ed Gehringer
Members
- Jacob Winters - Alex Wakefield - John Buchanan