<?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=Khrawool</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=Khrawool"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Khrawool"/>
	<updated>2026-05-14T01:26:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150199</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150199"/>
		<updated>2023-04-26T01:15:55Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
&lt;br /&gt;
'''''1. Add TA Mapping Model.'''''&lt;br /&gt;
&lt;br /&gt;
We created a model ta_mapping to map the many to many relationship between Course and Teaching Assistant. The model has the following attributes of course_id and ta_id. Through ta_mapping we can keep track of all the TAs assigned to a Course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''2. Deleting the methods that are irrelevant from the controller.'''''&lt;br /&gt;
&lt;br /&gt;
'''Reason'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controllers are responsible for handling incoming requests and managing the flow of data between the model and the view. If a controller has methods that are not being used or are redundant, it can make the codebase harder to navigate and more difficult to maintain. Deleting unused or redundant methods from a controller can help to simplify the codebase and reduce the risk of errors. It can also make it easier for other developers to understand the code and make changes to it in the future.&lt;br /&gt;
&lt;br /&gt;
'''Work Done''' &amp;lt;br&amp;gt;&lt;br /&gt;
There are currently so many methods in the signup_sheet_controller which are absolute and are not being used for many years. So, we decide to remove those methods and cleanup up the controllers. Since, this is a reimplementation of the controller, we didn't include those absolute functions in our newer implementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''method removed'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''reason'''&lt;br /&gt;
|-&lt;br /&gt;
| user_on_team&lt;br /&gt;
| The functionality to check whether a user is a member of any team is associated with team model, follows Single Responsibility Principle   &lt;br /&gt;
|-&lt;br /&gt;
| action_allowed&lt;br /&gt;
| The course model class does not have the responsibility to check whether the user has instructor privileges.&lt;br /&gt;
|-&lt;br /&gt;
| list&lt;br /&gt;
| some part of this method which deals with the bidding logic will be removed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which are implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if create method returns a 201 Created status code if the course is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if create method returns a 422 Unprocessable Entity status code if the course cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if the delete method returns a 200 OK status code if the course is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if the delete method returns a 404 Not Found status code if the course cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the update method returns a 422 Unprocessable Entity status code if the course cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the copy method return 200 OK status code when new course is created successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the view_tas method returns 200 OK status code along with the list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the remove_ta method returns a 200 OK status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Swagger UI Courses'''&lt;br /&gt;
[[File:Rswag.png | 1200px | center]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150198</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150198"/>
		<updated>2023-04-26T01:15:08Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
&lt;br /&gt;
'''''1. Add TA Mapping Model.'''''&lt;br /&gt;
We created a model ta_mapping to map the many to many relationship between Course and Teaching Assistant. The model has the following attributes of course_id and ta_id. Through ta_mapping we can keep track of all the TAs assigned to a Course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''2. Deleting the methods that are irrelevant from the controller.'''''&lt;br /&gt;
&lt;br /&gt;
'''Reason'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controllers are responsible for handling incoming requests and managing the flow of data between the model and the view. If a controller has methods that are not being used or are redundant, it can make the codebase harder to navigate and more difficult to maintain. Deleting unused or redundant methods from a controller can help to simplify the codebase and reduce the risk of errors. It can also make it easier for other developers to understand the code and make changes to it in the future.&lt;br /&gt;
&lt;br /&gt;
'''Work Done''' &amp;lt;br&amp;gt;&lt;br /&gt;
There are currently so many methods in the signup_sheet_controller which are absolute and are not being used for many years. So, we decide to remove those methods and cleanup up the controllers. Since, this is a reimplementation of the controller, we didn't include those absolute functions in our newer implementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''method removed'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''reason'''&lt;br /&gt;
|-&lt;br /&gt;
| user_on_team&lt;br /&gt;
| The functionality to check whether a user is a member of any team is associated with team model, follows Single Responsibility Principle   &lt;br /&gt;
|-&lt;br /&gt;
| action_allowed&lt;br /&gt;
| The course model class does not have the responsibility to check whether the user has instructor privileges.&lt;br /&gt;
|-&lt;br /&gt;
| list&lt;br /&gt;
| some part of this method which deals with the bidding logic will be removed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which are implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if create method returns a 201 Created status code if the course is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if create method returns a 422 Unprocessable Entity status code if the course cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if the delete method returns a 200 OK status code if the course is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if the delete method returns a 404 Not Found status code if the course cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the update method returns a 422 Unprocessable Entity status code if the course cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the copy method return 200 OK status code when new course is created successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the view_tas method returns 200 OK status code along with the list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the remove_ta method returns a 200 OK status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Swagger UI Courses'''&lt;br /&gt;
[[File:Rswag.png | 1200px | center]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150197</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150197"/>
		<updated>2023-04-26T01:13:50Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
&lt;br /&gt;
'''''1. Deleting the methods that are irrelevant from the controller.'''''&lt;br /&gt;
&lt;br /&gt;
'''Reason'''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Controllers are responsible for handling incoming requests and managing the flow of data between the model and the view. If a controller has methods that are not being used or are redundant, it can make the codebase harder to navigate and more difficult to maintain. Deleting unused or redundant methods from a controller can help to simplify the codebase and reduce the risk of errors. It can also make it easier for other developers to understand the code and make changes to it in the future.&lt;br /&gt;
&lt;br /&gt;
'''Work Done''' &amp;lt;br&amp;gt;&lt;br /&gt;
There are currently so many methods in the signup_sheet_controller which are absolute and are not being used for many years. So, we decide to remove those methods and cleanup up the controllers. Since, this is a reimplementation of the controller, we didn't include those absolute functions in our newer implementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''method removed'''&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| '''reason'''&lt;br /&gt;
|-&lt;br /&gt;
| user_on_team&lt;br /&gt;
| The functionality to check whether a user is a member of any team is associated with team model, follows Single Responsibility Principle   &lt;br /&gt;
|-&lt;br /&gt;
| action_allowed&lt;br /&gt;
| The course model class does not have the responsibility to check whether the user has instructor privileges.&lt;br /&gt;
|-&lt;br /&gt;
| list&lt;br /&gt;
| some part of this method which deals with the bidding logic will be removed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Ta Mapping====&lt;br /&gt;
We created a model ta_mapping to map the many to many relationship between Course and Teaching Assistant. The model has the following attributes of course_id and ta_id. Through ta_mapping we can keep track of all the TAs assigned to a Course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which are implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if create method returns a 201 Created status code if the course is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if create method returns a 422 Unprocessable Entity status code if the course cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if the delete method returns a 200 OK status code if the course is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if the delete method returns a 404 Not Found status code if the course cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the update method returns a 422 Unprocessable Entity status code if the course cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the copy method return 200 OK status code when new course is created successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the view_tas method returns 200 OK status code along with the list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the remove_ta method returns a 200 OK status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Swagger UI Courses'''&lt;br /&gt;
[[File:Rswag.png | 1200px | center]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150184</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150184"/>
		<updated>2023-04-26T00:25:41Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Previous Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Ta Mapping====&lt;br /&gt;
We created a model ta_mapping to map the many to many relationship between Course and Teaching Assistant. The model has the following attributes of course_id and ta_id. Through ta_mapping we can keep track of all the TAs assigned to a Course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which would implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150181</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150181"/>
		<updated>2023-04-26T00:24:24Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Previous Work==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Previous !! Proposed changes || Rationale&lt;br /&gt;
|-&lt;br /&gt;
| 1 || user_on_team method in course.rb model &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
  def user_on_team?(user)&lt;br /&gt;
    teams = get_teams&lt;br /&gt;
    users = []&lt;br /&gt;
    teams.each do |team|&lt;br /&gt;
      users &amp;lt;&amp;lt; team.users&lt;br /&gt;
    end&lt;br /&gt;
    users.flatten.include? user&lt;br /&gt;
  end&lt;br /&gt;
'''&lt;br /&gt;
|| user_on_team method in team.rb || The functionality to check whether a user is a member of any team is associated with team model, follows Single Responsibility Principle &lt;br /&gt;
|-&lt;br /&gt;
| 2 || copy method present in controller &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
 # Create a copy of a course with a new submission directory&lt;br /&gt;
  def copy&lt;br /&gt;
    orig_course = Course.find(params[:id])&lt;br /&gt;
    new_course = orig_course.dup&lt;br /&gt;
    new_course.instructor_id = session[:user].id&lt;br /&gt;
    new_course.name = 'Copy of ' + orig_course.name&lt;br /&gt;
    new_course.directory_path = new_course.directory_path + '_copy'&lt;br /&gt;
    begin&lt;br /&gt;
      new_course.save!&lt;br /&gt;
      parent_id = CourseNode.get_parent_id&lt;br /&gt;
      if parent_id&lt;br /&gt;
        CourseNode.create(node_object_id: new_course.id, parent_id: parent_id)&lt;br /&gt;
      else&lt;br /&gt;
        CourseNode.create(node_object_id: new_course.id)&lt;br /&gt;
      end&lt;br /&gt;
      undo_link(&amp;quot;The course \&amp;quot;#{orig_course.name}\&amp;quot; has been successfully copied.&lt;br /&gt;
        Warning: The submission directory path for this copy is the original course's directory path appended with the word \&amp;quot;_copy\&amp;quot;.&lt;br /&gt;
        If you do not want this to happen, change the submission directory in the new copy of the course.&amp;quot;)&lt;br /&gt;
      redirect_to controller: 'courses', action: 'edit', id: new_course.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = 'The course was not able to be copied: ' + $ERROR_INFO&lt;br /&gt;
      redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''&lt;br /&gt;
|| copy method should be added in the model as well ||  The controller should not have the logic of copying the course attributes, instead, the controller should call the copy method defined in the model to create a copy of a course.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || action_allowed method in controller &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
 def action_allowed?&lt;br /&gt;
    current_user_has_instructor_privileges?&lt;br /&gt;
 end&lt;br /&gt;
'''&lt;br /&gt;
|| action_allowed method should be in a model which deals with authorization ||  The course model class does not have the responsibility to check whether the user has instructor privileges.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Ta Mapping====&lt;br /&gt;
We created a model ta_mapping to map the many to many relationship between Course and Teaching Assistant. The model has the following attributes of course_id and ta_id. Through ta_mapping we can keep track of all the TAs assigned to a Course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which would implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150176</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=150176"/>
		<updated>2023-04-26T00:20:39Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model stores information about the instructor and institution it belongs to, and it is associated with other models such as User, Assignment, etc. The course model is responsible for completing a variety of tasks, including returning the submission directory for the course, viewing students enrolled in the course, and adding a student to the course, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt; is responsible for managing courses. It performs CRUD operations on the Course model. It is responsible for creating, editing, deleting courses, and adding/removing teaching assistants to the course. The controller also returns a list of Teaching assistants associated with the course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The problem statement requires us to re-implement the Course model and CoursesController in a Rails application, with the goal of managing courses by allowing admins to create, edit, update, and delete courses, as well as create copies of existing courses. The re-implementation should follow RESTful conventions, including appropriate HTTP response codes and status codes for each endpoint. We are required to write RSpec tests for the Course model and the CoursesController, covering all endpoints and including appropriate HTTP response codes for every method. Tests for the controller will be made compatible with RSwag to generate API documentation and test REST APIs from the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
==Previous Work==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Previous !! Proposed changes || Rationale&lt;br /&gt;
|-&lt;br /&gt;
| 1 || user_on_team method in course.rb model &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
  def user_on_team?(user)&lt;br /&gt;
    teams = get_teams&lt;br /&gt;
    users = []&lt;br /&gt;
    teams.each do |team|&lt;br /&gt;
      users &amp;lt;&amp;lt; team.users&lt;br /&gt;
    end&lt;br /&gt;
    users.flatten.include? user&lt;br /&gt;
  end&lt;br /&gt;
'''&lt;br /&gt;
|| user_on_team method in team.rb || The functionality to check whether a user is a member of any team is associated with team model, follows Single Responsibility Principle &lt;br /&gt;
|-&lt;br /&gt;
| 2 || copy method present in controller &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
 # Create a copy of a course with a new submission directory&lt;br /&gt;
  def copy&lt;br /&gt;
    orig_course = Course.find(params[:id])&lt;br /&gt;
    new_course = orig_course.dup&lt;br /&gt;
    new_course.instructor_id = session[:user].id&lt;br /&gt;
    new_course.name = 'Copy of ' + orig_course.name&lt;br /&gt;
    new_course.directory_path = new_course.directory_path + '_copy'&lt;br /&gt;
    begin&lt;br /&gt;
      new_course.save!&lt;br /&gt;
      parent_id = CourseNode.get_parent_id&lt;br /&gt;
      if parent_id&lt;br /&gt;
        CourseNode.create(node_object_id: new_course.id, parent_id: parent_id)&lt;br /&gt;
      else&lt;br /&gt;
        CourseNode.create(node_object_id: new_course.id)&lt;br /&gt;
      end&lt;br /&gt;
      undo_link(&amp;quot;The course \&amp;quot;#{orig_course.name}\&amp;quot; has been successfully copied.&lt;br /&gt;
        Warning: The submission directory path for this copy is the original course's directory path appended with the word \&amp;quot;_copy\&amp;quot;.&lt;br /&gt;
        If you do not want this to happen, change the submission directory in the new copy of the course.&amp;quot;)&lt;br /&gt;
      redirect_to controller: 'courses', action: 'edit', id: new_course.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = 'The course was not able to be copied: ' + $ERROR_INFO&lt;br /&gt;
      redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
'''&lt;br /&gt;
|| copy method should be added in the model as well ||  The controller should not have the logic of copying the course attributes, instead, the controller should call the copy method defined in the model to create a copy of a course.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || action_allowed method in controller &lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
 def action_allowed?&lt;br /&gt;
    current_user_has_instructor_privileges?&lt;br /&gt;
 end&lt;br /&gt;
'''&lt;br /&gt;
|| action_allowed method should be in a model which deals with authorization ||  The course model class does not have the responsibility to check whether the user has instructor privileges.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of the Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller. The Strategy Pattern will be followed in the context of a controller, this pattern can be used to encapsulate the actions that the controller can perform and make them easily extensible and usable.&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || index || GET || List all courses&lt;br /&gt;
|-&lt;br /&gt;
| 2 || show|| GET || Method to get the course with the given id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || update || PUT || Method to update an existing course and save the changes to the database&lt;br /&gt;
|-&lt;br /&gt;
| 4 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 5 || create || POST || Creates a new course and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || view_tas || GET || Displays all the teaching assistants for the given course&lt;br /&gt;
|-&lt;br /&gt;
| 8 || add_ta || GET|| Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || remove_ta || GET|| Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[Image: UML.png]]&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which would implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/36&lt;br /&gt;
* '''Video Link:''' https://youtu.be/22wExrVX15o&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149139</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149139"/>
		<updated>2023-04-07T21:36:11Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails, which functions as a learning management software system. It has many different functions and abilities, including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and a list of operations that can be performed on the course model. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model and &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt;, which are the classes primarily addressed in this project, are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
Based on the current functionality of Course model and controller we have defined the following RESTful endpoints with their Request type which would be implemented in the controller.&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || action_allowed || HELPER FUNCTION || Determines whether the current user has permission to perform certain actions based on their role&lt;br /&gt;
|-&lt;br /&gt;
| 2 || auto_complete_for_user_name || GET || Provides an autocomplete feature for the form input when adding a TA&lt;br /&gt;
|-&lt;br /&gt;
| 3 || new || GET || Displays the form for creating a new course&lt;br /&gt;
|-&lt;br /&gt;
| 4 || edit|| GET || Method to get the course to edit&lt;br /&gt;
|-&lt;br /&gt;
| 5 || update || PUT || Method to update an existing course based on the form input and save the changes to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 7 || create || POST || Creates a new course based on the form input and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 8 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_teaching_assistant || GET || Displays all the teaching assistants for a course&lt;br /&gt;
|-&lt;br /&gt;
| 10 || add_ta || POST || Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 11 || remove_ta || POST || Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
| 12 || set_course_fields || POST || Called in Update and Create methods to set the fields of course&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || get_teams || Returns any predefined teams associated with a particular course object&lt;br /&gt;
|-&lt;br /&gt;
| 2 || get_participants || Returns multiple records of course participants from database given parent_id and user_id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || get_participant || Returns a single record course participant from Course Participant given parent_id&lt;br /&gt;
|-&lt;br /&gt;
| 4 || add _participant || Add a new Course Participant to the course given user_name&lt;br /&gt;
|-&lt;br /&gt;
| 5 || copy_participants || Copies all the participants from a given assignment to the current course&lt;br /&gt;
|-&lt;br /&gt;
| 6 || user_on_team || Checks whether a given user is a member of any team associated with the course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which would implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149138</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149138"/>
		<updated>2023-04-07T21:34:29Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails, which functions as a learning management software system. It has many different functions and abilities, including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and a list of operations that can be performed on the course model. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model and &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt;, which are the classes primarily addressed in this project, are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || action_allowed || HELPER FUNCTION || Determines whether the current user has permission to perform certain actions based on their role&lt;br /&gt;
|-&lt;br /&gt;
| 2 || auto_complete_for_user_name || GET || Provides an autocomplete feature for the form input when adding a TA&lt;br /&gt;
|-&lt;br /&gt;
| 3 || new || GET || Displays the form for creating a new course&lt;br /&gt;
|-&lt;br /&gt;
| 4 || edit|| GET || Method to get the course to edit&lt;br /&gt;
|-&lt;br /&gt;
| 5 || update || PUT || Method to update an existing course based on the form input and save the changes to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 7 || create || POST || Creates a new course based on the form input and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 8 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_teaching_assistant || GET || Displays all the teaching assistants for a course&lt;br /&gt;
|-&lt;br /&gt;
| 10 || add_ta || POST || Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 11 || remove_ta || POST || Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
| 12 || set_course_fields || POST || Called in Update and Create methods to set the fields of course&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || get_teams || Returns any predefined teams associated with a particular course object&lt;br /&gt;
|-&lt;br /&gt;
| 2 || get_participants || Returns multiple records of course participants from database given parent_id and user_id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || get_participant || Returns a single record course participant from Course Participant given parent_id&lt;br /&gt;
|-&lt;br /&gt;
| 4 || add _participant || Add a new Course Participant to the course given user_name&lt;br /&gt;
|-&lt;br /&gt;
| 5 || copy_participants || Copies all the participants from a given assignment to the current course&lt;br /&gt;
|-&lt;br /&gt;
| 6 || user_on_team || Checks whether a given user is a member of any team associated with the course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
The Course model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of Course model and controller we have defined the following test which would implemented to test the reimplemented code of course model and controller. &lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149127</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149127"/>
		<updated>2023-04-07T21:16:16Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails, which functions as a learning management software system. It has many different functions and abilities, including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and a list of operations that can be performed on the course model. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model and &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt;, which are the classes primarily addressed in this project, are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || action_allowed || HELPER FUNCTION || Determines whether the current user has permission to perform certain actions based on their role&lt;br /&gt;
|-&lt;br /&gt;
| 2 || auto_complete_for_user_name || GET || Provides an autocomplete feature for the form input when adding a TA&lt;br /&gt;
|-&lt;br /&gt;
| 3 || new || GET || Displays the form for creating a new course&lt;br /&gt;
|-&lt;br /&gt;
| 4 || edit|| GET || Method to get the course to edit&lt;br /&gt;
|-&lt;br /&gt;
| 5 || update || PUT || Method to update an existing course based on the form input and save the changes to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 7 || create || POST || Creates a new course based on the form input and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 8 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_teaching_assistant || GET || Displays all the teaching assistants for a course&lt;br /&gt;
|-&lt;br /&gt;
| 10 || add_ta || POST || Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 11 || remove_ta || POST || Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
| 12 || set_course_fields || POST || Called in Update and Create methods to set the fields of course&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || get_teams || Returns any predefined teams associated with a particular course object&lt;br /&gt;
|-&lt;br /&gt;
| 2 || get_participants || Returns multiple records of course participants from database given parent_id and user_id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || get_participant || Returns a single record course participant from Course Participant given parent_id&lt;br /&gt;
|-&lt;br /&gt;
| 4 || add _participant || Add a new Course Participant to the course given user_name&lt;br /&gt;
|-&lt;br /&gt;
| 5 || copy_participants || Copies all the participants from a given assignment to the current course&lt;br /&gt;
|-&lt;br /&gt;
| 6 || user_on_team || Checks whether a given user is a member of any team associated with the course&lt;br /&gt;
|-&lt;br /&gt;
| 7 || path || Returns the course's submission directory&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149126</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149126"/>
		<updated>2023-04-07T21:15:23Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails, which functions as a learning management software system. It has many different functions and abilities, including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and a list of operations that can be performed on the course model. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model and &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt;, which are the classes primarily addressed in this project, are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || action_allowed || HELPER FUNCTION || Determines whether the current user has permission to perform certain actions based on their role&lt;br /&gt;
|-&lt;br /&gt;
| 2 || auto_complete_for_user_name || GET || Provides an autocomplete feature for the form input when adding a TA&lt;br /&gt;
|-&lt;br /&gt;
| 3 || new || GET || Displays the form for creating a new course&lt;br /&gt;
|-&lt;br /&gt;
| 4 || edit|| GET || Method to get the course to edit&lt;br /&gt;
|-&lt;br /&gt;
| 5 || update || PUT || Method to update an existing course based on the form input and save the changes to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 7 || create || POST || Creates a new course based on the form input and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 8 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_teaching_assistant || GET || Displays all the teaching assistants for a course&lt;br /&gt;
|-&lt;br /&gt;
| 10 || add_ta || POST || Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 11 || remove_ta || POST || Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
| 12 || set_course_fields || POST || Called in Update and Create methods to set the fields of course&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || get_teams || Returns any predefined teams associated with a particular course object&lt;br /&gt;
|-&lt;br /&gt;
| 2 || get_participants || Returns multiple records of course participants from database given parent_id and user_id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || get_participant || Returns a single record course participant from Course Participant given parent_id&lt;br /&gt;
|-&lt;br /&gt;
| 4 || add _participant || Add a new Course Participant to the course given user_name&lt;br /&gt;
|-&lt;br /&gt;
| 5 || copy_participants || Copies all the participants from a given assignment to the current course&lt;br /&gt;
|-&lt;br /&gt;
| 6 || user_on_team || Checks whether a given user is a member of any team associated with the course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
====Tests====&lt;br /&gt;
'''Course Controller'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Course Model'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the model validates presence of name&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the model validates presence of directory_path&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if path method raises an error when there is no associated instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if path method returns a directory when there is an associated instructor.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149103</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149103"/>
		<updated>2023-04-07T20:34:50Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails, which functions as a learning management software system. It has many different functions and abilities, including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and a list of operations that can be performed on the course model. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; model and &amp;lt;code&amp;gt;CoursesController&amp;lt;/code&amp;gt;, which are the classes primarily addressed in this project, are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
====Controller====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Request Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || action_allowed || HELPER FUNCTION || Determines whether the current user has permission to perform certain actions based on their role&lt;br /&gt;
|-&lt;br /&gt;
| 2 || auto_complete_for_user_name || GET || Provides an autocomplete feature for the form input when adding a TA&lt;br /&gt;
|-&lt;br /&gt;
| 3 || new || GET || Displays the form for creating a new course&lt;br /&gt;
|-&lt;br /&gt;
| 4 || edit|| GET || Method to get the course to edit&lt;br /&gt;
|-&lt;br /&gt;
| 5 || update || PUT || Method to update an existing course based on the form input and save the changes to database&lt;br /&gt;
|-&lt;br /&gt;
| 6 || copy || GET || Creates a new copy of an existing course with a new submission directory and saves it to the database&lt;br /&gt;
|-&lt;br /&gt;
| 7 || create || POST || Creates a new course based on the form input and saves it to database&lt;br /&gt;
|-&lt;br /&gt;
| 8 || delete || DELETE || Method to delete an existing course&lt;br /&gt;
|-&lt;br /&gt;
| 9 || view_teaching_assistant || GET || Displays all the teaching assistants for a course&lt;br /&gt;
|-&lt;br /&gt;
| 10 || add_ta || POST || Method to add teaching assistant to a course&lt;br /&gt;
|-&lt;br /&gt;
| 11 || remove_ta || POST || Method to remove teaching assistant from a course&lt;br /&gt;
|-&lt;br /&gt;
| 12 || set_course_fields || POST || Called in Update and Create methods to set the fields of course&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Index !! Method !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || get_teams || Returns any predefined teams associated with a particular course object&lt;br /&gt;
|-&lt;br /&gt;
| 2 || get_participants || Returns multiple records of course participants from database given parent_id and user_id&lt;br /&gt;
|-&lt;br /&gt;
| 3 || get_participant || Returns a single record course participant from Course Participant given parent_id&lt;br /&gt;
|-&lt;br /&gt;
| 4 || add _participant || Add a new Course Participant to the course given user_name&lt;br /&gt;
|-&lt;br /&gt;
| 5 || copy_participants || Copies all the participants from a given assignment to the current course&lt;br /&gt;
|-&lt;br /&gt;
| 6 || user_on_team || Checks whether a given user is a member of any team associated with the course&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
====Tests====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2317:_Reimplement_participant.rb&amp;diff=149102</id>
		<title>CSC/ECE 517 Spring 2023 - E2317: Reimplement participant.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2317:_Reimplement_participant.rb&amp;diff=149102"/>
		<updated>2023-04-07T20:34:27Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Undo revision 149100 by Khrawool (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2317 OSS assignment for Spring 2023, CSC/ECE 517&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. It is a web application which is maintained collectively by NC State faculty and students which allows instructors to create new assignments and customize new or existing assignments. It also allows the instructors to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Overview of the Classes==&lt;br /&gt;
===participant.rb===&lt;br /&gt;
The participant.rb is a model class that has many associations with other models. There are many methods present in it such as fullname, name, team and handle. There is a method called delete which checks for any associations before performing the delete operation. The other methods include topic_name, mail_assigned_reviewers, able_to_review, email, authorization and self.sort_by_name. There is one more method self.export that returns the information of the participant as a CSV file.&lt;br /&gt;
&lt;br /&gt;
==Backgroud of the Project==&lt;br /&gt;
The participant.rb model has many new changes to be implemented. The reimplementation has to make sense and while checking the original model, we realised that some of the methods were irrelevant to participants model and that it has to be implemented in some other model. The changes mainly dealt with removing, merging and replacing methods to segregate methods with a single functionality relevant to participants model. Tests were written for all of the methods that were introduced and modified. Existing tests for the methods that were unchanged were run to ensure proper functioning of the model. Comments are added to each method to enhance readability. Further information about the reimplementations are discussed below.&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
The following changes were reimplemented in the participant.rb&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Tasks !! Status !! Testing &lt;br /&gt;
|-&lt;br /&gt;
| Replaced force_delete method with leave_team method&lt;br /&gt;
 || Implemented || Completed&lt;br /&gt;
|-&lt;br /&gt;
| mail_assigned_reviewers method was removed || Implemented || N/A&lt;br /&gt;
|-&lt;br /&gt;
| able_to_review method was eliminated || Implemented || N/A&lt;br /&gt;
|-&lt;br /&gt;
| email method was removed || Implemented || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Replaced force_delete Method with leave_team Method ===&lt;br /&gt;
The original 'force_delete' method would delete the participant from the team and if there is only one participant in the team then it would delete the team.  &lt;br /&gt;
[[File:E2317_force_delete.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
A new method 'leave_team' was introduced in place of 'force_delete' as 'force_delete' method is supposed to be present in the teams.rb and not participant.rb. The difference between force_delete method and this is that even if there is only one participant it wouldn't delete the team.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317__leave_team.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== mail_assigned_reviewers Method was Removed ===&lt;br /&gt;
The method 'Mail_assigned_reviewers' is responsible for sending an email to the assigned reviewer whenever a new submission is made. It would be more appropriate for this method to be included in teams.rb rather than participant.rb. Hence, this method was removed.&lt;br /&gt;
&lt;br /&gt;
=== able_to_review Method was Removed ===&lt;br /&gt;
'able_to_review' method is just using can_review value. This method can be eliminated.&lt;br /&gt;
&lt;br /&gt;
=== email Method was Removed ===&lt;br /&gt;
'email' method was removed as it was not required.&lt;br /&gt;
&lt;br /&gt;
=== Merged export and export_fields Methods ===&lt;br /&gt;
We didn't implement this task as merging two functions became a hassle for debugging and testing and fixing errors present in the code. Instead, it is generally considered good programming practice to break down large functions into smaller, more manageable ones. This principle is commonly known as the &amp;quot;Single Responsibility Principle,&amp;quot; which states that a function or module should have only one reason to change. By breaking down a large function into smaller functions, made our code more modular and easier to read, understand, and maintain.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317__export_exportfield.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
&lt;br /&gt;
The reimplementation codebase originally used Minitest to test the included models: assignment.rb, role.rb, and user.rb. But since Expertiza was originally tested with RSpec, we used RSpec to test out model. The participants.rb contains many methods and associations with other models. Hence, to test the methods in participants, the other dependent methods have to be stubbed. To deal with the models, dummy models/dummy app can be created which will act as the associated classes. We have created all the required dummy classes by scaffolding them.&lt;br /&gt;
&lt;br /&gt;
To create test fixtures and to build the required models, Factory Bot has been used. Two separate files, factories.rb and factory_bot.rb was created to build the factories.&lt;br /&gt;
&lt;br /&gt;
4 participants and other required fields were created as fixtures after which the tests were written.&lt;br /&gt;
&lt;br /&gt;
====Note====&lt;br /&gt;
&lt;br /&gt;
The dummy classes that were created and other dependencies that were specifically installed for testing have been pushed to a different branch to not let the main codebase clutter with empty models. &lt;br /&gt;
&lt;br /&gt;
To run the tests, kindly pull from the [https://github.com/amarthyasa/reimplementation-back-end/tree/testing_files testing_files] branch of the repository and run bundle install to install dependencies like RSpec and Factory Bot.&lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the team method returns the team of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the leave_team method deletes a participant if no associations exist and force is nil&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if the leave_team method deletes a participant if no associations exist and force is true&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if the leave_team method deletes a participant with associations and force is true and there are multiple team users&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the name method returns the name of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the fullname method returns the full name of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the handle method returns the handle of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the sort_by_name method returns a sorted list of participants in alphabetical order&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the topic_name method returns the participant topic name when nil&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the authorization method returns participant when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the authorization method returns reader when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the authorization method returns submitter when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the authorization method returns reviewer when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the authorization method returns submitter when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the authorization method returns reviewer when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if it returns participant data in the correct format.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Test if it exports the details of the participant correctly.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The test which checks if participant and team is deleted if only one participant is on a team is deleted since that implementation has been removed from the model.&lt;br /&gt;
&lt;br /&gt;
=====Test 1=====&lt;br /&gt;
This code is testing a method team and is expected to return the team associated with the participant. It is done by mocking the behavior of other objects that the team method relies on, specifically a user object and a team_user object. By mocking these dependencies, the test can focus on testing the behavior of the team method in isolation.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test1.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Tests 2 to 4=====&lt;br /&gt;
This is a set of tests for the delete method of a participant object. The first two tests check that a participant can be deleted if there are no associations, with and without the force parameter. The third test checks that a participant can be deleted even if there are associations with multiple team_users, but only if the force parameter is true. The allow method is used to set up mock behavior for the team and participant objects in the third test.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test234.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Test 5=====&lt;br /&gt;
This is a test block for the name method of the participant object. The test checks if calling name on a participant object returns the expected name of 'Jane'. If the method is working correctly, the test should pass.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test5.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Test 6=====&lt;br /&gt;
This is a test block for the fullname method of the participant object. The test checks if calling the full name on a participant object returns the expected name of 'Jane Doe'. If the method is working correctly, the test should pass.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test6.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Test 7=====&lt;br /&gt;
This code defines a test suite for the handle method of the participant object. The method takes a single parameter (nil in this case). The test case verifies that the handle method returns the string 'handle' when called with a nil argument.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test7.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Test 8=====&lt;br /&gt;
This is a test case for the sort_by_name method of the Participant class. The test checks whether the method returns a sorted list of participants in alphabetical order by their names. The test creates an array unsorted of three participant objects with unordered names and creates another array sorted of the same participants with names sorted alphabetically. The sort_by_name method is called with the unsorted array as its argument and the test expects the result to be the sorted array. If the method is implemented correctly, it should return the participants sorted by name in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test8.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Tests 9 to 10=====&lt;br /&gt;
This is a test suite for the #topic_name method of the Participant class. The first example checks that when the participant's topic attribute is nil, the method should return a default string. The second example checks that when the participant's topic attribute is not nil, the method should return the name attribute of the associated topic object. This is done by using the allow method to stub the topic method of the participant object and return a mock topic object with a name attribute of 'Hello world!'. Overall, these examples test the behavior of the #topic_name method in returning the correct string depending on the presence or absence of a topic object associated with the participant.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test910.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Tests 11 to 14=====&lt;br /&gt;
This is the test suite for the authorization method of the Participant class. The authorization method returns a string representing the participant's authorization level based on their permissions to submit, review, and take quizzes. Each test case checks if the method returns the expected authorization level when certain permissions are allowed or disallowed for the participant. The first test case tests the default authorization level of the participant when no permissions are set. The second and third test cases test for reader and submitter authorization levels, respectively, when the corresponding permissions are set. The fourth test case tests for reviewer authorization level when only the can_review permission is set.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test1114.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=====Tests 15 to 16=====&lt;br /&gt;
The first block of code describes a unit test for the export_fields method of the Participant class. It sets up a hash of options for the method and expects it to return an array of field names in a specific order. The second block of code describes a unit test for the export method of the Participant class. It sets up a parent_id variable, a csv array, and some options, and then sets up mock responses for the where and user methods to simulate a participant being found. It expects the export method to return an array of arrays representing the data for the found participant, in the order specified by the export_fields method.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317_Test1516.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/amarthyasa/reimplementation-back-end/tree/main&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Github repository branch for testing: https://github.com/amarthyasa/reimplementation-back-end/tree/testing_files&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Pull request: https://github.com/expertiza/reimplementation-back-end/pull/5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Testing video: https://drive.google.com/file/d/1VXMF8dbJgjcj68Y9pRTgXg2cJrfL9-_6/view?usp=sharing&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Rucha Kolekar&lt;br /&gt;
&lt;br /&gt;
===Student Team===&lt;br /&gt;
Amarthya Sivakumar Annu (asivaku5@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Ajay Krishna Raveendar (araveen@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
Kiron Jayesh (kjayesh@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2317:_Reimplement_participant.rb&amp;diff=149100</id>
		<title>CSC/ECE 517 Spring 2023 - E2317: Reimplement participant.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2317:_Reimplement_participant.rb&amp;diff=149100"/>
		<updated>2023-04-07T20:32:10Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E2317 OSS assignment for Spring 2023, CSC/ECE 517&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. It is a web application which is maintained collectively by NC State faculty and students which allows instructors to create new assignments and customize new or existing assignments. It also allows the instructors to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Overview of the Classes==&lt;br /&gt;
===participant.rb===&lt;br /&gt;
The participant.rb is a model class that has many associations with other models. There are many methods present in it such as fullname, name, team and handle. There is a method called delete which checks for any associations before performing the delete operation. The other methods include topic_name, mail_assigned_reviewers, able_to_review, email, authorization and self.sort_by_name. There is one more method self.export that returns the information of the participant as a CSV file.&lt;br /&gt;
&lt;br /&gt;
==Backgroud of the Project==&lt;br /&gt;
The participant.rb model has many new changes to be implemented. The reimplementation has to make sense and while checking the original model, we realised that some of the methods were irrelevant to participants model and that it has to be implemented in some other model. The changes mainly dealt with removing, merging and replacing methods to segregate methods with a single functionality relevant to participants model. Tests were written for all of the methods that were introduced and modified. Existing tests for the methods that were unchanged were run to ensure proper functioning of the model. Comments are added to each method to enhance readability. Further information about the reimplementations are discussed below.&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
The following changes were reimplemented in the participant.rb&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Tasks !! Status !! Testing &lt;br /&gt;
|-&lt;br /&gt;
| Replaced force_delete method with leave_team method&lt;br /&gt;
 || Implemented || Completed&lt;br /&gt;
|-&lt;br /&gt;
| mail_assigned_reviewers method was removed || Implemented || N/A&lt;br /&gt;
|-&lt;br /&gt;
| able_to_review method was eliminated || Implemented || N/A&lt;br /&gt;
|-&lt;br /&gt;
| email method was removed || Implemented || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Replaced force_delete Method with leave_team Method ===&lt;br /&gt;
The original 'force_delete' method would delete the participant from the team and if there is only one participant in the team then it would delete the team.  &lt;br /&gt;
[[File:E2317_force_delete.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
A new method 'leave_team' was introduced in place of 'force_delete' as 'force_delete' method is supposed to be present in the teams.rb and not participant.rb. The difference between force_delete method and this is that even if there is only one participant it wouldn't delete the team.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317__leave_team.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
=== mail_assigned_reviewers Method was Removed ===&lt;br /&gt;
The method 'Mail_assigned_reviewers' is responsible for sending an email to the assigned reviewer whenever a new submission is made. It would be more appropriate for this method to be included in teams.rb rather than participant.rb. Hence, this method was removed.&lt;br /&gt;
&lt;br /&gt;
=== able_to_review Method was Removed ===&lt;br /&gt;
'able_to_review' method is just using can_review value. This method can be eliminated.&lt;br /&gt;
&lt;br /&gt;
=== email Method was Removed ===&lt;br /&gt;
'email' method was removed as it was not required.&lt;br /&gt;
&lt;br /&gt;
=== Merged export and export_fields Methods ===&lt;br /&gt;
We didn't implement this task as merging two functions became a hassle for debugging and testing and fixing errors present in the code. Instead, it is generally considered good programming practice to break down large functions into smaller, more manageable ones. This principle is commonly known as the &amp;quot;Single Responsibility Principle,&amp;quot; which states that a function or module should have only one reason to change. By breaking down a large function into smaller functions, made our code more modular and easier to read, understand, and maintain.&lt;br /&gt;
&lt;br /&gt;
[[File:E2317__export_exportfield.jpg | 800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
&lt;br /&gt;
The reimplementation codebase originally used Minitest to test the included models: assignment.rb, role.rb, and user.rb. But since Expertiza was originally tested with RSpec, we used RSpec to test out model. The participants.rb contains many methods and associations with other models. Hence, to test the methods in participants, the other dependent methods have to be stubbed. To deal with the models, dummy models/dummy app can be created which will act as the associated classes. We have created all the required dummy classes by scaffolding them.&lt;br /&gt;
&lt;br /&gt;
To create test fixtures and to build the required models, Factory Bot has been used. Two separate files, factories.rb and factory_bot.rb was created to build the factories.&lt;br /&gt;
&lt;br /&gt;
4 participants and other required fields were created as fixtures after which the tests were written.&lt;br /&gt;
&lt;br /&gt;
====Note====&lt;br /&gt;
&lt;br /&gt;
The dummy classes that were created and other dependencies that were specifically installed for testing have been pushed to a different branch to not l'''Bold text'''et the main codebase clutter with empty models. &lt;br /&gt;
&lt;br /&gt;
To run the tests, kindly pull from the [https://github.com/amarthyasa/reimplementation-back-end/tree/testing_files testing_files] branch of the repository and run bundle install to install dependencies like RSpec and Factory Bot.&lt;br /&gt;
&lt;br /&gt;
====Tests====&lt;br /&gt;
&lt;br /&gt;
Course_controller tests&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the action_allowed disallows all actions when current user is student.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the action_allowed allows all course actions when current user is instructor.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if create method returns a 201 Created status code if the resource is successfully created.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if create method returns a 422 Unprocessable Entity status code if the resource cannot be created due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the delete method returns a 204 No Content status code if the resource is successfully deleted.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the delete method returns a 404 Not Found status code if the resource cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the new method sets the private instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the update method returns a 200 OK status code if the resource is successfully updated.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the update method returns a 422 Unprocessable Entity status code if the resource cannot be updated due to validation errors.&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the auto_complete_for_user_name method returns a list of users.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the copy method redirects to new course when new course id fetched successfully.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the view_teaching_assistants method returns list of TAs for the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the add_ta method returns a 200 OK status code if a TA added successfully to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the add_ta method returns a 422 Unprocessable Entity status code if a TA cannot be added to the course.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the remove_ta method returns a 204 No Content status code if the ta is successfully removed from the course.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if the remove_ta method returns a 404 Not Found status code if the ta cannot be found.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Tests if the set_course_fields method sets the course fields.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
&lt;br /&gt;
Github repository: https://github.com/amarthyasa/reimplementation-back-end/tree/main&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Github repository branch for testing: https://github.com/amarthyasa/reimplementation-back-end/tree/testing_files&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Pull request: https://github.com/expertiza/reimplementation-back-end/pull/5&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Testing video: https://drive.google.com/file/d/1VXMF8dbJgjcj68Y9pRTgXg2cJrfL9-_6/view?usp=sharing&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Rucha Kolekar&lt;br /&gt;
&lt;br /&gt;
===Student Team===&lt;br /&gt;
Amarthya Sivakumar Annu (asivaku5@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Ajay Krishna Raveendar (araveen@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
Kiron Jayesh (kjayesh@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149049</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149049"/>
		<updated>2023-04-07T19:14:03Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
====Tests====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if the team method returns the team of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if the leave_team method deletes a participant if no associations exist and force is nil&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if the leave_team method deletes a participant if no associations exist and force is true&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if the leave_team method deletes a participant with associations and force is true and there are multiple team users&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if the name method returns the name of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if the fullname method returns the full name of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if the handle method returns the handle of the participant&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if the sort_by_name method returns a sorted list of participants in alphabetical order&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if the topic_name method returns the participant topic name when nil&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Tests if the topic_name method returns the participant topic name when not nil.&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Tests if the authorization method returns participant when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Tests if the authorization method returns reader when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the authorization method returns submitter when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the authorization method returns reviewer when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Tests if the authorization method returns submitter when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Tests if the authorization method returns reviewer when no arguments are passed.&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Tests if it returns participant data in the correct format.&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Test if it exports the details of the participant correctly.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149044</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149044"/>
		<updated>2023-04-07T19:12:29Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/ameyagv/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:'''&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149038</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149038"/>
		<updated>2023-04-07T19:11:06Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
==Design Decisions==&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
==Testing Plan==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149030</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=149030"/>
		<updated>2023-04-07T19:08:19Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Refactor_course.rb_and_course_team.rb_models&amp;diff=148809</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Refactor_course.rb_and_course_team.rb_models&amp;diff=148809"/>
		<updated>2023-04-05T22:22:09Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Khrawool moved page CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models to CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)]]&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148808</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148808"/>
		<updated>2023-04-05T22:22:09Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Khrawool moved page CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models to CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148807</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148807"/>
		<updated>2023-04-05T22:21:51Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148806</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148806"/>
		<updated>2023-04-05T22:20:55Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E2332 - Refactor course.rb and course_team.rb models&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
What it does: The Course model and CoursesController is responsible for managing the courses. This system allows admin to create a new course, edit the course and update the existing course. It also allows you to create a copy of an existing course, etc.&lt;br /&gt;
&lt;br /&gt;
What needs to be done:&lt;br /&gt;
You have to exactly follow the reimplementation guidelines as stated on top and make sure that you have covered all the functionality that is required for the Courses. You will be responsible for the entire functionality of the Courses, the model and controller, and the detailed rspec test, testing all the pass and fail scenarios, for the rest endpoints are compulsory. &lt;br /&gt;
As mentioned in the guideline, take reference from the User (model &amp;amp; controller) implementation and look at roles_rspec.rb for the test, roles_rspec is not complete and there is potential for better testing but you can use that as a starting point.&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148805</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148805"/>
		<updated>2023-04-05T22:20:05Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E2332 - Refactor course.rb and course_team.rb models&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''VCL Server:''' &lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Khrawool&amp;diff=148804</id>
		<title>User:Khrawool</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Khrawool&amp;diff=148804"/>
		<updated>2023-04-05T22:18:28Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Khrawool moved page User:Khrawool to CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models]]&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148803</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148803"/>
		<updated>2023-04-05T22:18:28Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Khrawool moved page User:Khrawool to CSC/ECE 517/Spring 2023/E2332 Refactor course.rb and course team.rb models&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E2332 - Refactor course.rb and course_team.rb models&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148802</id>
		<title>CSC/ECE 517/Spring 2023/E2332 Reimplement Courses (Refactor course.rb)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2332_Reimplement_Courses_(Refactor_course.rb)&amp;diff=148802"/>
		<updated>2023-04-05T22:16:09Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: Created page with &amp;quot;E2332 - Refactor course.rb and course_team.rb models  ==Background==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E2332 - Refactor course.rb and course_team.rb models&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148627</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148627"/>
		<updated>2023-03-28T03:13:55Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
== CHANGES IN MODEL FILES ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/team.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;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN RSPEC FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/assignment_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb#diff-638390a8686ba4d2e18c1fc9dfbef22271c8a02bb5d56bf78ded42e428fcf8b1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN CONTROLLER FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Manual Testing&lt;br /&gt;
*''' Adding Course Team member'''&lt;br /&gt;
** Adding member student1922 to course CSC540&lt;br /&gt;
[[File:Before_adding_course_team_member.png|1000px|center|Add course member to team Radical]]&lt;br /&gt;
[[File:After_adding_course_team_member.png|1000px|center|Succesffully added member to the team]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files. The methods were tested for edge cases and positive and negative test cases were written. The refactored methods were updated in the test cases. &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''course_team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''course'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''assignment_team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team.rb'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_spec_output.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Coverage: ===&lt;br /&gt;
'''Before refactoring'''&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''After refactoring'''&lt;br /&gt;
[[File:coverage_refactor.jpg|center|frame|Coverage of codebase after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: assignment_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148615</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148615"/>
		<updated>2023-03-28T03:09:25Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
== CHANGES IN MODEL FILES ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/team.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;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN RSPEC FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/assignment_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb#diff-638390a8686ba4d2e18c1fc9dfbef22271c8a02bb5d56bf78ded42e428fcf8b1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN CONTROLLER FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''course_team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''course'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''assignment_team'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;'''team.rb'''&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_spec_output.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Coverage: ===&lt;br /&gt;
'''Before refactoring'''&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''After refactoring'''&lt;br /&gt;
[[File:coverage_refactor.jpg|center|frame|Coverage of codebase after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: assignment_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148603</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148603"/>
		<updated>2023-03-28T02:56:44Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Coverage: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
== CHANGES IN MODEL FILES ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/team.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;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN RSPEC FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/assignment_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb#diff-638390a8686ba4d2e18c1fc9dfbef22271c8a02bb5d56bf78ded42e428fcf8b1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN CONTROLLER FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
** Validation of presence of name and directory path&lt;br /&gt;
** return If directory is return when an associated instructor is p&lt;br /&gt;
[[File:course_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
*'''course'''&lt;br /&gt;
**&lt;br /&gt;
[[File:course_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
**&lt;br /&gt;
[[File:assignment_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
*'''team.rb'''&lt;br /&gt;
**&lt;br /&gt;
[[File:team_spec_output.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Coverage: ===&lt;br /&gt;
'''Before refactoring'''&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''After refactoring'''&lt;br /&gt;
[[File:coverage_refactor.jpg|center|frame|Coverage of codebase after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: assignment_team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage_refactor.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; after refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_coverage_refactor.jpg&amp;diff=148601</id>
		<title>File:Course coverage refactor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_coverage_refactor.jpg&amp;diff=148601"/>
		<updated>2023-03-28T02:55:43Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_coverage_refactor.jpg&amp;diff=148598</id>
		<title>File:Assignment team coverage refactor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_coverage_refactor.jpg&amp;diff=148598"/>
		<updated>2023-03-28T02:55:07Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_coverage_refactor.jpg&amp;diff=148596</id>
		<title>File:Course team coverage refactor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_coverage_refactor.jpg&amp;diff=148596"/>
		<updated>2023-03-28T02:53:45Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_coverage_refactor.jpg&amp;diff=148595</id>
		<title>File:Team coverage refactor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_coverage_refactor.jpg&amp;diff=148595"/>
		<updated>2023-03-28T02:52:56Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_refactor.jpg&amp;diff=148593</id>
		<title>File:Coverage refactor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_refactor.jpg&amp;diff=148593"/>
		<updated>2023-03-28T02:52:08Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148588</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148588"/>
		<updated>2023-03-28T02:46:45Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
== CHANGES IN MODEL FILES ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/team.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;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN RSPEC FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/assignment_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb#diff-638390a8686ba4d2e18c1fc9dfbef22271c8a02bb5d56bf78ded42e428fcf8b1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN CONTROLLER FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
** Validation of presence of name and directory path&lt;br /&gt;
** return If directory is return when an associated instructor is p&lt;br /&gt;
[[File:course_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
*'''course'''&lt;br /&gt;
**&lt;br /&gt;
[[File:course_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
**&lt;br /&gt;
[[File:assignment_team_spec.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
*'''team.rb'''&lt;br /&gt;
**&lt;br /&gt;
[[File:team_spec_output.jpg|1000px|center|Test passing for &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Coverage: ===&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_spec_output.jpg&amp;diff=148587</id>
		<title>File:Team spec output.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_spec_output.jpg&amp;diff=148587"/>
		<updated>2023-03-28T02:46:26Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_spec.jpg&amp;diff=148586</id>
		<title>File:Course spec.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_spec.jpg&amp;diff=148586"/>
		<updated>2023-03-28T02:45:09Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_spec.jpg&amp;diff=148584</id>
		<title>File:Assignment team spec.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_spec.jpg&amp;diff=148584"/>
		<updated>2023-03-28T02:44:36Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_spec.jpg&amp;diff=148578</id>
		<title>File:Course team spec.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_spec.jpg&amp;diff=148578"/>
		<updated>2023-03-28T02:40:22Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148576</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148576"/>
		<updated>2023-03-28T02:35:51Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
== CHANGES IN MODEL FILES ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/team.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;
|Added Import Functionality  &lt;br /&gt;
|DESCRIPTIONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN RSPEC FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/972c66e47fbc22965490cc4da3ae69a56d076d6b Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/assignment_team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/2bae1785a15caede251f81517ecf944302f80d89 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/team_spec.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;
|Import functionality changes&amp;lt;/code&amp;gt;&lt;br /&gt;
|Test cases are added to rspec file as well for import functionality changes.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/53a86107644d3a0b0bef28a42d499a0b7b386ebb#diff-638390a8686ba4d2e18c1fc9dfbef22271c8a02bb5d56bf78ded42e428fcf8b1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CHANGES IN CONTROLLER FILES ==&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
** Validation of presence of name and directory path&lt;br /&gt;
** return If directory is return when an associated instructor is p&lt;br /&gt;
*'''course'''&lt;br /&gt;
**&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
**&lt;br /&gt;
&lt;br /&gt;
Coverage:&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148488</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148488"/>
		<updated>2023-03-27T23:56:10Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes in Model Files ===&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in RSPEC Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in Controller Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
-&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Coverage:&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148486</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148486"/>
		<updated>2023-03-27T23:54:49Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes in Model Files ===&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in RSPEC Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in Controller Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Coverage:&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_coverage.jpg&amp;diff=148485</id>
		<title>File:Team coverage.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Team_coverage.jpg&amp;diff=148485"/>
		<updated>2023-03-27T23:54:13Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148481</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=148481"/>
		<updated>2023-03-27T23:51:03Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The renaming problem required us to change a few methods calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the methods.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; is a subclass of the team class. CourseTeams are a type of team that an instructor can use throughout an entire semester, providing consistency in team membership over time. The course_team model is responsible for completing various tasks, including returning the course of the team, adding a participant to the CourseTeam, and copying the CourseTeam Participants to AssignmentTeam Participants. There are methods for importing and exporting data to/from CSV files for CourseTeam objects. The problem description lists code smells/issues that need to be fixed. The issues that we fixed were deleting unused methods, renaming methods, and changing method calls, changing rspec expectations, adding meaningful comments. To refactor methods, DRY principles were used. In addition, analogous changes were made in the assignment_team model.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes in Model Files ===&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in RSPEC Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes in Controller Files ===&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Coverage:&lt;br /&gt;
[[File:course_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:course_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:assignment_team_coverage.jpg|center|frame|Coverage of &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt; before refactoring]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:coverage_old.jpg|center|frame|Coverage of codebase before refactoring]]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_old.jpg&amp;diff=148477</id>
		<title>File:Coverage old.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Coverage_old.jpg&amp;diff=148477"/>
		<updated>2023-03-27T23:49:46Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_coverage.jpg&amp;diff=148472</id>
		<title>File:Assignment team coverage.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Assignment_team_coverage.jpg&amp;diff=148472"/>
		<updated>2023-03-27T23:48:03Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_coverage.jpg&amp;diff=148469</id>
		<title>File:Course coverage.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_coverage.jpg&amp;diff=148469"/>
		<updated>2023-03-27T23:46:43Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_coverage.jpg&amp;diff=148466</id>
		<title>File:Course team coverage.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Course_team_coverage.jpg&amp;diff=148466"/>
		<updated>2023-03-27T23:42:24Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147965</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147965"/>
		<updated>2023-03-22T21:28:39Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Files Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; model stores information about the instructor and institution and is associated with other models such as User, CourseParticipant, CourseTeam, Assignment, AssignmentParticipant, and Notification. The course model is responsible for completing a variety of tasks, including returning course teams, returning the submission directory for the course, viewing participants enrolled in the course, adding a participant to the course, copying the Assignment Participants to Course Participants, and checking whether a user is part of any CourseTeam. The problem description lists code smells that need to be fixed. We fixed some issues, such as deleting the unused methods and renaming methods to indicate their action. The remaining problem required us to change a few method calls where the function to be renamed was used. Also, to reduce the cognitive complexity of the copy_assignment_participants method, we created a method to separate the raising error functionality. Comments were added to indicate the action of the method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2548/commits/8fb9bf9a793b8c154bc2b640daa630624e008a86 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|Created method &amp;lt;code&amp;gt;raise_errors&amp;lt;/code&amp;gt;&lt;br /&gt;
|To reduce Cognitive Complexity of method &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call the assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|As this method is copying a CourseTeam to an AssignmentTeam, renamed it as &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;. A suggestion for copy method in AssignmentTeam would be to rename it as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-56ab3d3b28f0be68663223f0a5ef9daa5c8d106caca412481562272ab2edfae1 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/assignment_team.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; method for AssignmentTeam &lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for copying current AssignmentTeam to CourseTeam as &amp;lt;code&amp;gt;copy_to_course_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/b93df2590a7ab52f87a1df00512afe626fa81520 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b#diff-8b753735f47ae84fdf88f7e9f15e08b8dd13ba1bc8fd16abad11148800aa8954 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147899</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147899"/>
		<updated>2023-03-22T19:34:23Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updated at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; factories and removed hardcoded variables&lt;br /&gt;
|Cleaned up hardcoded &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; models with premade factories to improve readability of the code&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/commit/96376e0b633e6b6e08d472a4cb4600d20e0c024f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147898</id>
		<title>CSC/ECE 517/Spring 2023/E2308. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517/Spring_2023/E2308._Refactor_course.rb_and_course_team.rb_models&amp;diff=147898"/>
		<updated>2023-03-22T19:34:08Z</updated>

		<summary type="html">&lt;p&gt;Khrawool: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Team Contact ==&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Kartiki Bhandakkar, kbhanda3&lt;br /&gt;
&lt;br /&gt;
== Overview of Expertiza ==&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. Part of its functionality is a system containing information about the course and its associated teams respectively. The &amp;lt;code&amp;gt;Course&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;CourseTeam&amp;lt;/code&amp;gt; which are the models primarily addressed in this project are both critical components in providing this functionality.&lt;br /&gt;
&lt;br /&gt;
== Description of Project ==&lt;br /&gt;
&amp;lt;code&amp;gt;auth_controller&amp;lt;/code&amp;gt; is used for authentication purposes. The controller completes a variety of tasks including handling the correct user logins, incorrect passwords, unknown users, and making sure the session and role information is updated at all points in that process. The original problem description listed three issues, two of which had since been corrected by other code changes since the document was written. The remaining problem was that some logger messages were included in methods that could be placed more cleanly in &amp;lt;code&amp;gt;before_action&amp;lt;/code&amp;gt; methods. Also, I personally noticed that there was a few lines of repeated code involved in resetting the role cache that needed to be combined into a shared private method.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;password_retrieval_controller&amp;lt;/code&amp;gt; deals with the process of updating and resetting a user password. The &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; method generates a token and appends it to a password reset URL. If a user submits a valid email address on the &amp;lt;code&amp;gt;password_retrieval/forgotten&amp;lt;/code&amp;gt; view, the URL is sent to the user's email. When a user goes to the password reset URL, the token parameter is decrypted and checked for expiration. Next, the &amp;lt;code&amp;gt;password_retrieval/reset_password&amp;lt;/code&amp;gt; view is loaded where a user enters an updated password and is sent back to the home page. In this project, the method was refactored in the following ways: to adhere to DRY principles, removal of hardwired constants, renaming of methods and variables, and enhanced comments. In addition, RSpec testing coverage of the controller was improved from 63.33% to 91.8% through a series of new tests that validate the functionality of the &amp;lt;code&amp;gt;update_password&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;send_password&amp;lt;/code&amp;gt; methods.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course.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;
|Checked and Removed &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method  &lt;br /&gt;
|Checked the usage of Method through IDE whether the function is used, the only call was from &amp;lt;code&amp;gt;course_spec.rb&amp;lt;/code&amp;gt; and not from anywhere else. Hence, removed from &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method&lt;br /&gt;
|Renamed &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt; which makes more sense and a clear idea of how method works and what is the purpose of method.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|Removed &amp;lt;code&amp;gt;add_member&amp;lt;/code&amp;gt; method from &amp;lt;code&amp;gt;course_team&amp;lt;/code&amp;gt; model&lt;br /&gt;
|Assignment_team and Course_team are subclasses of Team. Both should follow the similar logic of adding members of respective teams. As of for, add_participants, usage is different for course.rb and course_team.rb, hence it should be present in both. However, to make the code more consistent among classes, team, course_team, and assignment_team, the add_member method should only be present in the team class.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/7c1ae764d2d64e0246422934f292b9b2fe43a031 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/models/course_team.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;
|Removed &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; &lt;br /&gt;
|CourseTeam and AssignmentTeam inherit from Team class. The teams' table has an attribute &amp;lt;code&amp;gt;parent_id&amp;lt;/code&amp;gt; that helps determine whether the team is AssigmentTeam or CourseTeam. Thus, there is no need for &amp;lt;code&amp;gt;assignment_id&amp;lt;/code&amp;gt; in the CourseTeam class and no need for &amp;lt;code&amp;gt;course_id&amp;lt;/code&amp;gt; in AssignmentTeam class. It will be a bad coding practice to call assignment_id method on the CourseTeam object, calling the course_id method on the AssignmentTeam object as it would be inappropriate.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/ef9727542999c6cdbf2334f5b62ebb30fbfe8cdd Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_spec.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;
|Removed the test case for &amp;lt;code&amp;gt;get_paprticipant&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Removed the test case for &amp;lt;code&amp;gt;get_participant&amp;lt;/code&amp;gt; method as the method was not used anywhere else in the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/63c62027d8cb3aebe281a6152113632aafc444ec Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Added &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; factories and removed hardcoded variables&lt;br /&gt;
|Cleaned up hardcoded &amp;lt;code&amp;gt;User&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PasswordReset&amp;lt;/code&amp;gt; models with premade factories to improve readability of the code&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e946533235846a853ee42908b15e75d628552f9e Commit]&amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/commit/96376e0b633e6b6e08d472a4cb4600d20e0c024f Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;spec/models/course_team_spec.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 &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; method test case&lt;br /&gt;
|Renamed the respective method of &amp;lt;code&amp;gt;copy_participants&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_assignment_participants&amp;lt;/code&amp;gt;in rspec file as well.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/5177376c0f9a4f1890f49879bbbbfee0b28b8263 Commit]&amp;lt;br&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Changes to &amp;lt;code&amp;gt;app/controllers/teams_controller.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 &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;copy_to_assignment_team&amp;lt;/code&amp;gt; &lt;br /&gt;
|The change was directly related to changes of copy method in &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/372b8d44dfbc3b29c07f41500a5cc53d23cf577b Commit]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''Note: Code Climate was not running on Expertiza's beta branch for the last four days of the project. We have done the best we could to removed extraneous lines and white spaces.''' &lt;br /&gt;
&lt;br /&gt;
All the suggested changes were made to &amp;lt;code&amp;gt;course.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;course_team.rb&amp;lt;/code&amp;gt;, all these models were amended and as a result we need to update the tests. We added or amended tests in their respective .spec files&lt;br /&gt;
&lt;br /&gt;
*'''course_team'''&lt;br /&gt;
*'''course'''&lt;br /&gt;
*'''assignment_team'''&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* '''Github Repository:''' https://github.com/kartikrawool/expertiza/tree/refactor_course&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2548&lt;br /&gt;
* '''VCL Server:''' http://152.7.178.105:8080/&lt;br /&gt;
&lt;br /&gt;
== Contributors to this project ==&lt;br /&gt;
* Kartik Rawool, (unityID:khrawool, GitHub:kartikrawool)&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
* Vikram Pande, (unityID:vspande, GitHub:vikrampande7)&lt;/div&gt;</summary>
		<author><name>Khrawool</name></author>
	</entry>
</feed>