<?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=Csingha</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=Csingha"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Csingha"/>
	<updated>2026-05-16T01:00:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158798</id>
		<title>File:SequenceDiagram TeamsParticipant.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158798"/>
		<updated>2024-11-11T00:10:49Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Csingha reverted File:SequenceDiagram TeamsParticipant.png to an old version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158797</id>
		<title>File:SequenceDiagram TeamsParticipant.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158797"/>
		<updated>2024-11-11T00:10:36Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Csingha reverted File:SequenceDiagram TeamsParticipant.png to an old version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158796</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158796"/>
		<updated>2024-11-11T00:09:57Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158795</id>
		<title>File:SequenceDiagram TeamsParticipant.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158795"/>
		<updated>2024-11-11T00:09:38Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Csingha uploaded a new version of File:SequenceDiagram TeamsParticipant.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158794</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158794"/>
		<updated>2024-11-11T00:08:31Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram_TeamsParticipant2.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158793</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158793"/>
		<updated>2024-11-11T00:08:12Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[SequenceDiagram_TeamsParticipant2.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158792</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158792"/>
		<updated>2024-11-11T00:07:14Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158791</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158791"/>
		<updated>2024-11-11T00:03:57Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant2.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram.png&amp;diff=158790</id>
		<title>File:SequenceDiagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram.png&amp;diff=158790"/>
		<updated>2024-11-11T00:02:00Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Csingha uploaded a new version of File:SequenceDiagram.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158789</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158789"/>
		<updated>2024-11-11T00:00:34Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158788</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158788"/>
		<updated>2024-11-11T00:00:29Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant.png|1000px|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158787</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158787"/>
		<updated>2024-11-11T00:00:21Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant.png|1000px|left]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158786</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158786"/>
		<updated>2024-11-11T00:00:04Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158785</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158785"/>
		<updated>2024-11-10T23:59:50Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Sequence Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
[[File:SequenceDiagram TeamsParticipant.png]]&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158784</id>
		<title>File:SequenceDiagram TeamsParticipant.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SequenceDiagram_TeamsParticipant.png&amp;diff=158784"/>
		<updated>2024-11-10T23:59:33Z</updated>

		<summary type="html">&lt;p&gt;Csingha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158783</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158783"/>
		<updated>2024-11-10T23:58:55Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Use Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Sequence Diagram==&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158782</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158782"/>
		<updated>2024-11-10T23:48:20Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158781</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158781"/>
		<updated>2024-11-10T23:48:09Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158780</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158780"/>
		<updated>2024-11-10T23:47:59Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|800px|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158779</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158779"/>
		<updated>2024-11-10T23:47:49Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|800px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158778</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158778"/>
		<updated>2024-11-10T23:47:36Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png|200px|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158777</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158777"/>
		<updated>2024-11-10T23:47:05Z</updated>

		<summary type="html">&lt;p&gt;Csingha: /* Class Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Design Goal==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Design Pattern==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class Diagram==&lt;br /&gt;
[[File:ClassDiagram_TeamsParticipant.png]]&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Solutions/Details of Changes Made==&lt;br /&gt;
&lt;br /&gt;
===Phase 1 Improvements===&lt;br /&gt;
&lt;br /&gt;
* Renamed TeamsUser to TeamsParticipant to modify application logic to join Teams with Participants instead of Users&lt;br /&gt;
* Updated associations in immediate neighbor classes i.e Teams, Users and Participants to ensure correctness and consistency in the data model&lt;br /&gt;
* Renamed method names for increased readability and removed redundant methods from the TeamsParticipant class&lt;br /&gt;
* Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity, improving overall maintainability of the codebase&lt;br /&gt;
* Renamed TeamUserNode to TeamParticipantNode for correctness, to align with the new design of Participation association in TeamsParticipant&lt;br /&gt;
* Added migrations to add foreign key for Participant in TeamsParticipant table and updated indexes for the same&lt;br /&gt;
&lt;br /&gt;
===Phase 2 Plan===&lt;br /&gt;
&lt;br /&gt;
* Update associations in all the models that were previously using TeamsUser to implement them with TeamsParticipant&lt;br /&gt;
* Modify implementations of all models, views, and controllers to use Participant with TeamsParticipant class instead of User&lt;br /&gt;
* This future involves modifying queries to retrieve participant and user objects that are passed to the TeamsParticipant class as commands to their methods&lt;br /&gt;
* Deprecate user_id foreign key from TeamsParticipant to completely remove the association of User from TeamsParticant, only linking Participants to Teams&lt;br /&gt;
* Update all the test cases to work with this implementation, including updating associations and mocking DB calls&lt;br /&gt;
&lt;br /&gt;
==Files Added/Modified==&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jay, Patel&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ClassDiagram_TeamsParticipant.png&amp;diff=158776</id>
		<title>File:ClassDiagram TeamsParticipant.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ClassDiagram_TeamsParticipant.png&amp;diff=158776"/>
		<updated>2024-11-10T23:46:38Z</updated>

		<summary type="html">&lt;p&gt;Csingha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158740</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb (Phase 2 - Design Document)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb_(Phase_2_-_Design_Document)&amp;diff=158740"/>
		<updated>2024-11-07T23:11:00Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Created page with &amp;quot;==Expertiza==  Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The National Science Foundation supports the Expertiza project. It is used in select courses at NC State and by professors at several other colleges and universities.  [http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.  ==Problem Statement==  The TeamsUser class in th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The TeamsUser class in the Expertiza repository serves as a join model between the Team and Participant classes, establishing a many-to-many relationship. Its primary purpose is to manage team memberships within the context of assignments or courses, facilitating functionalities such as retrieving a user's name, deleting users or teams, and managing participant associations.&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design to use TeamsParticipants instead of TeamsUsers. &lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
The main role of teams_user class is to handle functionalities that deal with a team associated with an assignment/course and the participants (users associated with a course/assignment) in the team. The functionalities include retrieving a user’s name, deleting a user from the team, deleting the team if no participants are left in the team, adding a member to the team, finding the team ID for a user with a specific assignment, etc. Overall, it encapsulates the logic required to manage participants’ in teams within the context of assignments/courses in Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Refactor==&lt;br /&gt;
&lt;br /&gt;
The refactoring process involved careful analysis of existing methods, removal of redundancies, and restructuring code to maintain clarity and efficiency. Significant focus was placed on simplifying method names, enhancing documentation, and aligning with object-oriented principles.&lt;br /&gt;
&lt;br /&gt;
The refactor aims to address the inappropriate association of teams directly with users rather than participants, ensuring consistency with the application's architecture. The changes involve:&lt;br /&gt;
&lt;br /&gt;
* Renaming TeamsUser to TeamsParticipant.&lt;br /&gt;
* Updating associations and references in related models: Team, User, and Participant.&lt;br /&gt;
* Removing empty or unnecessary methods and renaming others for clarity.&lt;br /&gt;
* Reducing the code and conditional complexity of the model&lt;br /&gt;
* Identifying code smells and refactoring for efficiency.&lt;br /&gt;
* Writing tests for all of the methods.&lt;br /&gt;
* Ensuring adherence to SOLID and DRY principles.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
Changed files in &amp;lt;code&amp;gt;Model&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/teams_user.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamsUser to TeamsParticipant  &lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Updated associations to reference Participants&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/3de17ae82cb55d35de419d4f4b8c881e1b9f86c5 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;get_team_members&amp;lt;/code&amp;gt; from teams_participant model&lt;br /&gt;
|The method was empty without any logic so it was just a placeholder method without any usage across the project.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Renamed methods: &amp;lt;code&amp;gt;remove_team_if_participants_empty&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;remove_team_participant&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;first_participant_for_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for clarity&lt;br /&gt;
|Improves code readability for new programmers.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Refactored methods: &amp;lt;code&amp;gt;add_accepted_invitee_to_team&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;find_team_id&amp;lt;/code&amp;gt; for efficiency and reducing complexity&lt;br /&gt;
|To reduce Cognitive Complexity and making the model more maintainable and efficient&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Changes to &amp;lt;code&amp;gt;app/models/team_user_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Renamed TeamUserNode to TeamParticipantNode&lt;br /&gt;
|Aligns with application logic that utilizes Participants rather than Users for node associations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Modified queries in TeamParticipantNode to use teams_participant instead of teams_user&lt;br /&gt;
|Aligns with the changes made in teams_participant model to add new participant association.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/d5cacfa663e1358a522f52d676f7c6cb7a7ec3f0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Updated associations to reference TeamUserNode in entire repository&lt;br /&gt;
|Ensures consistency across the application and correctness in related models for foreign key relations.&lt;br /&gt;
|[https://github.com/pranavmanbhekar-ncsu/expertiza/commit/5041383721fd3c150f3065b3b3d9646784794257 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Cases==&lt;br /&gt;
&lt;br /&gt;
We added a new spec file for the teams_participant model which was missing and fixed team_participant_controller_spec. Also as an additional step, we fixed model and controller tests for direct associations: Team, User, and Participant.&lt;br /&gt;
&lt;br /&gt;
===Code coverage===&lt;br /&gt;
&lt;br /&gt;
'''Before refactoring: 0%'''&lt;br /&gt;
&lt;br /&gt;
'''After refactoring: 100%'''&lt;br /&gt;
&lt;br /&gt;
[[File:teams-participant-code-cov.png|800px|center|Code coverage for &amp;lt;code&amp;gt;teams_participant.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:User_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_model_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''teams_participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Teams_participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Team_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''user_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Users_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''participant_controller'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Participant_controller_spec.png|1000px|center|Test passing for &amp;lt;code&amp;gt;team_spec.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
During the refactoring from TeamsUser to TeamsParticipant, we initially retained the association between teams and users (with user_id as a foreign key) in TeamsParticipant. This approach was for backward compatibility, ensuring that other classes and tests would function without immediate disruption.&lt;br /&gt;
&lt;br /&gt;
The next phase will involve fully removing this direct association between teams and users. Instead, we will maintain only the teams-participant relationship in the TeamsParticipant table.&lt;br /&gt;
&lt;br /&gt;
This update will require modifying all references to TeamsParticipant across models and controllers, and adjusting logic to work with Participant instead of User. Certain cases do need user-specific fields previously stored within TeamsParticipant. With the user association deprecated, these areas will need updated logic to retrieve the user associated with each participant. This ensures continued functionality and accuracy of the code. Corresponding updates will also be necessary in the spec files to align with the changes.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jayesh, Kiron&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
# [https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0OSS Projects on Expertiza])&lt;br /&gt;
# [https://github.com/expertiza/expertiza Expertiza Github]&lt;br /&gt;
# [https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page Expertiza Wiki]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=158739</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=158739"/>
		<updated>2024-11-07T23:10:32Z</updated>

		<summary type="html">&lt;p&gt;Csingha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2450. Refactor assignments_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2458. User management and users table]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2472. Reimplement responses_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2484. Reimplement participants_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb (Phase 2 - Design Document)]]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb&amp;diff=157245</id>
		<title>CSC/ECE 517 Fall 2024 - E2456. Refactor teams user.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2456._Refactor_teams_user.rb&amp;diff=157245"/>
		<updated>2024-10-28T01:08:32Z</updated>

		<summary type="html">&lt;p&gt;Csingha: Created page with &amp;quot;==Expertiza==  Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The National Science Foundation supports the Expertiza project. It is used in select courses at NC State and by professors at several other colleges and universities.  [Expertiza](http://expertiza.ncsu.edu/) is a [Ruby on Rails](http://rubyonrails.org/) based open source project.  ==Problem Statement==  The teams_user.rb needs...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc).&lt;br /&gt;
The National Science Foundation supports the Expertiza project.&lt;br /&gt;
It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
[Expertiza](http://expertiza.ncsu.edu/) is a [Ruby on Rails](http://rubyonrails.org/) based open source project.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The teams_user.rb needs to be refactored from the Expertiza repository. The TeamsUser class is a join model between the Team and Participant classes with a many-to-many relationship. &lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
The main role of this class is to handle functionalities that deal with a team associated with an assignment/course and the participants (users associated with a course/assignment) in the team. The functionalities include retrieving a user’s name, deleting a user from the team, deleting the team if no participants are left in the team, adding a member to the team, finding the team ID for a user with a specific assignment, etc. Overall, it encapsulates the logic required to manage participants’ in teams within the context of assignments/courses in Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Refactor==&lt;br /&gt;
&lt;br /&gt;
The primary issue with the TeamsUser class is that it associates teams directly with users rather than with participants. In the context of the application, participants are users who are specifically associated with an assignment or a course. Since teams are formed within the scope of assignments or courses, handling team memberships through participants is more appropriate. Almost everywhere else, an assignment uses Participant objects rather than User objects. The exception is when it comes to Teams. It would simplify the design if it used TeamsParticipants instead of TeamsUsers.&lt;br /&gt;
&lt;br /&gt;
====Files Modified====&lt;br /&gt;
&lt;br /&gt;
Changed files:&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
==Refactoring==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Cases==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Next Steps==&lt;br /&gt;
We are yet to discuss the scope of this project and whether it can be extended to other functionalities in Expertiza.&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
&lt;br /&gt;
====Mentor====&lt;br /&gt;
&lt;br /&gt;
* Jayesh, Kiron&lt;br /&gt;
&lt;br /&gt;
====Members====&lt;br /&gt;
&lt;br /&gt;
* Agarwal, Arjit&lt;br /&gt;
* Manbhekar, Pranav&lt;br /&gt;
* Singhania, Chinmay&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
# [&amp;quot;Expertiza&amp;quot;](https://expertiza.ncsu.edu/)&lt;br /&gt;
# [&amp;quot;OSS Projects on Expertiza&amp;quot;](https://docs.google.com/document/d/1fB9nHsop_yptjcj3CFn80BcZjXcSDbzcWwKvBDUTVrQ/edit?tab=t.0)&lt;br /&gt;
# [&amp;quot;Github&amp;quot;](https://github.com/expertiza/expertiza)&lt;br /&gt;
# [&amp;quot;Expertiza VCL Server&amp;quot;](http://)&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157243</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157243"/>
		<updated>2024-10-28T00:54:48Z</updated>

		<summary type="html">&lt;p&gt;Csingha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;/div&gt;</summary>
		<author><name>Csingha</name></author>
	</entry>
</feed>