<?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=Rvkulkar</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=Rvkulkar"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rvkulkar"/>
	<updated>2026-06-29T02:33:09Z</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=160375</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=160375"/>
		<updated>2024-12-04T00:43:38Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* 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 assigning users as a TA for a course.&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details.&lt;br /&gt;
**Confirmation if a student is selected to be added as a TA to convert the users role to TA.  &lt;br /&gt;
[[File:UI-7.jpeg]] &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;
**Updated 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 and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA or User, 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-3.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 a TA or students and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A GET request is sent to the backend API at /courses/:id/add_tas, including the user_id (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>Rvkulkar</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=160371</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=160371"/>
		<updated>2024-12-04T00:41:26Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* Problem Statement */&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 assigning users as a TA for a course.&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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;
**Updated 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 and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA or User, 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-3.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 a TA or students and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A GET request is sent to the backend API at /courses/:id/add_tas, including the user_id (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>Rvkulkar</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=160370</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=160370"/>
		<updated>2024-12-04T00:40:09Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* High-Level Request Flow: */&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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;
**Updated 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 and course details.&lt;br /&gt;
*Backend Processing: The backend validates the TA or User, 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-3.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 a TA or students and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A GET request is sent to the backend API at /courses/:id/add_tas, including the user_id (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>Rvkulkar</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=160369</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=160369"/>
		<updated>2024-12-04T00:39:42Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* High-Level Request Flow: */&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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;
**Updated 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-3.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 a TA or students and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A GET request is sent to the backend API at /courses/:id/add_tas, including the user_id (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>Rvkulkar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML-3.png&amp;diff=160368</id>
		<title>File:UML-3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML-3.png&amp;diff=160368"/>
		<updated>2024-12-04T00:39:21Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rvkulkar</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=160350</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=160350"/>
		<updated>2024-12-04T00:19:10Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* Detailed Flow Description: */&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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;
**Updated 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 a TA or students and submits the form to add them to a specific course. &lt;br /&gt;
&lt;br /&gt;
* Frontend API Call: &lt;br /&gt;
**A GET request is sent to the backend API at /courses/:id/add_tas, including the user_id (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>Rvkulkar</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=160348</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=160348"/>
		<updated>2024-12-04T00:17:56Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* 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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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;
**Updated 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>Rvkulkar</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=160347</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=160347"/>
		<updated>2024-12-04T00:17:23Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* Proposed Solution */&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;
==Overview of Updates==&lt;br /&gt;
====Front-End Enhancements====&lt;br /&gt;
* Manage Courses Page: &lt;br /&gt;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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>Rvkulkar</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=160345</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=160345"/>
		<updated>2024-12-04T00:16:29Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: /* 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;
**Replaced the &amp;quot;Manage Users&amp;quot; icon for intuitive user association. &lt;br /&gt;
**Added 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;
**Relocated 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;
**Displayed a message, &amp;quot;No TAs assigned currently,&amp;quot; in the absence of TA assignments. &lt;br /&gt;
**Updated 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;
**Introduced a TA search by name functionality. &lt;br /&gt;
**Shows an error popup with separated title and error details. &lt;br /&gt;
[[File:UI-7.jpeg]]&lt;br /&gt;
**Displayed 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>Rvkulkar</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=159130</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=159130"/>
		<updated>2024-11-12T19:59:21Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;
* Adding Multiple TAs: &lt;br /&gt;
**Implement checkboxes to select multiple users from the TA list. &lt;br /&gt;
**Batch add selected TAs upon submission. &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>Rvkulkar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_2.png&amp;diff=159127</id>
		<title>File:UML 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_2.png&amp;diff=159127"/>
		<updated>2024-11-12T19:39:17Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rvkulkar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_1.png&amp;diff=159126</id>
		<title>File:UML 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_1.png&amp;diff=159126"/>
		<updated>2024-11-12T19:39:03Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rvkulkar</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=158433</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=158433"/>
		<updated>2024-10-30T03:18:04Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;
* Accessor methods were added to the ResponseMap model to provide easy access to the reviewer, reviewee, and assignment associated with each response map. This enhancement allows for straightforward retrieval of related entities, improving the clarity and accessibility of relationship data and simplifying interactions with response map associations across the system. Additionally, methods were implemented to facilitate seamless access to the corresponding details of each response, further enhancing the model’s usability and integration within the broader system.&lt;br /&gt;
* Furthermore, a safe_delete method checks for any associated responses before allowing deletion of the response map. If responses exist, it returns a special code :cannot_delete; otherwise, it safely deletes the response map and returns :deleted. The survey? method is also included, which simply returns false, indicating that this response map does not pertain to a survey context.&lt;br /&gt;
&lt;br /&gt;
===Newly added methods===&lt;br /&gt;
* Accessor methods: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def get_reviewer&lt;br /&gt;
   reviewer || raise(ActiveRecord::RecordNotFound, 'Reviewer not found')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def get_reviewee&lt;br /&gt;
   reviewee || raise(ActiveRecord::RecordNotFound, 'Reviewee not found')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def get_assignment&lt;br /&gt;
  assignment || raise(ActiveRecord::RecordNotFound, 'Assignment not found')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Safe delete method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def safe_delete&lt;br /&gt;
   if response.exists?&lt;br /&gt;
     # Return special code if responses are associated&lt;br /&gt;
     :cannot_delete&lt;br /&gt;
   else&lt;br /&gt;
     # Delete the response map if no responses are associated&lt;br /&gt;
     destroy&lt;br /&gt;
     :deleted&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&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;b&amp;gt;Accessor Methods:&amp;lt;/b&amp;gt; Added accessor methods for straightforward access to reviewer, reviewee, and assignment, improving clarity and usability of relationship data.&lt;br /&gt;
* &amp;lt;b&amp;gt;Safe Delete Method:&amp;lt;/b&amp;gt; Introduced a safe_delete method that checks for associated responses before deletion, ensuring safer data management and clearer intent in operations.&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>Rvkulkar</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=157485</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=157485"/>
		<updated>2024-10-29T17:46:21Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157481</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=157481"/>
		<updated>2024-10-29T17:42:36Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;
&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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157477</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=157477"/>
		<updated>2024-10-29T17:38:49Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157474</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=157474"/>
		<updated>2024-10-29T17:35:37Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157468</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=157468"/>
		<updated>2024-10-29T17:07:16Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;
* However, the implementation of this 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;
* 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;
&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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157463</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=157463"/>
		<updated>2024-10-29T16:34:06Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157458</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=157458"/>
		<updated>2024-10-29T15:59:10Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157456</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=157456"/>
		<updated>2024-10-29T15:57:16Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;/div&gt;</summary>
		<author><name>Rvkulkar</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=157454</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=157454"/>
		<updated>2024-10-29T15:53:49Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: Created page with &amp;quot;Reimplement response_map.rb&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Reimplement response_map.rb&lt;/div&gt;</summary>
		<author><name>Rvkulkar</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157453</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=157453"/>
		<updated>2024-10-29T15:53:19Z</updated>

		<summary type="html">&lt;p&gt;Rvkulkar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&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;
* [[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 - 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 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;/div&gt;</summary>
		<author><name>Rvkulkar</name></author>
	</entry>
</feed>