<?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=Mpundli</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=Mpundli"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mpundli"/>
	<updated>2026-08-26T01:08:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160340</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160340"/>
		<updated>2024-12-04T00:13:19Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Added ColumnButton UI component for Button with Tooltips. This component can be extended in other components and can act as a wrapper. &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments.&lt;br /&gt;
**Unit test cases written in Jest - This code contains a set of unit tests for the `ColumnButton` component in a React application, using `@testing-library/react` and `jest`. It mocks components from the `react-bootstrap` library, such as `Button`, `Tooltip`, and `OverlayTrigger`, to simplify the tests without relying on the actual library. The tests check the behavior of the `ColumnButton` component by verifying its functionality under different conditions. First, it ensures that the `onClick` function is called when the button is clicked. The second test checks that a tooltip is rendered when the `tooltip` prop is provided, while the third test confirms that the tooltip is not rendered when the `tooltip` prop is undefined. These tests ensure the component behaves correctly with respect to user interaction and conditional rendering of the tooltip.&lt;br /&gt;
[[File:UT-1.png]]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;br /&gt;
*[https://www.youtube.com/watch?v=pbi0EzmWJrw Demo Link]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160338</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160338"/>
		<updated>2024-12-04T00:08:02Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Added ColumnButton UI component for Button with Tooltips. This component can be extended in other components and can act as a wrapper. &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments.&lt;br /&gt;
**Unit test cases written in Jest - This code contains a set of unit tests for the `ColumnButton` component in a React application, using `@testing-library/react` and `jest`. It mocks components from the `react-bootstrap` library, such as `Button`, `Tooltip`, and `OverlayTrigger`, to simplify the tests without relying on the actual library. The tests check the behavior of the `ColumnButton` component by verifying its functionality under different conditions. First, it ensures that the `onClick` function is called when the button is clicked. The second test checks that a tooltip is rendered when the `tooltip` prop is provided, while the third test confirms that the tooltip is not rendered when the `tooltip` prop is undefined. These tests ensure the component behaves correctly with respect to user interaction and conditional rendering of the tooltip.&lt;br /&gt;
[[File:UT-1.png]]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160336</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160336"/>
		<updated>2024-12-04T00:06:43Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments.&lt;br /&gt;
**Unit test cases written in Jest - This code contains a set of unit tests for the `ColumnButton` component in a React application, using `@testing-library/react` and `jest`. It mocks components from the `react-bootstrap` library, such as `Button`, `Tooltip`, and `OverlayTrigger`, to simplify the tests without relying on the actual library. The tests check the behavior of the `ColumnButton` component by verifying its functionality under different conditions. First, it ensures that the `onClick` function is called when the button is clicked. The second test checks that a tooltip is rendered when the `tooltip` prop is provided, while the third test confirms that the tooltip is not rendered when the `tooltip` prop is undefined. These tests ensure the component behaves correctly with respect to user interaction and conditional rendering of the tooltip.&lt;br /&gt;
[[File:UT-1.png]]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160332</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160332"/>
		<updated>2024-12-04T00:04:59Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments.&lt;br /&gt;
**Unit test cases written in Jest&lt;br /&gt;
[[File:UT-1.png]]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160330</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160330"/>
		<updated>2024-12-04T00:04:43Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments.&lt;br /&gt;
**Unit test cases written in Jest&lt;br /&gt;
[[File:UT-1.png]]&lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UT-1.png&amp;diff=160329</id>
		<title>File:UT-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UT-1.png&amp;diff=160329"/>
		<updated>2024-12-04T00:04:22Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160325</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160325"/>
		<updated>2024-12-04T00:01:43Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* High-Level System Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160324</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160324"/>
		<updated>2024-12-04T00:01:08Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
**User Retrieval: The code now fetches the user based on the user_id parameter (params[:user_id]) instead of ta_id, which means it is no longer using params[:ta_id] for the user lookup.&lt;br /&gt;
**Error Handling: If the user doesn't exist, an error message indicating the invalid user_id is returned.&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
[[File:Add-TA-method.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Code-1.jpeg]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Add-TA-method.jpeg&amp;diff=160321</id>
		<title>File:Add-TA-method.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Add-TA-method.jpeg&amp;diff=160321"/>
		<updated>2024-12-03T23:56:22Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Code-1.jpeg&amp;diff=160320</id>
		<title>File:Code-1.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Code-1.jpeg&amp;diff=160320"/>
		<updated>2024-12-03T23:55:27Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160318</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160318"/>
		<updated>2024-12-03T23:52:50Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-7.jpeg&amp;diff=160316</id>
		<title>File:UI-7.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-7.jpeg&amp;diff=160316"/>
		<updated>2024-12-03T23:52:17Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160315</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160315"/>
		<updated>2024-12-03T23:52:09Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg|width=50px|height=200px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
[[File:UI-5.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
[[File:UI-2.jpeg]]&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160306</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160306"/>
		<updated>2024-12-03T23:48:07Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[File:UI-6.jpeg | width=500px | height=300px]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160303</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160303"/>
		<updated>2024-12-03T23:43:46Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
[[UI-6.jpeg]]&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-6.jpeg&amp;diff=160298</id>
		<title>File:UI-6.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-6.jpeg&amp;diff=160298"/>
		<updated>2024-12-03T23:41:03Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-5.jpeg&amp;diff=160292</id>
		<title>File:UI-5.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-5.jpeg&amp;diff=160292"/>
		<updated>2024-12-03T23:40:10Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-4.jpeg&amp;diff=160290</id>
		<title>File:UI-4.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-4.jpeg&amp;diff=160290"/>
		<updated>2024-12-03T23:39:53Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-3.jpeg&amp;diff=160289</id>
		<title>File:UI-3.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-3.jpeg&amp;diff=160289"/>
		<updated>2024-12-03T23:39:34Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-2.jpeg&amp;diff=160288</id>
		<title>File:UI-2.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UI-2.jpeg&amp;diff=160288"/>
		<updated>2024-12-03T23:38:23Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:TA_Added.jpeg&amp;diff=160285</id>
		<title>File:TA Added.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:TA_Added.jpeg&amp;diff=160285"/>
		<updated>2024-12-03T23:37:44Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160283</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160283"/>
		<updated>2024-12-03T23:31:14Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
&lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160282</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160282"/>
		<updated>2024-12-03T23:28:29Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Backend Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Place the course name below the search box. &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160281</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160281"/>
		<updated>2024-12-03T23:28:13Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Place the course name below the search box. &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id]. &lt;br /&gt;
**Implement validations to check if the user is already a TA. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160280</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=160280"/>
		<updated>2024-12-03T23:25:45Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Front-End Enhancements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks an intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Place the course name below the search box. &lt;br /&gt;
**Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy). &lt;br /&gt;
**Relocate the Delete button to the end for better UX flow. &lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page: &lt;br /&gt;
**Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Update the button with an improved icon and tooltip. &lt;br /&gt;
&lt;br /&gt;
* Add TAs Page: &lt;br /&gt;
**Introduce a TA search by name functionality. &lt;br /&gt;
**Show an error popup with separated title and error details. &lt;br /&gt;
**Limit the dropdown/search suggestions to only unassigned TAs. &lt;br /&gt;
**Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
*Controller Modification: &lt;br /&gt;
**Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id]. &lt;br /&gt;
**Implement validations to check if the user is already a TA. &lt;br /&gt;
&lt;br /&gt;
*Course Model Update: &lt;br /&gt;
**Refactor add_ta in course.rb to accept a list of TAs, validate each, and return an aggregated success or error response. &lt;br /&gt;
**Update TaMapping model to link users and courses in bulk, and change user roles appropriately. &lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
====High-Level Request Flow:====&lt;br /&gt;
&lt;br /&gt;
*User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
*Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
*Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_1.png]]&lt;br /&gt;
&lt;br /&gt;
====Detailed Flow Description:====&lt;br /&gt;
&lt;br /&gt;
*1. User Interaction (Frontend): &lt;br /&gt;
**The instructor selects one or more TAs and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A POST request is sent to the backend API at /courses/:id/add_tas, including the ta_ids (IDs of the TAs to be added). &lt;br /&gt;
&lt;br /&gt;
* Backend Processing: &lt;br /&gt;
** Controller: The backend courses_controller.rb processes the request. &lt;br /&gt;
***The backend checks if the provided TAs are valid (exist in the system and are not already assigned). &lt;br /&gt;
***Each TA’s role is updated to TEACHING_ASSISTANT in the users table. &lt;br /&gt;
***A new entry in the TaMapping table is created, associating the TA with the course. &lt;br /&gt;
&lt;br /&gt;
* Database Update (Backend Models): &lt;br /&gt;
**TaMapping Table: A new mapping is added to associate the user (TA) with the course. &lt;br /&gt;
**User Table: The role of the user is updated to TEACHING_ASSISTANT to reflect the new responsibilities. &lt;br /&gt;
&lt;br /&gt;
* Response:  &lt;br /&gt;
**If successful, the backend returns a 200 OK status, and the frontend updates the UI to reflect the changes. &lt;br /&gt;
**If any errors occur (e.g., invalid TA or duplicate assignment), the backend returns a 400 Bad Request response with error details. &lt;br /&gt;
&lt;br /&gt;
* UI Update: &lt;br /&gt;
**The frontend receives the response and updates the UI, either displaying a success message or showing the appropriate error message. &lt;br /&gt;
&lt;br /&gt;
* UML Diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:UML_2.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
* Rspec Unit Tests: &lt;br /&gt;
**Test add_ta method for successful assignment, duplicate assignment, and invalid user errors. &lt;br /&gt;
**Validate add_multiple_tas to ensure successful batch assignments. &lt;br /&gt;
&lt;br /&gt;
* Manual UI Testing: &lt;br /&gt;
**Verify course page modifications (icon and button placements). &lt;br /&gt;
**Confirm TA search and dropdown limitations. &lt;br /&gt;
**Validate successful addition and error messaging for single and multiple TA assignments. &lt;br /&gt;
&lt;br /&gt;
==UML Diagrams==&lt;br /&gt;
&lt;br /&gt;
* High-Level System Architecture: &lt;br /&gt;
**Show interaction flow between the frontend, courses_controller, and course.rb model. &lt;br /&gt;
&lt;br /&gt;
* TA Addition Sequence Diagram: &lt;br /&gt;
**Depict the sequence for assigning multiple TAs and handling responses.&lt;br /&gt;
&lt;br /&gt;
==Project Mentor==&lt;br /&gt;
*Devansh Shah (dshah8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
*Makarand Pundlik (mpundli@ncsu.edu)&lt;br /&gt;
*Anurag Gorkar (adgorkar@ncsu.edu)&lt;br /&gt;
*Rutvik Kulkarni (rvkulkar@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*[https://github.com/MakarandPundlik/reimplementation-front-end Frontend Repo]&lt;br /&gt;
*[https://github.com/AnuragGorkar/reimplementation-back-end Backend Repo]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-back-end/pull/132 Backend PR]&lt;br /&gt;
*[https://github.com/expertiza/reimplementation-front-end/pull/72 Frontend PR]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=159125</id>
		<title>CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2488_Reimplementation_of_Add_TA_to_course&amp;diff=159125"/>
		<updated>2024-11-12T19:33:05Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: Created page with &amp;quot;__TOC__  ==Introduction==  The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management pro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is an open-source, Ruby on Rails-based platform designed to facilitate peer reviews, enabling students to learn from each other. The platform serves faculty and students for managing courses, assignments, and peer evaluations. The management screens in Expertiza provide essential information on users, courses, assignments, questionnaires, and reviews. The project’s goal is to make the course and assignment management process more efficient while improving the user experience for both instructors and students.This document outlines design improvements for the course management application, focusing on the management of Teaching Assistants (TAs) and interface modifications for the course pages. The document will walk through both front-end and back-end updates, including interface changes, TA search functionality, error handling, and the addition of multiple TAs to a course.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
The current TA management and course pages lack several functionalities, resulting in usability issues. Specifically:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Interface:&amp;lt;/b&amp;gt; The interface requires rearrangement of elements, better iconography, and enhanced user interactions.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; The TA assignment process needs improved filtering, error handling, and the ability to assign multiple TAs at once.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Backend TA Handling:&amp;lt;/b&amp;gt; The backend API requires updates to accurately handle TA assignments, role changes, and validations. &lt;br /&gt;
&lt;br /&gt;
==Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Course Management:&amp;lt;/b&amp;gt; Includes a course list with an actions column for editing, deletion, and user management.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Management:&amp;lt;/b&amp;gt; TA addition is handled through add_ta in courses_controller.rb, which currently uses incorrect parameters.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;TA Utility:&amp;lt;/b&amp;gt; The TAUtils.ts manages TA addition in the frontend, but lacks error differentiation and does not limit TA suggestions to unassigned users only.&lt;br /&gt;
&lt;br /&gt;
==Issue with Current Implementation==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Interface Usability:&amp;lt;/b&amp;gt; The course management page lacks intuitive layout and functionality for managing TAs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Parameter Mismatch:&amp;lt;/b&amp;gt; Backend add_ta method incorrectly uses ta_id, causing issues with TA assignments.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Limited TA Assignment:&amp;lt;/b&amp;gt; The backend and frontend do not currently support assigning multiple TAs at once, and all users, regardless of current assignment, are displayed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Error Handling:&amp;lt;/b&amp;gt; No specific error messaging is provided for TA assignment failures.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page:&lt;br /&gt;
&lt;br /&gt;
1. Place the course name below the search box.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Replace the &amp;quot;Manage Users&amp;quot; icon for intuitive user association.&lt;br /&gt;
&lt;br /&gt;
3. Add hover tooltips on action buttons (Edit, Delete, Assign TA, Copy).&lt;br /&gt;
&lt;br /&gt;
4. Relocate the Delete button to the end for better UX flow.&lt;br /&gt;
&lt;br /&gt;
* Manage TAs Page:&lt;br /&gt;
&lt;br /&gt;
1. Display a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments.&lt;br /&gt;
&lt;br /&gt;
2. Update the button with an improved icon and tooltip.&lt;br /&gt;
&lt;br /&gt;
* Add TAs Page:&lt;br /&gt;
&lt;br /&gt;
1. Introduce a TA search by name functionality.&lt;br /&gt;
&lt;br /&gt;
2. Show an error popup with separated title and error details.&lt;br /&gt;
&lt;br /&gt;
3. Limit the dropdown/search suggestions to only unassigned TAs.&lt;br /&gt;
&lt;br /&gt;
4. Display the current TA list, if any; otherwise, show a &amp;quot;No TAs assigned&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
* Adding Multiple TAs:&lt;br /&gt;
&lt;br /&gt;
1. Implement checkboxes to select multiple users from the TA list.&lt;br /&gt;
&lt;br /&gt;
2. Batch add selected TAs upon submission.&lt;br /&gt;
&lt;br /&gt;
====Backend Enhancements====&lt;br /&gt;
&lt;br /&gt;
1. Controller Modification:&lt;br /&gt;
&lt;br /&gt;
o Update add_ta in courses_controller.rb to use params[:id] instead of params[:ta_id].&lt;br /&gt;
&lt;br /&gt;
o Implement validations to check if the user is already a TA.&lt;br /&gt;
&lt;br /&gt;
2. Course Model Update:&lt;br /&gt;
&lt;br /&gt;
o Refactor add_ta in course.rb to accept a list of TAs, validate each, and return an aggregated success or error response.&lt;br /&gt;
&lt;br /&gt;
o Update TaMapping model to link users and courses in bulk, and change user roles appropriately.&lt;br /&gt;
&lt;br /&gt;
==High-Level System Overview==&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates the high-level architecture of the system, showcasing the interaction flow between the frontend and backend components involved in adding TAs to a course.&lt;br /&gt;
&lt;br /&gt;
High-Level Request Flow:&lt;br /&gt;
&lt;br /&gt;
1. User Interaction: The instructor interacts with the frontend (via a web interface).&lt;br /&gt;
&lt;br /&gt;
2. Frontend Requests: The frontend sends an API request to the backend with the selected TA(s) and course details.&lt;br /&gt;
&lt;br /&gt;
3. Backend Processing: The backend validates the TA(s), assigns roles, and creates TA mappings between the user and the course.&lt;br /&gt;
&lt;br /&gt;
4. Response to Frontend: Success or error responses are sent back to the frontend, where they are displayed to the user.&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159122</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159122"/>
		<updated>2024-11-12T19:12:58Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2450. Refactor assignments_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2451. Reimplement feedback_response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb (Phase 2 - Design Document)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2457. GitHub metrics integration]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2458. User management and users table]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2472. Reimplement responses_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2474. Reimplement student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2476. Reimplement student_teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2479. Reimplement teams_users_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2484. Reimplement participants_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2485. Allow reviewers to bid on what to review]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2487. Reimplement authorization_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2492. UI for View submissions/assign grades (except heatgrid)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2493. UI for Assign Reviewers]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2491.UI for View assignments in Courses view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course]]&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2024&amp;diff=159121</id>
		<title>Talk:CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2024&amp;diff=159121"/>
		<updated>2024-11-12T19:12:30Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2024&amp;diff=159120</id>
		<title>Talk:CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2024&amp;diff=159120"/>
		<updated>2024-11-12T19:11:49Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: Created page with &amp;quot;CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157543</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157543"/>
		<updated>2024-10-29T19:15:56Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Code Improvements===&lt;br /&gt;
* &amp;lt;b&amp;gt;Using Scopes for Querying:&amp;lt;/b&amp;gt; Reimplemented code uses scopes (for_team, by_reviewer, for_assignment, with_responses, with_submitted_responses) for cleaner and more readable querying&lt;br /&gt;
* &amp;lt;b&amp;gt;Private Class Methods:&amp;lt;/b&amp;gt; Reimplemented code utilizes private class methods for better encapsulation and organization&lt;br /&gt;
* &amp;lt;b&amp;gt;Comprehensive Fetching Methods:&amp;lt;/b&amp;gt; newly implemented code has well-defined methods like fetch_latest_responses and fetch_submitted_responses, providing clarity on data retrieval while maintaining separation of concerns.&lt;br /&gt;
* &amp;lt;b&amp;gt;Delegation:&amp;lt;/b&amp;gt; uses delegation for retrieving fullname and name&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delegate :fullname, to: :reviewer, prefix: true, allow_nil: true&lt;br /&gt;
delegate :name, to: :assignment, prefix: true, allow_nil: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing=== &lt;br /&gt;
* &amp;lt;b&amp;gt;Unit Testing:&amp;lt;/b&amp;gt; Earlier Version: No unit tests were provided, leaving functionality unverified. Current Version: The use of RSpec framework provides a structured way to test the model's behavior. Each test is organized into meaningful groups (described using describe blocks).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Validation Testing: &amp;lt;/b&amp;gt;Tests for all validation rules to ensure that the model behaves correctly when provided with valid and invalid data. Specific tests check for presence, uniqueness, and the handling of invalid IDs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Scope Testing: &amp;lt;/b&amp;gt; Tests are provided for each scope method to ensure they return the expected results based on different conditions. Each scope is verified against the ResponseMap records, ensuring the correct filtering and retrieval of records.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Method Testing: &amp;lt;/b&amp;gt;Tests for custom class methods (.assessments_for, .latest_responses_for_team_by_reviewer, .responses_by_reviewer, .responses_for_assignment) to validate their functionality and expected outputs.Each method is checked against various scenarios, including edge cases where inputs might be nil.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Association Testing: &amp;lt;/b&amp;gt; Tests the behavior of instance methods like #response_assignment and #response_count, ensuring they return the expected values based on the state of the ResponseMap.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/MakarandPundlik/reimplementation-back-end GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157542</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157542"/>
		<updated>2024-10-29T19:15:27Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Code Improvements===&lt;br /&gt;
# &amp;lt;b&amp;gt;Using Scopes for Querying:&amp;lt;/b&amp;gt; Reimplemented code uses scopes (for_team, by_reviewer, for_assignment, with_responses, with_submitted_responses) for cleaner and more readable querying&lt;br /&gt;
# &amp;lt;b&amp;gt;Private Class Methods:&amp;lt;/b&amp;gt; Reimplemented code utilizes private class methods for better encapsulation and organization&lt;br /&gt;
# &amp;lt;b&amp;gt;Comprehensive Fetching Methods:&amp;lt;/b&amp;gt; newly implemented code has well-defined methods like fetch_latest_responses and fetch_submitted_responses, providing clarity on data retrieval while maintaining separation of concerns.&lt;br /&gt;
# &amp;lt;b&amp;gt;Delegation:&amp;lt;/b&amp;gt; uses delegation for retrieving fullname and name&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delegate :fullname, to: :reviewer, prefix: true, allow_nil: true&lt;br /&gt;
delegate :name, to: :assignment, prefix: true, allow_nil: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing=== &lt;br /&gt;
* &amp;lt;b&amp;gt;Unit Testing:&amp;lt;/b&amp;gt; Earlier Version: No unit tests were provided, leaving functionality unverified. Current Version: The use of RSpec framework provides a structured way to test the model's behavior. Each test is organized into meaningful groups (described using describe blocks).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Validation Testing: &amp;lt;/b&amp;gt;Tests for all validation rules to ensure that the model behaves correctly when provided with valid and invalid data. Specific tests check for presence, uniqueness, and the handling of invalid IDs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Scope Testing: &amp;lt;/b&amp;gt; Tests are provided for each scope method to ensure they return the expected results based on different conditions. Each scope is verified against the ResponseMap records, ensuring the correct filtering and retrieval of records.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Method Testing: &amp;lt;/b&amp;gt;Tests for custom class methods (.assessments_for, .latest_responses_for_team_by_reviewer, .responses_by_reviewer, .responses_for_assignment) to validate their functionality and expected outputs.Each method is checked against various scenarios, including edge cases where inputs might be nil.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Association Testing: &amp;lt;/b&amp;gt; Tests the behavior of instance methods like #response_assignment and #response_count, ensuring they return the expected values based on the state of the ResponseMap.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/MakarandPundlik/reimplementation-back-end GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157541</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157541"/>
		<updated>2024-10-29T19:14:56Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: /* Newly added methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Code Improvements===&lt;br /&gt;
# &amp;lt;b&amp;gt;Using Scopes for Querying:&amp;lt;/b&amp;gt; Reimplemented code uses scopes (for_team, by_reviewer, for_assignment, with_responses, with_submitted_responses) for cleaner and more readable querying&lt;br /&gt;
# &amp;lt;b&amp;gt;Private Class Methods:&amp;lt;/b&amp;gt; Reimplemented code utilizes private class methods for better encapsulation and organization&lt;br /&gt;
# &amp;lt;b&amp;gt;Comprehensive Fetching Methods:&amp;lt;/b&amp;gt; newly implemented code has well-defined methods like fetch_latest_responses and fetch_submitted_responses, providing clarity on data retrieval while maintaining separation of concerns.&lt;br /&gt;
# &amp;lt;b&amp;gt;Delegation:&amp;lt;/b&amp;gt; uses delegation for retrieving fullname and name&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delegate :fullname, to: :reviewer, prefix: true, allow_nil: true&lt;br /&gt;
delegate :name, to: :assignment, prefix: true, allow_nil: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing=== &lt;br /&gt;
* &amp;lt;b&amp;gt;Unit Testing:&amp;lt;/b&amp;gt; Earlier Version: No unit tests were provided, leaving functionality unverified. Current Version: The use of RSpec framework provides a structured way to test the model's behavior. Each test is organized into meaningful groups (described using describe blocks).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Validation Testing: &amp;lt;/b&amp;gt;Tests for all validation rules to ensure that the model behaves correctly when provided with valid and invalid data. Specific tests check for presence, uniqueness, and the handling of invalid IDs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Scope Testing: &amp;lt;/b&amp;gt; Tests are provided for each scope method to ensure they return the expected results based on different conditions. Each scope is verified against the ResponseMap records, ensuring the correct filtering and retrieval of records.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Method Testing: &amp;lt;/b&amp;gt;Tests for custom class methods (.assessments_for, .latest_responses_for_team_by_reviewer, .responses_by_reviewer, .responses_for_assignment) to validate their functionality and expected outputs.Each method is checked against various scenarios, including edge cases where inputs might be nil.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Association Testing: &amp;lt;/b&amp;gt; Tests the behavior of instance methods like #response_assignment and #response_count, ensuring they return the expected values based on the state of the ResponseMap.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/MakarandPundlik/reimplementation-back-end GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157539</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157539"/>
		<updated>2024-10-29T19:13:43Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: The document outlines the Expertiza project, an open-source Ruby on Rails application that facilitates assignment creation, peer reviews, and team collaborations among students. It highlights the **ResponseMap** class, which manages reviewer-reviewee relationships within the system, detailing its current implementation, drawbacks, and proposed enhancements for improved readability and maintainability. Key improvements include modularizing the `assessments_for` method, implementing validation for&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Code Improvements===&lt;br /&gt;
# &amp;lt;b&amp;gt;Using Scopes for Querying:&amp;lt;/b&amp;gt; Reimplemented code uses scopes (for_team, by_reviewer, for_assignment, with_responses, with_submitted_responses) for cleaner and more readable querying&lt;br /&gt;
# &amp;lt;b&amp;gt;Private Class Methods:&amp;lt;/b&amp;gt; Reimplemented code utilizes private class methods for better encapsulation and organization&lt;br /&gt;
# &amp;lt;b&amp;gt;Comprehensive Fetching Methods:&amp;lt;/b&amp;gt; newly implemented code has well-defined methods like fetch_latest_responses and fetch_submitted_responses, providing clarity on data retrieval while maintaining separation of concerns.&lt;br /&gt;
# &amp;lt;b&amp;gt;Delegation:&amp;lt;/b&amp;gt; uses delegation for retrieving fullname and name&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delegate :fullname, to: :reviewer, prefix: true, allow_nil: true&lt;br /&gt;
delegate :name, to: :assignment, prefix: true, allow_nil: true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing=== &lt;br /&gt;
* &amp;lt;b&amp;gt;Unit Testing:&amp;lt;/b&amp;gt; Earlier Version: No unit tests were provided, leaving functionality unverified. Current Version: The use of RSpec framework provides a structured way to test the model's behavior. Each test is organized into meaningful groups (described using describe blocks).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Validation Testing: &amp;lt;/b&amp;gt;Tests for all validation rules to ensure that the model behaves correctly when provided with valid and invalid data. Specific tests check for presence, uniqueness, and the handling of invalid IDs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Scope Testing: &amp;lt;/b&amp;gt; Tests are provided for each scope method to ensure they return the expected results based on different conditions. Each scope is verified against the ResponseMap records, ensuring the correct filtering and retrieval of records.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Method Testing: &amp;lt;/b&amp;gt;Tests for custom class methods (.assessments_for, .latest_responses_for_team_by_reviewer, .responses_by_reviewer, .responses_for_assignment) to validate their functionality and expected outputs.Each method is checked against various scenarios, including edge cases where inputs might be nil.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Association Testing: &amp;lt;/b&amp;gt; Tests the behavior of instance methods like #response_assignment and #response_count, ensuring they return the expected values based on the state of the ResponseMap.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/MakarandPundlik/reimplementation-back-end GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157534</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157534"/>
		<updated>2024-10-29T18:58:07Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/MakarandPundlik/reimplementation-back-end GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157533</id>
		<title>CSC/ECE 517 Fall 2024 - E2481 Reimplement response map.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2481_Reimplement_response_map.rb&amp;diff=157533"/>
		<updated>2024-10-29T18:55:53Z</updated>

		<summary type="html">&lt;p&gt;Mpundli: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&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. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor 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;
==Response map overview==&lt;br /&gt;
The response_map is a crucial component in the Expertiza system, it ensures the relationship between reviewers and reviewees in an assignment. In Expertiza, when a user submits a review, it creates an instance of the Response class. Each Response is associated with a specific ResponseMap that identifies the reviewer (reviewer_id), the person being reviewed (reviewee_id), the item under evaluation (reviewed_object_id), and the type of review, such as ReviewResponseMap, MetareviewResponseMap, FeedbackResponseMap, and TeammateReviewResponseMap, among others. &lt;br /&gt;
&lt;br /&gt;
===Attributes===&lt;br /&gt;
 1. reviewed_object_id: This integer field identifies the object (assignment, project, etc.) being reviewed. It serves as a foreign key to link to the specific item under review. &lt;br /&gt;
 2. reviewer_id: This integer field denotes the user who is acting as the reviewer. It connects to the users table, allowing the system to track who provided the feedback or evaluation. &lt;br /&gt;
 3. reviewee_id: This integer identifies the user or entity being reviewed, establishing a relationship with the person or group receiving the feedback. &lt;br /&gt;
 4. created_at &amp;amp; updated_at: These timestamp fields automatically track when the response map was created and last updated, ensuring that the system maintains accurate records of modifications.&lt;br /&gt;
&lt;br /&gt;
==Current implementation==&lt;br /&gt;
* ResponseMap class is responsible for managing the relationships between responses and the participants involved in the review process. It establishes association between multiple models such as Response, Pariticipant and Assignment.&lt;br /&gt;
* Currently, the &amp;quot;assessments_for&amp;quot; method in response_map.rb is being utilized in the response.rb file to retrieve the latest assessment responses associated with a specified team or reviewer. This method fetches all responses related to the given team, filters them based on submission status (specifically for ReviewResponseMap types), and sorts them to return the most recent assessments. Additionally, it sorts the final response list by the full name of the reviewer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.assessments_for(team)&lt;br /&gt;
    responses = []&lt;br /&gt;
    # stime = Time.now&lt;br /&gt;
    if team&lt;br /&gt;
      array_sort = []&lt;br /&gt;
      sort_to = []&lt;br /&gt;
      maps = where(reviewee_id: team.id)&lt;br /&gt;
      maps.each do |map|&lt;br /&gt;
        next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
        all_resp = Response.where(map_id: map.map_id).last&lt;br /&gt;
        if map.type.eql?('ReviewResponseMap')&lt;br /&gt;
          # If its ReviewResponseMap then only consider those response which are submitted.&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp if all_resp.is_submitted&lt;br /&gt;
        else&lt;br /&gt;
          array_sort &amp;lt;&amp;lt; all_resp&lt;br /&gt;
        end&lt;br /&gt;
        # sort all versions in descending order and get the latest one.&lt;br /&gt;
        sort_to = array_sort.sort # { |m1, m2| (m1.updated_at and m2.updated_at) ? m2.updated_at &amp;lt;=&amp;gt; m1.updated_at : (m1.version_num ? -1 : 1) }&lt;br /&gt;
        responses &amp;lt;&amp;lt; sort_to[0] unless sort_to[0].nil?&lt;br /&gt;
        array_sort.clear&lt;br /&gt;
        sort_to.clear&lt;br /&gt;
      end&lt;br /&gt;
      responses = responses.sort { |a, b| a.map.reviewer.fullname &amp;lt;=&amp;gt; b.map.reviewer.fullname }&lt;br /&gt;
    end&lt;br /&gt;
    responses&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawbacks==&lt;br /&gt;
* The implementation of &amp;quot;assessments_for&amp;quot; method violates the Single Responsibility Principle (SRP), as it handles multiple responsibilities, including fetching response maps, filtering responses, sorting them, and returning the final results. This leads to reduced readability and maintainability.&lt;br /&gt;
* The class lacks validations for its associations and attributes, which could lead to potential inconsistencies or errors in the data. Without proper validations, there's a risk of creating ResponseMap records that do not conform to the expected data integrity, such as having invalid or nonexistent reviewer, reviewee, or assignment associations.&lt;br /&gt;
&lt;br /&gt;
==Enhancements==&lt;br /&gt;
* To enhance clarity and adhere to the SRP, the assessments_for method could be split into several smaller methods. For example, one method could focus on retrieving response maps, another could filter responses based on submission status, and a third could handle sorting. This modular approach would improve the method's maintainability and make the codebase easier to understand and extend in the future.&lt;br /&gt;
* Implementing validations for associations and attributes would ensure data integrity and reduce the likelihood of runtime errors. Overall, while the ResponseMap class provides essential functionality within the response management system, its current structure could be optimized for better readability, maintainability, and reliability.&lt;br /&gt;
* In addition to this restructuring, implementing scopes and delegations would further enhance the class. Scopes could be introduced to encapsulate commonly used queries, such as retrieving all response maps for a specific reviewer or reviewee, making the code cleaner and more expressive. Delegation could be employed to simplify access to frequently used attributes or methods from associated models, reducing the need for repetitive code and enhancing readability.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* latest_responses_for_team_by_reviewer: A new method that retrieves the latest responses from a specific reviewer for a given team, allowing for targeted data access based on team and reviewer relationships.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def latest_responses_for_team_by_reviewer(team, reviewer)&lt;br /&gt;
   return [] if team.nil? || reviewer.nil?&lt;br /&gt;
   fetch_latest_responses(for_team(team.id).by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_by_reviewer: Added a method to fetch all responses submitted by a specific reviewer, enhancing the retrieval capabilities of the model.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_by_reviewer(reviewer)&lt;br /&gt;
   return [] if reviewer.nil?&lt;br /&gt;
   fetch_submitted_responses(by_reviewer(reviewer.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: Added a method that retrieves all submitted responses associated with the given maps by filtering only those marked as submitted&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
    maps.with_submitted_responses&lt;br /&gt;
          .includes(:response)&lt;br /&gt;
          .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* responses_for_assignment: method retrieves all submitted responses for a given assignment. It returns an empty array if the assignment is nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def responses_for_assignment(assignment)&lt;br /&gt;
   return [] if assignment.nil?&lt;br /&gt;
&lt;br /&gt;
   fetch_submitted_responses(for_assignment(assignment.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_and_sort_responses: A private method collects valid responses from the given maps and then sorts these responses by the reviewer's name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_and_sort_responses(maps)&lt;br /&gt;
    responses = collect_valid_responses(maps)&lt;br /&gt;
    sort_responses_by_reviewer_name(responses)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* collect_valid_responses: This method gathers all valid responses from the given maps. For each map, it includes the associated response and reviewer (with the user details). It skips any map that has no responses and processes each response based on its type, returning a compacted array of the results.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def collect_valid_responses(maps)&lt;br /&gt;
   maps.includes(:response, reviewer: :user).map do |map|&lt;br /&gt;
     next if map.response.empty?&lt;br /&gt;
&lt;br /&gt;
     process_response_by_type(map)&lt;br /&gt;
   end.compact&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* process_response_by_type: This method retrieves the latest response from `map.response`. If there is no response, it returns `nil`. For maps of type `ReviewResponseMap`, it returns the latest response only if it has been submitted (i.e., `is_submitted` is `true`). For other map types, it simply returns the latest response regardless of its submission status.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def process_response_by_type(map)&lt;br /&gt;
 latest_response = map.response.last&lt;br /&gt;
   return nil if latest_response.nil?&lt;br /&gt;
&lt;br /&gt;
   if map.type == 'ReviewResponseMap'&lt;br /&gt;
      latest_response if latest_response.is_submitted&lt;br /&gt;
   else&lt;br /&gt;
      latest_response&lt;br /&gt;
   end&lt;br /&gt;
end     &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* sort_responses_by_reviewer_name: The `sort_responses_by_reviewer_name` method sorts the given `responses` array in alphabetical order based on each response's reviewer's full name. It converts the name to a string to ensure compatibility during sorting.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 def sort_responses_by_reviewer_name(responses)&lt;br /&gt;
   responses.sort_by { |response| response.map.reviewer_fullname.to_s }&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fetch_latest_responses: The method retrieves the latest response for each map in `maps`, includes the associated `response` records to minimize database queries, and filters out any maps without a response. It then returns only the latest responses that have been submitted (i.e., where `is_submitted` is `true`).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_latest_responses(maps)&lt;br /&gt;
    maps.includes(:response)&lt;br /&gt;
     .map { |map| map.response.last }&lt;br /&gt;
     .compact&lt;br /&gt;
     .select(&amp;amp;:is_submitted)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* fetch_submitted_responses: The method retrieves all responses associated with the given `maps` that have been submitted. It does this by first narrowing `maps` down to those with submitted responses, then including the associated `response` records, and finally flattening and selecting only the submitted responses from each `map`.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def fetch_submitted_responses(maps)&lt;br /&gt;
   maps.with_submitted_responses&lt;br /&gt;
   .includes(:response)&lt;br /&gt;
   .flat_map { |map| map.response.select(&amp;amp;:is_submitted) }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* response_assignment and response_count: The `response_assignment ` method returns the assignment associated with the `reviewer` of the response map. The `response_count` method returns the total number of responses associated with the response map by counting the entries in the `response` collection.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def response_assignment&lt;br /&gt;
    reviewer.assignment&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def response_count&lt;br /&gt;
    response.count&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpundli</name></author>
	</entry>
</feed>