<?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=Ubukhar2</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=Ubukhar2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ubukhar2"/>
	<updated>2026-06-01T10:34:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=156916</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=156916"/>
		<updated>2024-04-25T01:32:27Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/46fb4a573b16f2aa89b9245a1c22bed9b1937e40 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/e0872f08e2ee77d714d957b946b57b7231d73ae2 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/1a335b0d8bd168ce8c59cbde465dc947d94583b0 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/commit/79c4a71a3a48a6fdc97072a7e93dabd14a297fca Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UI Changes ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
&lt;br /&gt;
'''Before changes:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
'''After changes:'''&lt;br /&gt;
&lt;br /&gt;
[[File:CSGR After.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
&lt;br /&gt;
'''Before changes:'''&lt;br /&gt;
&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
'''After changes:'''&lt;br /&gt;
&lt;br /&gt;
[[File:CSGS After.png |1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. After you login with the provided credentials, select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Open the '''all_students_all_reviews''' page by clicking on the icon next to the globe icon in another tab. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CSGR After.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Open the '''course_student_grade_summary''' page by clicking on the globe icon in new tab. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CSGS After.png |1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
5. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
6. Verify that average peer score column is visible and has correct values. &lt;br /&gt;
&lt;br /&gt;
7. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
8. Select/un-select check-boxes provided on the top of the page.&lt;br /&gt;
&lt;br /&gt;
9. Verify only those columns are visible that are checked. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' https://www.youtube.com/watch?v=VTvF1abk-n8&lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;br /&gt;
&lt;br /&gt;
'''4. Deployed application:''' http://152.7.178.104:8080/&lt;br /&gt;
&lt;br /&gt;
'''Credentials:''' Username: instructor6 ; Password: password&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155920</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155920"/>
		<updated>2024-04-23T03:11:05Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 3. Changes to app/views/assessment360/course_student_grade_summary.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155919</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155919"/>
		<updated>2024-04-23T03:10:38Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/views/assessment360/all_student_all_reviews.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155918</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155918"/>
		<updated>2024-04-23T03:10:04Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/views/assessment360/all_student_all_reviews.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (topics, peer grade and instructor grade) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155873</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155873"/>
		<updated>2024-04-22T23:03:43Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Checkboxes.png&amp;diff=155872</id>
		<title>File:Checkboxes.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Checkboxes.png&amp;diff=155872"/>
		<updated>2024-04-22T23:02:37Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155871</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155871"/>
		<updated>2024-04-22T23:02:22Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:checkboxes.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
In the &amp;lt;code&amp;gt;course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; file, we've introduced enhancements to the user interface to allow for a more dynamic display of the data table.&amp;lt;br&amp;gt; New checkbox elements have been added, each linked to a specific column in the data table.&amp;lt;br&amp;gt; These checkboxes give users the ability to show or hide the columns for topics, peer scores, meta reviews, the number of teammates, and instructor grades.&amp;lt;br&amp;gt; This feature was implemented to provide users with a more personalized and clutter-free interface, enabling them to focus on the data that is most relevant to their needs at any given time.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Codeforinstructor.png&amp;diff=155870</id>
		<title>File:Codeforinstructor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Codeforinstructor.png&amp;diff=155870"/>
		<updated>2024-04-22T22:54:50Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155869</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155869"/>
		<updated>2024-04-22T22:54:28Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155868</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155868"/>
		<updated>2024-04-22T22:54:00Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:codeforinstructor.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155867</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155867"/>
		<updated>2024-04-22T22:53:09Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:codeforinstructor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;peer_review_scores&amp;lt;/code&amp;gt; hash is now being correctly populated with the average peer review score, rounded to two decimal places. This change ensures the score is a concise, readable number.&amp;lt;br&amp;gt;&lt;br /&gt;
A counter number_of_peer_reviews has been introduced or updated for each course participant (cp.id). This is for tracking the count of peer reviews received.&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor-assigned grades are calculated taking into account any penalties. This calculation is stored in &amp;lt;code&amp;gt;assignment_grades[cp.id][assignment_id]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The code checks if an instructor grade exists. If so, flags &amp;lt;code&amp;gt;assignment_grades_present&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_category[&amp;quot;assignment_grade&amp;quot;]&amp;lt;/code&amp;gt; are set to true and 1 respectively, ensuring that the UI reflects the presence of these grades.&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot_2024-04-22_at_6.44.28_PM.png&amp;diff=155866</id>
		<title>File:Screenshot 2024-04-22 at 6.44.28 PM.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screenshot_2024-04-22_at_6.44.28_PM.png&amp;diff=155866"/>
		<updated>2024-04-22T22:50:31Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155865</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155865"/>
		<updated>2024-04-22T22:47:31Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155863</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155863"/>
		<updated>2024-04-22T22:40:19Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;:&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;course_student_grade_summary&amp;lt;/code&amp;gt; method within the &amp;lt;code&amp;gt;Assessment360Controller&amp;lt;/code&amp;gt; has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This likely enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155862</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155862"/>
		<updated>2024-04-22T22:39:28Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
The course_student_grade_summary method within the Assessment360Controller has been refactored to adhere to better design principles.&amp;lt;br&amp;gt;&lt;br /&gt;
Adding new data structures: New hash data structures such as &amp;lt;code&amp;gt;@number_of_peer_reviews&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@avg_peer_review_score&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@total_grade&amp;lt;/code&amp;gt; were introduced. This likely enhances the single responsibility principle, where each hash is now responsible for one piece of data related to student grades and reviews.&amp;lt;br&amp;gt;&lt;br /&gt;
Initializing data structures: Previously uninitialized hashes like &amp;lt;code&amp;gt;@assignment_grades_present&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@peer_review_scores_present&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;@assignment_category&amp;lt;/code&amp;gt; are now explicitly initialized to {}. This change improves code clarity, avoids null references, and ensures that the hashes are ready for use.&amp;lt;br&amp;gt;&lt;br /&gt;
Ensuring data structure consistency: By ensuring that each hash map is initialized even if no data is present (||= 0), the code now avoids potential nil errors and allows for safer iteration and access patterns.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactoring variable initialization: The refactored code uses the ||= operator to provide default values for the hashes if they haven't been initialized yet, improving the robustness and maintainability of the code.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Codeforavg.png&amp;diff=155861</id>
		<title>File:Codeforavg.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Codeforavg.png&amp;diff=155861"/>
		<updated>2024-04-22T22:31:16Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155860</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155860"/>
		<updated>2024-04-22T22:30:53Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Codeforavg.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155859</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155859"/>
		<updated>2024-04-22T22:30:04Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Codeforavg.jpg|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155858</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155858"/>
		<updated>2024-04-22T22:29:31Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Codesnippet.jpg|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155857</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155857"/>
		<updated>2024-04-22T22:29:04Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Code_1.jpg|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155856</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155856"/>
		<updated>2024-04-22T22:28:39Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* Code Snippets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Changes in &amp;lt;code&amp;gt;assessment360_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Code_1.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155853</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155853"/>
		<updated>2024-04-22T21:24:44Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/controller/assessment360_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/10039a7c2748f1dfef8191713efb3f1af50699c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155852</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155852"/>
		<updated>2024-04-22T21:23:50Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 3. Changes to app/views/assessment360/course_student_grade_summary.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155851</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155851"/>
		<updated>2024-04-22T21:22:59Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155850</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155850"/>
		<updated>2024-04-22T21:22:22Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/controller/assessment360_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/ThErOCk07/expertiza/commit/96f370c6957b156a25c3063314b6b4a66a7652c1]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155848</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155848"/>
		<updated>2024-04-22T21:20:08Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 3. Changes to app/views/assessment360/course_student_grade_summary.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Implemented dynamic column visibility in an HTML table using checkboxes. &lt;br /&gt;
|Each checkbox controls the display of specific table columns related to student assessments, such as Topics, Peer Scores, Meta Reviews, Number of Teammates, and Instructor Grades. &lt;br /&gt;
This functionality is achieved by toggling a CSS class that either hides or shows these elements, enhancing user interaction by allowing customizable views based on the checkbox selections.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155847</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155847"/>
		<updated>2024-04-22T21:17:18Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 2. Changes to Gemfile and config/environments/development.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155846</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155846"/>
		<updated>2024-04-22T21:16:59Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/controller/assessment360_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155845</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155845"/>
		<updated>2024-04-22T21:16:18Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/controller/assessment360_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. &lt;br /&gt;
|This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155844</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155844"/>
		<updated>2024-04-22T21:11:26Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: /* 1. Changes to app/views/assessment360/all_student_all_reviews.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|For each assignment of each participant, fetched and calculated the average peer review scores using the &amp;lt;code&amp;gt;find_peer_review_score&amp;lt;/code&amp;gt; method. &lt;br /&gt;
|Stored these scores and updated the running totals to calculate the average across the course.&lt;br /&gt;
|Tracked the presence of peer review data to manage the display of this data dynamically in the views.&lt;br /&gt;
|Calculated the instructor-assigned grades adjusted for any penalties using the assignment_grade_summary method. This involves fetching the team associated with each participant and adjusting the grades based on penalties, ensuring accurate grade calculation and storage.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155843</id>
		<title>CSC/ECE 517 Spring 2024 - E2438 Improve assessment360 controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2438_Improve_assessment360_controller&amp;diff=155843"/>
		<updated>2024-04-22T21:03:18Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The Ruby on Rails framework serves as the foundation for the open-source project [https://expertiza.ncsu.edu/ Expertiza]. Expertiza offers features that let instructors see a comprehensive, 360-degree overview of the course they teach, including all of the assignments, all of the students enrolled in the course, all of their individual assignment scores, averages, and final scores. The assessment360 controller facilitates this feature.&lt;br /&gt;
&lt;br /&gt;
Here is the class diagram of this controller - &lt;br /&gt;
[[File:Class2.png|700px|center|]]&lt;br /&gt;
&lt;br /&gt;
The following two views are mostly under the control of the assessment360 controller:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) all_students_all_reviews: This view shows all of the student teammate and meta reviews for every program they worked on that semester. It also offers a summary of these review scores collectively.&lt;br /&gt;
&lt;br /&gt;
2) course_student_grade_summary: This view shows the topic, instructor grade, peer score, and summary of each assignment that students have completed. This also applies to the sum and mean of these scores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The current implementation of the assessment360_controller.rb suffers from several issues such as repetitive elements, cryptic variable names, inaccurate grade calculations, and lack of flexibility in displaying different types of review scores. The objective of this project is to enhance the user interface and functionality of the assessment360_controller.rb in the application.&lt;br /&gt;
&lt;br /&gt;
Following are the issues to be addressed in this project:&lt;br /&gt;
&lt;br /&gt;
===Issues===&lt;br /&gt;
The main goals of this project are as follows:&lt;br /&gt;
* '''Issue #1:''' Refactor the all_students_all_reviews method to accept parameters specifying the type(s) of review scores to be displayed, and suppress columns for scores not selected.&lt;br /&gt;
* '''Issue #2:''' Rename the @teamed_count variable to a more descriptive name or remove it if not used.&lt;br /&gt;
* '''Issue #3:''' Ensure accuracy in grade calculations by including only the assignments that were attempted by the student in average grade calculation.&lt;br /&gt;
* '''Issue #4:''' Enhance the course_student_grade_summary method to include average peer-review scores and instructor-assigned scores. &lt;br /&gt;
* '''Issue #5:''' Columns for various types of review scores should be displayed based on user selection.&lt;br /&gt;
* '''Issue #6:''' Utilize the Bullet gem to minimize database accesses and optimize performance.&lt;br /&gt;
* '''Issue #7:''' Identify and address edge cases from the UI perspective to ensure consistent and clean behavior across different scenarios.&lt;br /&gt;
* '''Issue #8:''' Implement separate columns for student name and student ID to improve readability in the UI.&lt;br /&gt;
* '''Issue #9:''' Replace hyphen '-' with an en-dash '–'.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 4. Changes to &amp;lt;code&amp;gt;app/controllers/assessment360_controller.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Replaced hyphen '-' with an en-dash '–'&lt;br /&gt;
|Since hyphen was used to represent empty values, it was replaced with an en-dash for enhancing the UI.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Refactored &amp;lt;code&amp;gt;calc_overall_review_info()&amp;lt;/code&amp;gt;&lt;br /&gt;
|Ensured that if a student has not received a grade for an assignment that row is not considered for calculating the average.&lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/0846538180ac5139301aba824ab847b2ba9ba58a Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== UI Changes made ==&lt;br /&gt;
&lt;br /&gt;
The assessment360 controller is responsible for the following two views - &lt;br /&gt;
&lt;br /&gt;
'''1) all_students_all_reviews.html.erb''' - This view displays a table of students, their teammate count, and their performance on various assignments. For each assignment, it shows the metareview and teammate review scores. At the end of each row, it displays the aggregate score for metareviews and teammate reviews for each student. The last row of the table provides the class average for each assignment and the overall class average for metareviews and teammate reviews.&lt;br /&gt;
[[File:Review dm.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) The column is displayed even though all the rows are blank. &amp;lt;br&amp;gt;&lt;br /&gt;
2) The empty blanks can also lead to confusion and thus must be replaced. &amp;lt;br&amp;gt;&lt;br /&gt;
3) Allow user to choose the columns they wish to be displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
4) Separate columns for student name and student ID &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''2) course_student_grade_summary.html.erb''' - This view displays a sortable table of students, their assignments, and their grades. For each assignment, it shows the topic, the peer review score, and the instructor's grade. At the end of each row, it displays the total instructor grade for each student. The table can be sorted by student name or total instructor grade.&lt;br /&gt;
[[File:Grade summary.png|1000px|center|]]&lt;br /&gt;
'''Problems''' - &amp;lt;br&amp;gt;&lt;br /&gt;
1) A new column for average peer review score needs to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Allow user to choose the columns they wish to be displayed through checkboxes. &amp;lt;br&amp;gt;&lt;br /&gt;
2) Display Intructor Grade &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
The changes made to the assessment360_controller.rb and related files were necessary to improve the code's readability, maintainability, and adherence to best practices. Let's discuss each change and its significance:&lt;br /&gt;
&lt;br /&gt;
===Files modified===&lt;br /&gt;
&lt;br /&gt;
==== 1. Changes to &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Checked and renamed&amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; variable&lt;br /&gt;
|Checked the usage of variable through IDE whether the variable is used. The variable was used to display the total number of teams each student has collaborated with. Thus, it was renamed from &amp;lt;code&amp;gt;@teamed_count&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;@student_team_counts&amp;lt;/code&amp;gt; in both &amp;lt;code&amp;gt;app/controller/assessment360_controller.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;app/views/assessment360/all_student_all_reviews.html.erb&amp;lt;/code&amp;gt; files for better readability and understandability of the code.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Added check boxes to select columns to display &lt;br /&gt;
|Added 2 check boxes (meta reviews and teammate reviews) to select/deselect columns to be displayed. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/9190886b4e4825bdf426500de37e08614c48e19a Commit]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;| Hide empty columns &lt;br /&gt;
|Added checks to ensure column is displayed only when at least one of the rows has a corresponding value to that column in the database. &lt;br /&gt;
|[https://github.com/expertiza/expertiza/pull/2792/commits/8dc145ab7541f590ce811c66ce44455ad635769c Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== 2. Changes to &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;config/environments/development.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Added and initialized the bullet gem&lt;br /&gt;
|To identify and reduce unnecessary database queries, the bullet gem was added and activated to increase the performance of the application.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 3. Changes to &amp;lt;code&amp;gt;app/views/assessment360/course_student_grade_summary.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! Change !! Rationale !! Commit Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|style=&amp;quot;width: 30%&amp;quot;|Separated student name and student ID into different columns&lt;br /&gt;
|In order to achieve better understanding of the data being displayed, student name and student ID were separated into different columns.&lt;br /&gt;
|[https://github.com/kartikrawool/expertiza/commit/6403edc25cf0edde623da63f23d92a1a57d67375 Commit]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code Snippets ==&lt;br /&gt;
&lt;br /&gt;
[[File:Hashes.png|600px]] &amp;lt;br&amp;gt;&lt;br /&gt;
We created 2 hashes &amp;lt;code&amp;gt;meta_review_exists&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;teammate_review_exists&amp;lt;/code&amp;gt; which track if the respective values exist for each assignment. We use these hashes in our view to decide whether to display columns or not. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Boolean.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
Here we are assigning values to those hashes based on whether the review exists or not for that particular assignment. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Logic.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the new logic for calculating grade averages ensuring that only those grades are considered which have been reviewed for the average calculation so that the calculation is accurate. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Script.png|600px]]&amp;lt;br&amp;gt;&lt;br /&gt;
This is the JavaScript code we wrote to ensure that our view changes dynamically based on selection/deselection of the checkboxes. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Principles and Patterns ==&lt;br /&gt;
We have tried to apply the techniques we have learned in the class wherever it was possible. This included DRYing out the code and adding proper comments enhancing its readability and maintainability. &lt;br /&gt;
* We created a method called &amp;lt;code&amp;gt;handleCheckboxChange&amp;lt;/code&amp;gt; which was responsible for listening to various checkbox events, thus helping us to DRY out our code since we did not have to write the same code again for another checkbox. &amp;lt;br&amp;gt;&lt;br /&gt;
== Test Plan==&lt;br /&gt;
&lt;br /&gt;
The following test plan has been identified to ensure that the our changes don't break the existing system and the new code being introduced is thoroughly tested.&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
The following tests have been identified to ensure that the changes made work as anticipated:&lt;br /&gt;
&lt;br /&gt;
1. Select any course&lt;br /&gt;
[[File:Expertiza-3.png|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
2. Go to the all_students_all_reviews page by clicking on the icon next to the globe icon. &lt;br /&gt;
[[File:Expertiza-2.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
3. Verify that only those columns are visible with at least one data point. &lt;br /&gt;
&lt;br /&gt;
4. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
5. Go to course_student_grade_summary by clicking on the the globe icon.&lt;br /&gt;
[[File:Expertiza-1.PNG|1000px|center|]]&lt;br /&gt;
&lt;br /&gt;
6. Verify that empty data that is shown as '-' (a hyphen) is replaced by an '–' (en-dash).&lt;br /&gt;
&lt;br /&gt;
7. Verify that average peer score column is visible and has correct values.&lt;br /&gt;
&lt;br /&gt;
8. Verify that unattempted assignments or assignments that are not graded are assigned '0' value instead of leaving it blank.&lt;br /&gt;
&lt;br /&gt;
9. Verify that unattempted assignments or assignments that are not graded aren't counted towards the average score. &lt;br /&gt;
&lt;br /&gt;
10. Verify that student name and student ID are in different columns&lt;br /&gt;
&lt;br /&gt;
11. Add checkboxes at the top of the screen and ensure columns are hidden or visible based on the selected checkboxes&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
1) Daksh Mehta (unityID: dmehta4, GitHub: [https://github.com/ dakshmehta23])&amp;lt;br&amp;gt;&lt;br /&gt;
2) Soham Patil (unityID: sspatil6, GitHub: [https://github.com/ ThErOCk07])&amp;lt;br&amp;gt;&lt;br /&gt;
3) Unnati Bukhariya (unityID: ubukhar2, GitHub: [https://github.com/ unnzzz])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links==&lt;br /&gt;
&lt;br /&gt;
'''1. Youtube Video:''' &lt;br /&gt;
&lt;br /&gt;
'''2. Github forked repository:''' https://github.com/ThErOCk07/expertiza&lt;br /&gt;
&lt;br /&gt;
'''3. Github Pull request:''' https://github.com/expertiza/expertiza/pull/2792&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2408._Refactor_course.rb_and_course_team.rb_models&amp;diff=153906</id>
		<title>CSC/ECE 517 Spring 2024 - E2408. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2408._Refactor_course.rb_and_course_team.rb_models&amp;diff=153906"/>
		<updated>2024-03-24T22:54:29Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E2408. Refactor course.rb and course_team.rb models==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Members ===&lt;br /&gt;
&lt;br /&gt;
* Daksh Mehta, (unityID:dmehta4, GitHub:dakshmehta23)&lt;br /&gt;
* Soham Patil, (unityID:sspatil6@ncsu.edu, GitHub:ThErOCk07)&lt;br /&gt;
* Unnati Bukhariya, (unityID:ubukhar2@ncsu.edu, GitHub:unnzzz)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
== Expertiza Overview ==&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
course.rb and course_team.rb models are objects containing information about the course and their associated teams respectively. CourseTeams are used when an instructor wants to use the same teams for the entire semester. CourseTeam  is one subclass of Team ; AssignmentTeam is the other.  An AssignmentTeam is a team that is created for students to do a single assignment.  It is possible to copy CourseTeams to an assignment, where they become AssignmentTeams, or vice versa.&lt;br /&gt;
&lt;br /&gt;
The Course and CourseTeam models had some code smells/issues that were fixed. There were a few methods in these models that shouldn’t be in those models, and a few methods that are no longer used. Certain method names were refactored in order to better understand their functionality.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The following changes were made to the models course.rb and course_team.rb&lt;br /&gt;
=== Changes in course.rb ===&lt;br /&gt;
* '''Removal of get_participant Method'''&lt;br /&gt;
        The method get_participant was removed.&lt;br /&gt;
        A global search revealed it was unused throughout the app.&lt;br /&gt;
        Consequently, the method and its respective RSpec test were removed.&lt;br /&gt;
&lt;br /&gt;
* '''Rename copy_participants Method'''&lt;br /&gt;
        Renamed the method to copy_assignment_participants.&lt;br /&gt;
        This new name accurately reflects the method's purpose, which is specific to assignments, enhancing clarity and understanding.&lt;br /&gt;
&lt;br /&gt;
* '''Error Handling Enhancement'''&lt;br /&gt;
        Refactored add_participant and copy_assignment_participants methods for improved error handling and readability.&lt;br /&gt;
        Introduced a new method, handle_errors, to centralize error handling and separate it from main function logic.&lt;br /&gt;
&lt;br /&gt;
* '''Other Changes'''&lt;br /&gt;
        Utilized find_by instead of where.first for SQL queries to the model.&lt;br /&gt;
        Employed errors.any? instead of unless errors.empty? for better readability.&lt;br /&gt;
        Added comments throughout the code for improved documentation and understanding.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes in course_team.rb  ===&lt;br /&gt;
&lt;br /&gt;
* '''Removal of add_member method'''&lt;br /&gt;
        The method add_member was removed.&lt;br /&gt;
        As Course_team is a subclass of Team, it inherited the add_member functionality from the superclass. Hence, it was removed for better coherence and modularity.&lt;br /&gt;
&lt;br /&gt;
* '''Removal of assignment_id method'''&lt;br /&gt;
        The method assignment_id was removed.&lt;br /&gt;
        The assignment_id method wasn't utilized anywhere in the code and therefore had to be removed to reduce redundancy.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring Course.find(id) to Course.find(course_id)'''&lt;br /&gt;
        Any instances of Course.find(course_id) were replaced with Course.find(course_id) for better understandability of the code.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring copy method to copy_to_assignment_team'''&lt;br /&gt;
        The copy method copied a Course team to an assignment team and thus refactored to copy_to_assigment_team making the code easy to understand.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring the course_team.rb for importing and exporting csv files'''&lt;br /&gt;
        Refactored the course_team.rb file to adhere more closely to the Single Responsibility Principle (SRP). &lt;br /&gt;
        Removed the export and import methods from the model to create a more structured and uniform class.&lt;br /&gt;
&lt;br /&gt;
* '''Creating &amp;quot;team_csv_handler&amp;quot; as a common mechanism for handling csv files'''&lt;br /&gt;
        We extracted the import and export functions into a new class named TeamCsvHandler.&lt;br /&gt;
        This new class is responsible solely for handling CSV operations related to teams, so that each class has a distinct reponsibility.&lt;br /&gt;
        Eliminated the need to duplicate code for exporting , importing and displaying the csv files in the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Other Changes ===&lt;br /&gt;
&lt;br /&gt;
* The test corresponding to get_participant Method was removed from course_spec.rb&lt;br /&gt;
* The test corresponding to copy_participants Method was renamed to copy_assignment_participants.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To validate the refactored models, we conducted UI testing. We mapped UI buttons and functionalities to their corresponding models and executed relevant tasks to verify the expected outcomes.&lt;br /&gt;
*Adding team members to a team&lt;br /&gt;
[[File:E2408 1.png|1000px|left|]]&lt;br /&gt;
[[File:E2408 2.png|1000px|left|]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* '''GitHub Repo:''' https://github.com/dakshmehta23/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2752&lt;br /&gt;
* '''VCL URL:'''&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2408._Refactor_course.rb_and_course_team.rb_models&amp;diff=153904</id>
		<title>CSC/ECE 517 Spring 2024 - E2408. Refactor course.rb and course team.rb models</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2408._Refactor_course.rb_and_course_team.rb_models&amp;diff=153904"/>
		<updated>2024-03-24T22:53:41Z</updated>

		<summary type="html">&lt;p&gt;Ubukhar2: Added changes to course_team.rb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E2408. Refactor course.rb and course_team.rb models==&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
== Team ==&lt;br /&gt;
=== Members ===&lt;br /&gt;
&lt;br /&gt;
* Daksh Mehta, (unityID:dmehta4, GitHub:dakshmehta23)&lt;br /&gt;
* Soham Patil, (unityID:sspatil6@ncsu.edu, GitHub:ThErOCk07)&lt;br /&gt;
* Unnati Bukhariya, (unityID:ubukhar2@ncsu.edu, GitHub:unnzzz)&lt;br /&gt;
&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ameya Vaichalkar, (unityID:agvaicha, GitHub:ameyagv)&lt;br /&gt;
== Expertiza Overview ==&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source software written using Ruby on Rails which functions as a learning management software system. It has many different functions and abilities including the ability to create assignments, quizzes, assignment groups, and topics, and also a complete mechanism for providing peer reviews and feedback for other groups and other teammates. It is used in select courses at NC State and by professors at several other colleges and universities.&lt;br /&gt;
&lt;br /&gt;
course.rb and course_team.rb models are objects containing information about the course and their associated teams respectively. CourseTeams are used when an instructor wants to use the same teams for the entire semester. CourseTeam  is one subclass of Team ; AssignmentTeam is the other.  An AssignmentTeam is a team that is created for students to do a single assignment.  It is possible to copy CourseTeams to an assignment, where they become AssignmentTeams, or vice versa.&lt;br /&gt;
&lt;br /&gt;
The Course and CourseTeam models had some code smells/issues that were fixed. There were a few methods in these models that shouldn’t be in those models, and a few methods that are no longer used. Certain method names were refactored in order to better understand their functionality.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
The following changes were made to the models course.rb and course_team.rb&lt;br /&gt;
=== Changes in course.rb ===&lt;br /&gt;
* '''Removal of get_participant Method'''&lt;br /&gt;
        The method get_participant was removed.&lt;br /&gt;
        A global search revealed it was unused throughout the app.&lt;br /&gt;
        Consequently, the method and its respective RSpec test were removed.&lt;br /&gt;
&lt;br /&gt;
* '''Rename copy_participants Method'''&lt;br /&gt;
        Renamed the method to copy_assignment_participants.&lt;br /&gt;
        This new name accurately reflects the method's purpose, which is specific to assignments, enhancing clarity and understanding.&lt;br /&gt;
&lt;br /&gt;
* '''Error Handling Enhancement'''&lt;br /&gt;
        Refactored add_participant and copy_assignment_participants methods for improved error handling and readability.&lt;br /&gt;
        Introduced a new method, handle_errors, to centralize error handling and separate it from main function logic.&lt;br /&gt;
&lt;br /&gt;
* '''Other Changes'''&lt;br /&gt;
        Utilized find_by instead of where.first for SQL queries to the model.&lt;br /&gt;
        Employed errors.any? instead of unless errors.empty? for better readability.&lt;br /&gt;
        Added comments throughout the code for improved documentation and understanding.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Changes in course_team.rb  ===&lt;br /&gt;
&lt;br /&gt;
* '''Removal of add_member method'''&lt;br /&gt;
        The method add_member was removed.&lt;br /&gt;
        As Course_team is a subclass of Team, it inherited the add_member functionality from the superclass. Hence, it was removed for better coherence and modularity.&lt;br /&gt;
&lt;br /&gt;
* '''Removal of assignment_id method'''&lt;br /&gt;
        The method assignment_id was removed.&lt;br /&gt;
        The assignment_id method wasn't utilized anywhere in the code and therefore had to be removed to reduce redundancy.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring Course.find(id) to Course.find(course_id)'''&lt;br /&gt;
        Any instances of Course.find(course_id) were replaced with Course.find(course_id) for better understandability of the code.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring copy method to copy_to_assignment_team'''&lt;br /&gt;
        The copy method copied a Course team to an assignment team and thus refactored to copy_to_assigment_team making the code easy to understand.&lt;br /&gt;
&lt;br /&gt;
* '''Refactoring the course_team.rb for importing and exporting csv files'''&lt;br /&gt;
        Refactored the course_team.rb file to adhere more closely to the Single Responsibility Principle (SRP). &lt;br /&gt;
        Removed the export and import methods from the model to create a more structured and uniform class.&lt;br /&gt;
&lt;br /&gt;
* '''Creating &amp;quot;team_csv_handler&amp;quot; as a common mechanism for handling csv files'''&lt;br /&gt;
        We extracted the import and export functions into a new class named TeamCsvHandler.&lt;br /&gt;
        This new class is responsible solely for handling CSV operations related to teams, ensuring that each class has a distinct reponsibility.&lt;br /&gt;
        Eliminated the need to duplicate code for exporting , importing and displaying the csv files in the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Other Changes ===&lt;br /&gt;
&lt;br /&gt;
* The test corresponding to get_participant Method was removed from course_spec.rb&lt;br /&gt;
* The test corresponding to copy_participants Method was renamed to copy_assignment_participants.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
To validate the refactored models, we conducted UI testing. We mapped UI buttons and functionalities to their corresponding models and executed relevant tasks to verify the expected outcomes.&lt;br /&gt;
*Adding team members to a team&lt;br /&gt;
[[File:E2408 1.png|1000px|left|]]&lt;br /&gt;
[[File:E2408 2.png|1000px|left|]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* '''GitHub Repo:''' https://github.com/dakshmehta23/expertiza&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/expertiza/pull/2752&lt;br /&gt;
* '''VCL URL:'''&lt;/div&gt;</summary>
		<author><name>Ubukhar2</name></author>
	</entry>
</feed>