<?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=Jmaduru</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=Jmaduru"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jmaduru"/>
	<updated>2026-06-08T08:11:39Z</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_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145365</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145365"/>
		<updated>2022-04-26T01:55:37Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. Instead of explicitly calling metrics by name in the view file, this hashmap is used to iterate over the metrics and displayed&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toggle feature is implemented in &amp;quot;view_team_in_grades.js&amp;quot; file. When the checkbox is clicked, function in javascript file is called and appropriate elements are hidden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-23.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; To introduce new metric, a new method should be added in &amp;quot;vm_question_response.rb&amp;quot; file. This newly added method should be called from &amp;quot;calculate_metrics&amp;quot; method &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-30.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-31.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Changes reflected in the UI&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-40.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-41.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-43.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145364</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145364"/>
		<updated>2022-04-26T01:52:24Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. Instead of explicitly calling metrics by name in the view file, this hashmap is used to iterate over the metrics and displayed&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toggle feature is implemented in &amp;quot;view_team_in_grades.js&amp;quot; file. When the checkbox is clicked, function in javascript file is called and appropriate elements are hidden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-23.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; To introduce new metric, a new method should be added in &amp;quot;vm_question_response.rb&amp;quot; file. This newly added method should be called from &amp;quot;calculate_metrics&amp;quot; method &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-30.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-31.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is how the view looks like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-40.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-41.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-43.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145363</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145363"/>
		<updated>2022-04-26T01:51:46Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. Instead of explicitly calling metrics by name in the view file, this hashmap is used to iterate over the metrics and displayed&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toggle feature is implemented in &amp;quot;view_team_in_grades.js&amp;quot; file. When the checkbox is clicked, function in javascript file is called and appropriate elements are hidden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-23.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; To introduce new metric, a new method should be added in &amp;quot;vm_question_response.rb&amp;quot; file. This newly added method should be called from &amp;quot;calculate_metrics&amp;quot; method &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-30.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-31.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is how the view looks like &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-40.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-41.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-42.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-43.png&amp;diff=145362</id>
		<title>File:Heatgrid-2022-43.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-43.png&amp;diff=145362"/>
		<updated>2022-04-26T01:47:37Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-41.png&amp;diff=145361</id>
		<title>File:Heatgrid-2022-41.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-41.png&amp;diff=145361"/>
		<updated>2022-04-26T01:47:15Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-40.png&amp;diff=145359</id>
		<title>File:Heatgrid-2022-40.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-40.png&amp;diff=145359"/>
		<updated>2022-04-26T01:46:24Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145358</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145358"/>
		<updated>2022-04-26T01:40:57Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. Instead of explicitly calling metrics by name in the view file, this hashmap is used to iterate over the metrics and displayed&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toggle feature is implemented in &amp;quot;view_team_in_grades.js&amp;quot; file. When the checkbox is clicked, function in javascript file is called and appropriate elements are hidden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-23.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; To introduce new metric, a new method should be added in &amp;quot;vm_question_response.rb&amp;quot; file. This newly added method should be called from &amp;quot;calculate_metrics&amp;quot; method &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-30.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-31.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-31.png&amp;diff=145357</id>
		<title>File:Heatgrid-2022-31.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-31.png&amp;diff=145357"/>
		<updated>2022-04-26T01:38:48Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-30.png&amp;diff=145356</id>
		<title>File:Heatgrid-2022-30.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-30.png&amp;diff=145356"/>
		<updated>2022-04-26T01:38:29Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145355</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145355"/>
		<updated>2022-04-26T01:30:43Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. Instead of explicitly calling metrics by name in the view file, this hashmap is used to iterate over the metrics and displayed&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Toggle feature is implemented in &amp;quot;view_team_in_grades.js&amp;quot; file. When the checkbox is clicked, function in javascript file is called and appropriate elements are hidden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-23.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-23.png&amp;diff=145354</id>
		<title>File:Heatgrid-2022-23.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-23.png&amp;diff=145354"/>
		<updated>2022-04-26T01:20:25Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145346</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145346"/>
		<updated>2022-04-26T01:06:51Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A new hashmap is introduced to store the values of the metrics in the form of key value pairs. This has map is used to iterate over the metrics and display in the html page&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-20.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-21.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-22.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-22.png&amp;diff=145345</id>
		<title>File:Heatgrid-2022-22.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-22.png&amp;diff=145345"/>
		<updated>2022-04-26T01:04:35Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-21.png&amp;diff=145344</id>
		<title>File:Heatgrid-2022-21.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-21.png&amp;diff=145344"/>
		<updated>2022-04-26T01:04:15Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-20.png&amp;diff=145343</id>
		<title>File:Heatgrid-2022-20.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-20.png&amp;diff=145343"/>
		<updated>2022-04-26T01:03:58Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145340</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145340"/>
		<updated>2022-04-26T00:55:38Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]] &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145339</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145339"/>
		<updated>2022-04-26T00:54:49Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Heatgrid-2022-10.png|600px]]&lt;br /&gt;
[[File:Heatgrid-2022-11.png|600px]]&lt;br /&gt;
[[File:Heatgrid-2022-13.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-13.png&amp;diff=145338</id>
		<title>File:Heatgrid-2022-13.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-13.png&amp;diff=145338"/>
		<updated>2022-04-26T00:52:50Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-11.png&amp;diff=145337</id>
		<title>File:Heatgrid-2022-11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-11.png&amp;diff=145337"/>
		<updated>2022-04-26T00:52:33Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-10.png&amp;diff=145336</id>
		<title>File:Heatgrid-2022-10.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Heatgrid-2022-10.png&amp;diff=145336"/>
		<updated>2022-04-26T00:51:49Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145327</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145327"/>
		<updated>2022-04-26T00:29:53Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue with previous team's implementation &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Current implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Goal &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Our mentor has required us to display metrics in the heat grid with a toggle option for the user to select only the required metrics according to their preferences. This should be done keeping in mind low coupling as the primary design goal. These changes should be accompanied by minor changes such as adding comments and changing the name of “metric-1” to a self-indicative name. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Implementation details &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
  In the original beta implementation, whenever the relevant view file is loaded, it is calling the method &amp;quot;populate_view_model&amp;quot; present in the &amp;quot;grades_controller.rb&amp;quot; file. This method, is explicitly calling another model method to calculate metric. Whenever a new metric is added, we will have to make a call to that metric in the populate view model. This is not ideal as each new metric added is introducing a new line of code in the controller body. It is also not possible to determine the metrics present dynamically. To deal with this problem, we introduced a new parent method &amp;quot;calculate_metrics&amp;quot; in model file &amp;quot;vm_question_response.rb&amp;quot;. This method is responsible for calling other individual methods that calculate metrics. The call to this method is replacing the explicit calls to metric calculation in the controller. This essentially is breaking the dependency between new metric introduction and the controller. Now, whenever a new metric is added, there is no need to introduce any code changes in the controller, instead we just have to change the code in relevant model file.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Adding a new metric in future &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test plan &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145307</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145307"/>
		<updated>2022-04-26T00:02:55Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric. However, the critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Heatgrid-metric.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145304</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145304"/>
		<updated>2022-04-26T00:01:44Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric. However, the critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Summary Report.png|600px]]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;li&amp;gt; Metric dropdown provided while creating an assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
  [[File:Assignment General page.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145301</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145301"/>
		<updated>2022-04-25T23:50:39Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;UML Diagram &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Principle &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Factory Design Pattern since we are dealing with the creation of multiple kinds of metrics. As part of our implementation, we plan on using a metric interface, which can be implemented by different concrete metric classes. A factory class acts as a middleman between the implementations and the main class that instantiates the objects. Based on the instructor's selection, the main class requests the metric object from the factory class, rather than dealing with the creation logic on its own. This pattern, therefore, enforces encapsulation and results in the low coupling, the principle which is our primary target for this project scope.  &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The previous implementation has dealt with issue #1869. But the drawback with the implementation is that it renders a code that is highly coupled. Whenever a new metric is added two files (assignments/edit/_general.html.erb and grades/view_team.html.erb) are to be changed, resulting in high coupling. As a consequence, tests pertaining to the highly coupled codes require new tests as a new metric is added. This is undesirable. So, the principle of low coupling is the main focus of our implementation. This principle will enable a common set of tests that would be valid for any number of metrics that will potentially be added in the future.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Implementation of Issue 1869&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Previous team’s implementation &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The previous team has dealt with the issue by changing “metric-1” to “verbose comment count”, which is relevant to what metric-1 refers to. For the latter half of the issue, they have provided a metric dropdown for the instructor to select while creating the assignment. This consequently requires only one metric to be displayed on the heat grid for which they’ve given a toggle option to show and hide the metric. However, the critical problem with their changes was, when in future a new metric is added, it forces a change in two view files: one time in assignments/edit/_general.html.erb and  two times  in grades/view_team.html.erb. Requiring these changes in view files that have little relevance to the heat grid is essentially causing high coupling.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Changes reflected in the UI &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt; &lt;br /&gt;
  &amp;lt;li&amp;gt; &amp;lt;b&amp;gt; metric-1 &amp;lt;/b&amp;gt; changed to verbose comment count &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Video Demo&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The video link will be provided after the final submission.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Primary Goal of Testing&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;RSpec Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Functional Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits New Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits Edit Assignment page&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor visits on Assign Grade page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student visits View Scores page&lt;br /&gt;
Then Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Unit Tests&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 15 for the comment “The team has documented everything on the wiki page very properly following all the guidelines”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: The output for the metric “Comment Count”&lt;br /&gt;
Given: Instructor is logged in&lt;br /&gt;
When: Instructor selects metric as “Comment Count” for an assignment&lt;br /&gt;
Then: outputs 0 for the comment “”&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Regression Tests&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the new functionalities are implemented and added, make sure the existing functionalities and test cases still pass. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=144759</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=144759"/>
		<updated>2022-04-12T00:25:07Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the &amp;quot;Allow Self Review&amp;quot; checkbox was not checked by the instructor. This situation should not arise for practical purposes. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;UML Diagram &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:UML diagram E2241.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Pattern &amp;lt;/h2&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Abstract Factory Pattern since we will be dealing with different families of metrics for grading purposes. It is preferable to reveal only the interfaces of metrics but conceal their implementations to avoid high coupling between classes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #2019&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Test file for adding test cases to implement self-reviews checks &amp;lt;/p&amp;gt;&lt;br /&gt;
* spec/controllers/grades_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in New Assignment&lt;br /&gt;
Given: Instructor has logged in&lt;br /&gt;
When: Instructor clicks on New Assignment button&lt;br /&gt;
Then: Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of Metric dropdown list in Edit Assignment&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor clicks on Edit Assignment button&lt;br /&gt;
Then Metric dropdown list is visible&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in instructor's Assign Grade view&lt;br /&gt;
Given Instructor has logged in&lt;br /&gt;
When Instructor clicks on View Submission button&lt;br /&gt;
And Instructor clicks on Assign Grade button&lt;br /&gt;
Then: Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of selected metric in student's View Scores view&lt;br /&gt;
Given Student has logged in&lt;br /&gt;
When Student clicks on View Scores button&lt;br /&gt;
Then: Selected metric is visible in heatgrid map&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_diagram_E2241.png&amp;diff=144754</id>
		<title>File:UML diagram E2241.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_diagram_E2241.png&amp;diff=144754"/>
		<updated>2022-04-12T00:22:13Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=144577</id>
		<title>CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=144577"/>
		<updated>2022-04-07T03:22:21Z</updated>

		<summary type="html">&lt;p&gt;Jmaduru: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the documentation of E2241: Heatgrid fixes and improvements as part of CSC/ECE 517 Spring 2022 Final project.&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
*Nicholas Himes (nnhimes)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (PinkPatterns) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Thedla (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Jyothi Sumer Goud Maduru (jmaduru)&lt;br /&gt;
* Suneha Bose (sbose2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Heat Grid &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat Grid refers to a part of view in Expertiza that shows review scores of all the reviews done for a particular assignment. It shows scores given for each rubric by peer reviewers. This is used by instructors to assign scores to individual assignments and by students to view review scores of their assignment. Our project scope involves dealing with fixing issues related to the heat grid and any subsequent bugs that might arrive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; There are some instances where a student was shown as reviewing his/her team even though the Allow Self Review checkbox was not marked by instructor. This is impossible and is classified as a bug. This must be dealt with. Test cases must be extensively added so that we can be notified if the bug occurs again. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.37.56 PM.png|center|450px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;metric-1&amp;lt;/b&amp;gt; column name in the heat grid follows bad naming convention. It doesn't explain what the column refers to. This must be changed to make the column name more apt.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; As of now, the heat grid uses only one metric (metric-1). We must facilitate the system for addition of new metrics. Instructors should be able to toggle between various metrics as per their preferences. This can be done by the use of a drop down menu.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2022-04-06 at 10.34.47 PM.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #2019: Restrict teammates from reviewing their own work &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Relevant bug of this issue can’t be reproduced to deal with it. So comprehensive test cases must be written to be notified if the bug arises again. We are planning to add rspec unit tests covering the following cases:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor unchecks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should not be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should not be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt; If the instructor checks “ Allow self review” option&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that he/she has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Instructor should be able to assign a student to review work that their teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work he/she has submitted. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Students should be able to review work a teammate has submitted.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue #1869: Deal with the metrics of the heat grid &amp;lt;/h3&amp;gt; &lt;br /&gt;
&amp;lt;p&amp;gt;The new metrics can be added to the Metrics table that we will create. While creating an assignment/ editing an assignment, the instructor can select a metric from the Metrics table which will be available as a dropdown menu. We will retrieve the metric selected for the assignment by the instructor and display it in the Heatgrid Map of reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* In create/edit assignment, the instructor will see ‘Metric Type’ drop down which has list of metrics based on the values in the database&lt;br /&gt;
* Save the selected metric type and update the value in the database&lt;br /&gt;
* Retrieve the metric type from the assignment and calculate the value of the metric&lt;br /&gt;
* Display the values of the metric in the Heatgrid view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Proposed Control Flow &amp;lt;/h4&amp;gt;&lt;br /&gt;
[[File:Proposed_Control_Flow.drawio.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Design Pattern &amp;lt;/h2&amp;gt;&lt;br /&gt;
For Issue #1869 we plan to use the Abstract Factory Pattern since we will be dealing with different families of metrics for grading purposes. It is preferable to reveal only the interfaces of metrics but conceal their implementations to avoid high coupling between classes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Files to be targeted &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue #1869&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;For Heat grid view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/grades/_view_heatgrid.html.erb&lt;br /&gt;
* app/views/grades/view_team.html.erb&lt;br /&gt;
* app/helpers/grades_helper.rb&lt;br /&gt;
* app/controllers/grades_controller.rb&lt;br /&gt;
* app/models/vm_question_response.rb&lt;br /&gt;
* app/models/vm_question_row.rb&lt;br /&gt;
* assets/view_team_in_grades.js&lt;br /&gt;
&amp;lt;p&amp;gt;For Assignment view&amp;lt;/p&amp;gt;&lt;br /&gt;
* app/views/assignment/edit/_general.html.erb&lt;br /&gt;
* app/controllers/assignments_controller.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
* Capybara Test cases for testing the UI of heat grid view with the expected metric for the respective assignment and the UI of team view with relevant metric selected with all other metrics in the dropdown&lt;br /&gt;
* Spec test cases for testing the grades controller and assignment controller to check if they are returning the values as expected&lt;br /&gt;
* Unit test cases will be added to verify the logic behind the methods to calculate the values for their metrics&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Important Links &amp;lt;/h2&amp;gt;&lt;br /&gt;
* GitHub repository link: https://github.com/EshwarCVS/expertiza&lt;br /&gt;
* Project Description Document: https://docs.google.com/document/d/1H0BjzMBz5it7Wckhegq4LXhMi8RVctTwVzP2x9gnFCo/edit#heading=h.tqdrrd12xs4x&lt;br /&gt;
* GitHub Issue #1869: https://github.com/expertiza/expertiza/issues/1869&lt;br /&gt;
* GitHub Issue #2019: https://github.com/expertiza/expertiza/issues/2019&lt;/div&gt;</summary>
		<author><name>Jmaduru</name></author>
	</entry>
</feed>