<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bsudala</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bsudala"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Bsudala"/>
	<updated>2026-08-23T06:37:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156747</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156747"/>
		<updated>2024-04-24T03:29:18Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Test Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Automatic Mentor Assignment ====&lt;br /&gt;
* We have added additional function to assign the mentor of the topic to be automatically assigned to the team that chooses the topic&lt;br /&gt;
[[File:Auto Assign Topic Mentor.png | 600px]]&lt;br /&gt;
* The signup_as_instructor_action function will automatically call the assignment function to add the topic's mentor to the team&lt;br /&gt;
[[File:Call_Assign_Mentor.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Mailer Tests ===&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4 - Creating Team -&amp;gt; Recieve Emails ====&lt;br /&gt;
* Step 1 is to change line 45 of app/mailers/mailer from &amp;quot;defn[:to] = 'expertiza.mailer@gmail.com'&amp;quot; to &amp;quot;defn[:to] = '{Your Email}'&amp;quot;. This is so that you can test that the emails are being sent. &lt;br /&gt;
[[File:Team_addition_fix.png | 600px]]&lt;br /&gt;
* Now head to an existing assignment that assigns mentors when team capacity is above 50%. Delete a team if there are no students left to be added to a team. Make sure there are mentors on the student list, if not, add at least 1. Count how many mentors and students will be added to teams when you create a team (in our case this will be 2 students and 1 mentor). &lt;br /&gt;
[[File:t_listz.png| 600px]]&lt;br /&gt;
* Auto-create teams with max participants. &lt;br /&gt;
[[File:cre_teams.png | 600px]]&lt;br /&gt;
* Wait a couple of minutes and then check the email address you entered in step 1. You should expect to receive x number of student emails, and y number of mentor emails, where x is the number of students just assigned to a team, and y is the number of mentors assigned to mentor a team. In our example below you can see that there are 2 distinct student emails, and 1 mentor email, which is as expected in our case. Don't forget to check your spam mail if you don't see the mail in your inbox after a few minutes. &lt;br /&gt;
[[File:email_case.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemented for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the test cases.&lt;br /&gt;
&lt;br /&gt;
To run the test, run the following command&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;bundle exec rspec spec/models/mentor_management_spec.rb&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
This is our [https://youtu.be/rdIV9GV0lfI demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156744</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156744"/>
		<updated>2024-04-24T03:28:47Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Test Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Automatic Mentor Assignment ====&lt;br /&gt;
* We have added additional function to assign the mentor of the topic to be automatically assigned to the team that chooses the topic&lt;br /&gt;
[[File:Auto Assign Topic Mentor.png | 600px]]&lt;br /&gt;
* The signup_as_instructor_action function will automatically call the assignment function to add the topic's mentor to the team&lt;br /&gt;
[[File:Call_Assign_Mentor.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Mailer Tests ===&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4 - Creating Team -&amp;gt; Recieve Emails ====&lt;br /&gt;
* Step 1 is to change line 45 of app/mailers/mailer from &amp;quot;defn[:to] = 'expertiza.mailer@gmail.com'&amp;quot; to &amp;quot;defn[:to] = '{Your Email}'&amp;quot;. This is so that you can test that the emails are being sent. &lt;br /&gt;
[[File:Team_addition_fix.png | 600px]]&lt;br /&gt;
* Now head to an existing assignment that assigns mentors when team capacity is above 50%. Delete a team if there are no students left to be added to a team. Make sure there are mentors on the student list, if not, add at least 1. Count how many mentors and students will be added to teams when you create a team (in our case this will be 2 students and 1 mentor). &lt;br /&gt;
[[File:t_listz.png| 600px]]&lt;br /&gt;
* Auto-create teams with max participants. &lt;br /&gt;
[[File:cre_teams.png | 600px]]&lt;br /&gt;
* Wait a couple of minutes and then check the email address you entered in step 1. You should expect to receive x number of student emails, and y number of mentor emails, where x is the number of students just assigned to a team, and y is the number of mentors assigned to mentor a team. In our example below you can see that there are 2 distinct student emails, and 1 mentor email, which is as expected in our case. Don't forget to check your spam mail if you don't see the mail in your inbox after a few minutes. &lt;br /&gt;
[[File:email_case.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemented for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the test cases.&lt;br /&gt;
&lt;br /&gt;
To run the test, run the following command&lt;br /&gt;
bundle exec rspec spec/models/mentor_management_spec.rb &lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
This is our [https://youtu.be/rdIV9GV0lfI demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156738</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156738"/>
		<updated>2024-04-24T03:27:46Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Demo Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Automatic Mentor Assignment ====&lt;br /&gt;
* We have added additional function to assign the mentor of the topic to be automatically assigned to the team that chooses the topic&lt;br /&gt;
[[File:Auto Assign Topic Mentor.png | 600px]]&lt;br /&gt;
* The signup_as_instructor_action function will automatically call the assignment function to add the topic's mentor to the team&lt;br /&gt;
[[File:Call_Assign_Mentor.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Mailer Tests ===&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4 - Creating Team -&amp;gt; Recieve Emails ====&lt;br /&gt;
* Step 1 is to change line 45 of app/mailers/mailer from &amp;quot;defn[:to] = 'expertiza.mailer@gmail.com'&amp;quot; to &amp;quot;defn[:to] = '{Your Email}'&amp;quot;. This is so that you can test that the emails are being sent. &lt;br /&gt;
[[File:Team_addition_fix.png | 600px]]&lt;br /&gt;
* Now head to an existing assignment that assigns mentors when team capacity is above 50%. Delete a team if there are no students left to be added to a team. Make sure there are mentors on the student list, if not, add at least 1. Count how many mentors and students will be added to teams when you create a team (in our case this will be 2 students and 1 mentor). &lt;br /&gt;
[[File:t_listz.png| 600px]]&lt;br /&gt;
* Auto-create teams with max participants. &lt;br /&gt;
[[File:cre_teams.png | 600px]]&lt;br /&gt;
* Wait a couple of minutes and then check the email address you entered in step 1. You should expect to receive x number of student emails, and y number of mentor emails, where x is the number of students just assigned to a team, and y is the number of mentors assigned to mentor a team. In our example below you can see that there are 2 distinct student emails, and 1 mentor email, which is as expected in our case. Don't forget to check your spam mail if you don't see the mail in your inbox after a few minutes. &lt;br /&gt;
[[File:email_case.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemented for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
This is our [https://youtu.be/rdIV9GV0lfI demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156545</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156545"/>
		<updated>2024-04-24T02:13:12Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Automatic Mentor Assignment ====&lt;br /&gt;
* We have added additional function to assign the mentor of the topic to be automatically assigned to the team that chooses the topic&lt;br /&gt;
[[File:Auto Assign Topic Mentor.png | 600px]]&lt;br /&gt;
* The signup_as_instructor_action function will automatically call the assignment function to add the topic's mentor to the team&lt;br /&gt;
[[File:Call_Assign_Mentor.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
== Mailer Tests ==&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4 - Creating Team -&amp;gt; Recieve Emails ====&lt;br /&gt;
* Step 1 is to change line 45 of app/mailers/mailer from &amp;quot;defn[:to] = 'expertiza.mailer@gmail.com'&amp;quot; to &amp;quot;defn[:to] = '{Your Email}'&amp;quot;. This is so that you can test that the emails are being sent.&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156543</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156543"/>
		<updated>2024-04-24T02:12:50Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Automatic Mentor Assignment ====&lt;br /&gt;
* We have added additional function to assign the mentor of the topic to be automatically assigned to the team that chooses the topic&lt;br /&gt;
[[File:Auto Assign Topic Mentor.png | 600px]]&lt;br /&gt;
* The signup_as_instructor_action function will automatically call the assignment function to add the topic's mentor to the team&lt;br /&gt;
[[File:Call_Assign_Mentor.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation - To delete later ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
== Mailer Tests ==&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 4 - Creating Team -&amp;gt; Recieve Emails ====&lt;br /&gt;
* Step 1 is to change the line&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Call_Assign_Mentor.png&amp;diff=156542</id>
		<title>File:Call Assign Mentor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Call_Assign_Mentor.png&amp;diff=156542"/>
		<updated>2024-04-24T02:12:12Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Call the automatic mentor assignment for topics when instructor approves topic selection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Call the automatic mentor assignment for topics when instructor approves topic selection&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Auto_Assign_Topic_Mentor.png&amp;diff=156540</id>
		<title>File:Auto Assign Topic Mentor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Auto_Assign_Topic_Mentor.png&amp;diff=156540"/>
		<updated>2024-04-24T02:11:08Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Automatically assign topic's mentor to team&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Automatically assign topic's mentor to team&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156532</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156532"/>
		<updated>2024-04-24T02:08:33Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
==== Decorator ====&lt;br /&gt;
* To remove DRY violations, we transformed the MentoredTeam class into the MentoredTeamDecoratorClass.&lt;br /&gt;
[[File:MentoredTeamClass.png | 600px]] ---&amp;gt; [[File:MentoredTeamDecorator.png | 600px]]&lt;br /&gt;
* In particular this required changing the MentoredTeam to have its own assignment team variable. &lt;br /&gt;
* The add_member function's DRY violations with the Team Class were able to be eliminated here, as now the Mentored Team Decorator calls to the assignment team's add member function on line 14, and then simply calls to assign the mentor on line 16.&lt;br /&gt;
&lt;br /&gt;
==== MailerHelper to Mailer ====&lt;br /&gt;
* To increase understandability and consistency between classes, we removed the send_team_confirmation_mail function from the MailerHelper, and instead replaced its functionality with the team_addition_message function in the Mailer class. We found this to be the ideal location as the Mailer class houses many other specific message functions such as notify_grade_conflict_message, suggested_topic_approved_message and more. &lt;br /&gt;
[[File:team_confirm.png | 600px]] ---&amp;gt; [[File:Team_Addtion_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team Add_Member ====&lt;br /&gt;
* The add_member function was altered in a couple of different ways. Firstly, we parameterized the partial_name in the call to the function that actually sends the mail, as in the original code we were violating the DRY principle by repeating the same MailerHelper call twice with very little change between them.&lt;br /&gt;
* Additionally we removed the type check for whether a user is a participant or not, as most users should be participants. &lt;br /&gt;
[[File:add_member_email.png | 600px]] ---&amp;gt; [[File:New_Add_Message.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Automatic topic mentor assignment changes ===&lt;br /&gt;
==== Team creation using decorator ====&lt;br /&gt;
* As we have moved the mentored team from a subclass of assignment team to being a decorator, we have modified the team creation code to assign the right type of class to the team&lt;br /&gt;
* If the team is a mentored team, we use the MentoredTeamDecorator to create the object of the Assignment class&lt;br /&gt;
[[File:Team Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Team deletion ====&lt;br /&gt;
* We have added the functionality to delete the Mentor meetings when the team is deleted&lt;br /&gt;
* If the team is a mentored team, we will find all the instances of mentor meetings for the team and delete them&lt;br /&gt;
* We have also modified the function to work as a independent function that can be called from any where in the application by passing a parameter&lt;br /&gt;
* When the parameter is not passed, it is used as a controller function to handle calls to a specific route&lt;br /&gt;
[[File:Team Deletion.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a user to a team ====&lt;br /&gt;
* We have modified the function to add an user to the team&lt;br /&gt;
* The create function in TeamsUsersController is modified&lt;br /&gt;
[[File:Team User Creation.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Form and table ====&lt;br /&gt;
* We have added a field in the topics form to add a mentor to the topic in &amp;lt;b&amp;gt;_topic.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Form.png | 600px]]&lt;br /&gt;
* The table displaying the topics is also modified to have a column for the mentors in &amp;lt;b&amp;gt;_table_header.html.erb&amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Header.png | 600px]]&lt;br /&gt;
* The topic row also displays the team members with the mentor included in it in the topics table in &amp;lt;b&amp;gt;_table_line.html.erb &amp;lt;/b&amp;gt;&lt;br /&gt;
[[File:Topic Row.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Adding a mentor to a topic - Functions ====&lt;br /&gt;
* We have modified the function to setup a new topic to include the functionality to add mentor to the topic&lt;br /&gt;
* In case we try to add a mentor who is not in the assignment or course, we add the mentor to the assignment and course too&lt;br /&gt;
* In this way we handle cases of adding mentors outside the course into the topic&lt;br /&gt;
[[File:Add Topic Mentor.png | 600px]]&lt;br /&gt;
* We have created some helper functions to assist in adding the mentor to the assignment and course&lt;br /&gt;
[[File:Addition Helpers.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation - To delete later ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
== Mailer Tests ==&lt;br /&gt;
5. &amp;lt;b&amp;gt;Test scenario 5:&amp;lt;/b&amp;gt; Given a mentor is being added to a team, then the mailer should be called to send the mentor-specific mail to the mentor&lt;br /&gt;
  it 'sends mail to mentor if user is a mentor' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'mentor_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
6. &amp;lt;b&amp;gt;Test scenario 6:&amp;lt;/b&amp;gt; Given a normal user is being added to a team, then the mailer should be called to send the general user addition mail to the user&lt;br /&gt;
  it 'sends mail to user if user is a user' do&lt;br /&gt;
          allow(MentorManagement).to receive(:user_a_mentor?).with(user).and_return(true)&lt;br /&gt;
          allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
          allow(Mailer).to receive(:team_addition_message).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(Mailer).to receive(:team_addition_message).with(&lt;br /&gt;
            to: user.email,&lt;br /&gt;
            subject: '[Expertiza] Added to a Team',&lt;br /&gt;
            body: {&lt;br /&gt;
              user: user,&lt;br /&gt;
              first_name: ApplicationHelper.get_user_first_name(user),&lt;br /&gt;
              partial_name: 'user_added_to_team',&lt;br /&gt;
              team: team.name.to_s,&lt;br /&gt;
              assignment: ''&lt;br /&gt;
            }&lt;br /&gt;
          ).and_return(double('Mail', deliver: true))&lt;br /&gt;
          expect(team.add_member(user)).to be true&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Addition_Helpers.png&amp;diff=156529</id>
		<title>File:Addition Helpers.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Addition_Helpers.png&amp;diff=156529"/>
		<updated>2024-04-24T02:06:43Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Helper functions to add mentors to course and assignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Helper functions to add mentors to course and assignment&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_Topic_Mentor.png&amp;diff=156520</id>
		<title>File:Add Topic Mentor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Add_Topic_Mentor.png&amp;diff=156520"/>
		<updated>2024-04-24T02:02:28Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Adds mentor to the topics and includes them in the assignments and course too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Adds mentor to the topics and includes them in the assignments and course too&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Row.png&amp;diff=156512</id>
		<title>File:Topic Row.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Row.png&amp;diff=156512"/>
		<updated>2024-04-24T01:58:14Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Table row to display the mentor of topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Table row to display the mentor of topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Header.png&amp;diff=156510</id>
		<title>File:Topic Header.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Header.png&amp;diff=156510"/>
		<updated>2024-04-24T01:58:03Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Table header to display the mentor of topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Table header to display the mentor of topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Form.png&amp;diff=156507</id>
		<title>File:Topic Form.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_Form.png&amp;diff=156507"/>
		<updated>2024-04-24T01:57:43Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Form input to add mentor to topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Form input to add mentor to topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_User_Creation.png&amp;diff=156486</id>
		<title>File:Team User Creation.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_User_Creation.png&amp;diff=156486"/>
		<updated>2024-04-24T01:53:06Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Create an user for the team&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Create an user for the team&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_Deletion.png&amp;diff=156470</id>
		<title>File:Team Deletion.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_Deletion.png&amp;diff=156470"/>
		<updated>2024-04-24T01:50:27Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Team deletion logic for assignment teams&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Team deletion logic for assignment teams&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_Creation.png&amp;diff=156460</id>
		<title>File:Team Creation.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_Creation.png&amp;diff=156460"/>
		<updated>2024-04-24T01:46:16Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Team creation logic for assignment teams&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Team creation logic for assignment teams&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156369</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156369"/>
		<updated>2024-04-24T00:41:44Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation - To delete later ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156343</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156343"/>
		<updated>2024-04-24T00:33:11Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Files Modified/Added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* To reduce DRY violations, the mentored team class was changed to the mentored team decorator class. &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
* app/controllers/sign_up_sheet_controller.rb&lt;br /&gt;
* app/controllers/teams_controller.rb&lt;br /&gt;
* app/controllers/teams_users_controller.rb&lt;br /&gt;
* app/models/course.rb&lt;br /&gt;
* app/models/mentor_management.rb&lt;br /&gt;
* app/views/sign_up_sheet/_table_header.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
* app/views/sign_up_sheet/_topic.html.erb&lt;br /&gt;
* app/views/teams/_team.html.erb&lt;br /&gt;
* app/views/tree_display/_page_footer_assignments.html.erb&lt;br /&gt;
* app/views/tree_display/_entry_assignments.html.erb&lt;br /&gt;
* app/models/mentored_team_decorator.rb&lt;br /&gt;
* app/models/team.rb&lt;br /&gt;
* app/views/mailer/team_addition_message.html.erb&lt;br /&gt;
* app/views/mailer/team_addition_message.text.erb&lt;br /&gt;
* app/helpers/mailer_helper.rb&lt;br /&gt;
* app/mailers/mailer.rb&lt;br /&gt;
* spec/models/team_spec.rb&lt;br /&gt;
* spec/models/mentor_management_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156333</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156333"/>
		<updated>2024-04-24T00:29:43Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Refer to the demo video on the bottom of the page to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156332</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156332"/>
		<updated>2024-04-24T00:29:09Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb --&amp;gt; mentored_team_decorator ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
Link to the [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2789&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156330</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156330"/>
		<updated>2024-04-24T00:28:31Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Scenario 3 - Creating an mentored team with topic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
Link to the [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating a team with topic ====&lt;br /&gt;
* Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
* Go to Manage &amp;gt; Courses&lt;br /&gt;
* Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
* Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create a new topic for the assignment and enter a mentor name to the topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* When a student is added to the topic, the team of the student along with the mentor will be displayed in the topic row&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* When navigating to the teams page of that assignment, you can see a mentor assigned automatically&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156324</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156324"/>
		<updated>2024-04-24T00:24:28Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Test Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
Link to the [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating an mentored team with topic ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. &lt;br /&gt;
The test coverage indicated &amp;lt;b&amp;gt;1730&amp;lt;/b&amp;gt; lines of code was covered through the testcases.&lt;br /&gt;
&lt;br /&gt;
[[File:Testing E2403.png ‎| 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testing_E2403.png&amp;diff=156323</id>
		<title>File:Testing E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testing_E2403.png&amp;diff=156323"/>
		<updated>2024-04-24T00:22:42Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: This is the testing report for the E2403 project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
This is the testing report for the E2403 project&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156313</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=156313"/>
		<updated>2024-04-24T00:19:33Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* UI Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Mailer Changes ===&lt;br /&gt;
====team.rb====&lt;br /&gt;
* The team model must be altered to use delegation for cases where a team would previously be a mentored team. &lt;br /&gt;
====add_member====&lt;br /&gt;
* The add member function must be altered such that the call to mail a user is better named, and that it calls directly to the mailer rather than the mailer helper. &lt;br /&gt;
[[File:add_member_email.png | 900px]]&lt;br /&gt;
====mailer_helper====&lt;br /&gt;
* The mailer_helper will be altered such that the send_team_confimration_to_user will be moved and renamed in the Mailer.rb class instead since using generic_message as such is leading to an unclear design. &lt;br /&gt;
[[File:team_confirm.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
====mailer.rb====&lt;br /&gt;
* A new function to specifically handle messaging users when added to teams will be built in the mailer, rather than just overusing the generic_message function.&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignment&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implemented.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignment&lt;br /&gt;
* The form to create a new topic has a new field to assign mentor to a topic&lt;br /&gt;
[[File:UI2 E2403.png | 600px]]&lt;br /&gt;
* The updated UI showing the topics with the mentors and teams that have chosen the topic&lt;br /&gt;
* The mentor is also displayed with the team&lt;br /&gt;
[[File:UI3 E2403.png | 600px]]&lt;br /&gt;
* The assignment teams page has the modified UI from the Phase 1 as the teams have a mentor&lt;br /&gt;
[[File:UI4 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. Test cases for mentor management were already written and we wrote new test cases for the new functionalities we added. Here are the four test case scenarios we covered and the actual ruby code for the Rspec tests&lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing  Scenarios===&lt;br /&gt;
1. &amp;lt;b&amp;gt;Test scenario 1:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with different team counts for the assignment, Then it should return the mentor with the lowest team count&lt;br /&gt;
  it &amp;quot;returns the mentor with the lowest team count for the given assignment&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 2]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;Test scenario 2:&amp;lt;/b&amp;gt; Given an assignment_id, When there is only one mentor available for the assignment, Then it should return that mentor&lt;br /&gt;
  it &amp;quot;should return that mentor if there's only one available&amp;quot; do&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 0]])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Test scenario 3:&amp;lt;/b&amp;gt; Given an assignment_id, When there are multiple mentors with the same lowest team count for the assignment, Then it should return the first mentor in the list&lt;br /&gt;
  it &amp;quot;returns the first mentor in the list if there's a tie for lowest team count&amp;quot; do&lt;br /&gt;
        # Arrange&lt;br /&gt;
        allow(MentorManagement).to receive(:zip_mentors_with_team_count)&lt;br /&gt;
                                     .with(assignment.id)&lt;br /&gt;
                                     .and_return([[mentor.id, 1], [998, 1],])&lt;br /&gt;
        allow(User).to receive(:where).with(id: mentor.id).and_return([mentor])&lt;br /&gt;
        selected_mentor = MentorManagement.select_mentor(assignment.id)&lt;br /&gt;
        expect(selected_mentor).to eq mentor &lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;Test scenario 4:&amp;lt;/b&amp;gt; Given an assignment_id, When there are no mentors available for the assignment, Then it should return nil&lt;br /&gt;
  it &amp;quot;returns nil&amp;quot; do&lt;br /&gt;
        # Create a new assignment&lt;br /&gt;
        a = FactoryBot.create(:assignment, id: 997, directory_path: 'OSS_project', auto_assign_mentor: true)&lt;br /&gt;
        # Since there are no mentors associated with this assignment, should return nil&lt;br /&gt;
        expect(MentorManagement.select_mentor(a.id)).to eq nil&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
Link to the [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating an mentored team with topic ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; &lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI4_E2403.png&amp;diff=156311</id>
		<title>File:UI4 E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI4_E2403.png&amp;diff=156311"/>
		<updated>2024-04-24T00:19:25Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: UI after change in the assignments with topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
UI after change in the assignments with topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI3_E2403.png&amp;diff=156305</id>
		<title>File:UI3 E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI3_E2403.png&amp;diff=156305"/>
		<updated>2024-04-24T00:17:27Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: UI after change in the assignments with topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
UI after change in the assignments with topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI2_E2403.png&amp;diff=156300</id>
		<title>File:UI2 E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI2_E2403.png&amp;diff=156300"/>
		<updated>2024-04-24T00:15:17Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: UI after change in the assignments with topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
UI after change in the assignments with topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155448</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155448"/>
		<updated>2024-04-09T01:39:56Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
* The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
* But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; &lt;br /&gt;
The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
Link to the [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating an mentored team with topic ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; &lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
This is our [https://www.youtube.com/ demo video] which explain how to create courses, assignments, mentored teams and mentored teams with topics. This video also show how to run the tests of our code changes.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155440</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155440"/>
		<updated>2024-04-09T01:36:21Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Link to the &amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Scenario 3 - Creating an mentored team with topic ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot;Has topics?&amp;quot; option is checked and a topic is created using the Topics tab&lt;br /&gt;
[[File:MT 3-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_3-1.png&amp;diff=155436</id>
		<title>File:MT 3-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_3-1.png&amp;diff=155436"/>
		<updated>2024-04-09T01:33:49Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 3 - 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 3 - 1&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155424</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155424"/>
		<updated>2024-04-09T01:29:36Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Scenario 2 - Adding, editing, deleting mentor meeting dates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Link to the &amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot; Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2.png&amp;diff=155423</id>
		<title>File:MT 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2.png&amp;diff=155423"/>
		<updated>2024-04-09T01:29:30Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 2&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155422</id>
		<title>File:MT 2-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155422"/>
		<updated>2024-04-09T01:28:51Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 2 - 1&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155419</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155419"/>
		<updated>2024-04-09T01:28:25Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Link to the &amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Courses&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot; Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
==== Scenario 2 - Adding, editing, deleting mentor meeting dates ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Go to Manage &amp;gt; Assigments&lt;br /&gt;
# Assuming you have created a mentored assignment and added participants to it, proceed to the teams page&lt;br /&gt;
# Try entering dates into it teams row and the date should persist&lt;br /&gt;
# You can edit and delete the dates from the rows&lt;br /&gt;
# Team with less than 50% capacity will have the mentor meeting dates disabled&lt;br /&gt;
[[File:MT 2-1.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155418</id>
		<title>File:MT 2-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155418"/>
		<updated>2024-04-09T01:28:07Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Bsudala uploaded a new version of File:MT 2-1.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 1 - 2&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1-2.png&amp;diff=155388</id>
		<title>File:MT 1-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1-2.png&amp;diff=155388"/>
		<updated>2024-04-09T01:07:02Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 1 - 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 1 - 2&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155387</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155387"/>
		<updated>2024-04-09T01:06:27Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Manual UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
Apart from the automated Rspec tests, we are providing manual testing cases that can be used to verify the functioning of the website.&lt;br /&gt;
&lt;br /&gt;
Link to the &amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; [https://www.youtube.com/ video] to find help on testing these cases&lt;br /&gt;
&lt;br /&gt;
==== Scenario 1 - Creating an mentored team ====&lt;br /&gt;
# Log into Expertiza using the test credential and navigate to the home page&lt;br /&gt;
# Assuming you have created a course and added participants to it, proceed to create a team&lt;br /&gt;
# Make sure &amp;quot; Auto assign mentors when team hits &amp;gt; 50% capacity?&amp;quot; option is checked&lt;br /&gt;
[[File:MT 1-1.png | 600px]]&lt;br /&gt;
* Create team for the assignment and you can see that the team with more than 50% capacity gets a mentor assigned automatically&lt;br /&gt;
[[File:MT 1-2.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1-1.png&amp;diff=155386</id>
		<title>File:MT 1-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1-1.png&amp;diff=155386"/>
		<updated>2024-04-09T01:06:15Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 1 - 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 1 - 1&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155384</id>
		<title>File:MT 2-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_2-1.png&amp;diff=155384"/>
		<updated>2024-04-09T01:04:41Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 1 - 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 1 - 2&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1.png&amp;diff=155382</id>
		<title>File:MT 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:MT_1.png&amp;diff=155382"/>
		<updated>2024-04-09T01:01:49Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Manual Testing Scenario 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Manual Testing Scenario 1&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155345</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155345"/>
		<updated>2024-04-09T00:43:11Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
When the project was pulled from the main repository, there are not enough tests to cover the additional functionalities that we added. We are planning on using the test skeletons by Mustafa Olmez, as a reference to how and what kind of tests should be written. &lt;br /&gt;
&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
Functionalities introduced by our code that needs to be tested:&lt;br /&gt;
# When a mentored team is created and has meetings dates, testing the CRUD functionality of the mentor-meetings.&lt;br /&gt;
# When a mentored team is created with a topic, the mentor should be assigned automatically when the size of the team reaches over 50%.&lt;br /&gt;
# Mentored team should be delegated and so it must be a object of Assignment team&lt;br /&gt;
&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
==== Scenario 1 ====&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155317</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=155317"/>
		<updated>2024-04-09T00:33:10Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
=== UI Changes before Phase 2 code changes ===&lt;br /&gt;
The mentored assignment teams page has the modified UI from the Phase 1 as it is also a mentored assignemnt&lt;br /&gt;
&lt;br /&gt;
[[File:UI1 E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
But the teams do not have a TA as the automated assignment of mentors has not been implmeneted.&lt;br /&gt;
&lt;br /&gt;
=== UI Changes after Phase 2 code changes ===&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; The mentored assignment teams with topic now has the new UI and the automated mentor assignemnt&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
==== Scenario 1 ====&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO:: &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt; We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
&amp;lt;i&amp;gt;&amp;lt;u&amp;gt;&amp;lt;b&amp;gt;TODO::&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI1_E2403.png&amp;diff=155304</id>
		<title>File:UI1 E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI1_E2403.png&amp;diff=155304"/>
		<updated>2024-04-09T00:25:21Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: UI before change in the assignments with topics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
UI before change in the assignments with topics&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154856</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154856"/>
		<updated>2024-04-07T08:56:44Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Files Modified/Added ==&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Automated Rspec Testing ===&lt;br /&gt;
==== Testing model methods ====&lt;br /&gt;
==== Testing controller methods ====&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Testing ===&lt;br /&gt;
==== Scenario 1 ====&lt;br /&gt;
&lt;br /&gt;
== Test Coverage ==&lt;br /&gt;
We used SimpleCov to generate a coverage report for the Rspec test cases implemeted for the model and controllers. The test coverage indicated &amp;lt;b&amp;gt;x%&amp;lt;/b&amp;gt; percent of code was covered through the testcases. &lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Relevant Links (Update this) ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ExtremeMachine12/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/xxxx&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154855</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154855"/>
		<updated>2024-04-07T08:50:36Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Modify existing controller model and view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
==== schema.rb ====&lt;br /&gt;
* As we are adding a new field to the table, we need to modify the schema&lt;br /&gt;
* We need to write 1 migration to add the field to the table to update the schema file&lt;br /&gt;
[[File:Schema E2403.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema_E2403.png&amp;diff=154854</id>
		<title>File:Schema E2403.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema_E2403.png&amp;diff=154854"/>
		<updated>2024-04-07T08:49:06Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Example of code to be changed in schema.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example of code to be changed in schema.rb&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154853</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154853"/>
		<updated>2024-04-07T08:46:39Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: /* Modify existing controller model and view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
==== _topic.html.erb ====&lt;br /&gt;
* If we manually have to assign mentors to the topic, we have to include a input field to enter the mentor&lt;br /&gt;
[[File:Topic html.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_html.png&amp;diff=154852</id>
		<title>File:Topic html.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Topic_html.png&amp;diff=154852"/>
		<updated>2024-04-07T08:44:40Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Example of code to be changed in _topic.html.erb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example of code to be changed in _topic.html.erb&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154851</id>
		<title>CSC/ECE 517 Spring 2024 - E2403 Mentor-Meeting Management (Phase 2)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management_(Phase_2)&amp;diff=154851"/>
		<updated>2024-04-07T08:43:16Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is the continuation of [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2403_Mentor-Meeting_Management/ E2304] for the implementation of the Mentor-meeting management in the Expertiza system for mentored teams. We are now required to add functionality to add mentors to the topics and then assign them to the teams when they pick up that topic.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The following tasks are required for the project:&lt;br /&gt;
#&amp;lt;b&amp;gt;Enhancing Code Clarity:&amp;lt;/b&amp;gt; This involves renaming methods from Project 3 with ambiguous names, optimizing loops and adding comments for unclear lines of code&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Mentored teams:&amp;lt;/b&amp;gt; Reimplement the Mentored team delegate to the Assignment team to reduce complexity and to follow best principles of Object Oriented Design&lt;br /&gt;
#&amp;lt;b&amp;gt;Reimplement Sign Up Sheet or Topics:&amp;lt;/b&amp;gt; Reimplement the SignUpSheet controller to automatically add the mentor to when a topic is created and automatically assign the same mentor to a team when they choose the topic&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for mentor meetings models:&amp;lt;/b&amp;gt; More tests have to be written for Mentor Meeting model&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the mentor meetings controller:&amp;lt;/b&amp;gt; More tests should be written for Mentor meeting controller&lt;br /&gt;
#&amp;lt;b&amp;gt;Writing tests for the signup sheet controller:&amp;lt;/b&amp;gt; Additional tests should be written for signup sheet controller to test the new functionality&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
We have 3 main objectives for this project.&lt;br /&gt;
* Refactoring of the Mentor-meeting model and controller created for the Project 3&lt;br /&gt;
* Reimplementation of Mentored Teams model and controller for the Project 4&lt;br /&gt;
* Reimplementation of SignUp Sheet controller for the Project 4 to automatically assign mentors to the topics&lt;br /&gt;
&lt;br /&gt;
== Design Goal ==&lt;br /&gt;
While fulfilling all the objectives, the following design rules have to be ensured:&lt;br /&gt;
* Validate proper functioning of all existing and anticipated methods, making any required enhancements or adjustments.&lt;br /&gt;
* Establish loose coupling and tight cohesion for the model and controller to enhance code organization and maintainability.&lt;br /&gt;
* Refactor redundant code in the previous implementation's controller and model methods using DRY principle, eliminating functionality duplication already present in the Expertiza system.&lt;br /&gt;
* Confirm the continued effectiveness of existing test cases following the aforementioned modifications and generate additional test cases as per the need.&lt;br /&gt;
&lt;br /&gt;
== Class UML Diagram ==&lt;br /&gt;
[[File:OODD Proj4 E2403 - Entity Diagram 2.png ‎| 610px]]&lt;br /&gt;
&lt;br /&gt;
== Classes and Relationships ==&lt;br /&gt;
=== Existing Structure ===&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has a &amp;lt;b&amp;gt;Node&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;Assignment&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;Team&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; is inherited from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt;&lt;br /&gt;
* Every &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; has many &amp;lt;b&amp;gt;MentorMeeting&amp;lt;/b&amp;gt;&lt;br /&gt;
=== Proposed Structure Structure ===&lt;br /&gt;
* &amp;lt;b&amp;gt;MentoredTeam&amp;lt;/b&amp;gt; to be delegated from &amp;lt;b&amp;gt;AssignmentTeam&amp;lt;/b&amp;gt; instead of inheriting from it&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
=== Modify newly created controller, model and view ===&lt;br /&gt;
==== mentor_meeting_controller.rb ====&lt;br /&gt;
* Edit function names to make them more descriptive&lt;br /&gt;
* Add more descriptive comments for the functions&lt;br /&gt;
==== mentor_meetings_helper.rb ====&lt;br /&gt;
* Move the &amp;quot;get_dates_for_team&amp;quot; function to the model&lt;br /&gt;
* Rename the function to make it more descriptive&lt;br /&gt;
==== _entry_assignments.html.erb ====&lt;br /&gt;
* Add more descriptive comments for the JavaScript functions&lt;br /&gt;
* Move the Ruby code from the template to a helper or the controller&lt;br /&gt;
==== mentored_team.rb ====&lt;br /&gt;
* This file needs to be modified to implement the functionality of delegation instead of inheritance&lt;br /&gt;
* The &amp;quot;add_member&amp;quot; method must function as previously intended during reimplementation&lt;br /&gt;
&lt;br /&gt;
=== Modify existing controller model and view ===&lt;br /&gt;
==== teams/_team.html.erb ====&lt;br /&gt;
* As the mentored team will now be delegated from the assignment team, we need to change the if condition on the top as we are changing MentoredTeam to be delegated from the AssignmentTeam&lt;br /&gt;
==== teams_controller.rb ====&lt;br /&gt;
* This file has to be modified to work with the delegated MentoredTeam&lt;br /&gt;
* These lines will not work as MentoredTeam will not be a model&lt;br /&gt;
[[File:Teams con1.png ‎| 600px]]&lt;br /&gt;
==== sign_up_sheet_controller.rb ====&lt;br /&gt;
* This controller has to be modified to automatically assign mentors or manually add mentors to the topics when they are created&lt;br /&gt;
* This will be followed by a change in schema&lt;br /&gt;
[[File:Signup con1.png | 600px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
* UserId: instructor6&lt;br /&gt;
* Password: password&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Samuel Kwiatkowski-Martin (slkwiatk)&lt;br /&gt;
* Tanmay Pardeshi (tpardes)&lt;br /&gt;
* Bala Logesh Sudalaimuthu Pandian (bsudala)&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Signup_con1.png&amp;diff=154850</id>
		<title>File:Signup con1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Signup_con1.png&amp;diff=154850"/>
		<updated>2024-04-07T08:41:52Z</updated>

		<summary type="html">&lt;p&gt;Bsudala: Example of code to be changed in sign_up_sheet_controller.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Example of code to be changed in sign_up_sheet_controller.rb&lt;/div&gt;</summary>
		<author><name>Bsudala</name></author>
	</entry>
</feed>