<?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=Gkogant</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=Gkogant"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Gkogant"/>
	<updated>2026-08-13T13:04:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2241:_Heatgrid_fixes_and_improvements&amp;diff=145636</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=145636"/>
		<updated>2022-05-02T04:03:18Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&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;
&amp;lt;p&amp;gt; This issue encompasses many problems such as review reports not displaying correctly and a user being able to review his/her work. Each problem has been dealt with individually. Main problems identified as part of this issue and relevant observations and corrections are jotted down in this section. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 1 : A user being able to review his/her own work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On Madeup Problem 3, assignment 1055, there are several anomalies in the review report. User 9277 reviewed Team_2323 and gave this comment: &amp;quot;This question seems a little suspicious. It is nearly identical to Question 4a on page 327 in the 2016 edition book. The only thing change was variable name A to B and value 2 to 3.&amp;quot; However, according to the View Submissions page, User 9277 is the only member of Team_2323. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We tried reproducing the issue as specified in the issue comment, but we could not find Madeup Problem 3, assignment 1055. So, we have created two assignments with different parameters to check if the instructor is able to assign a reviewer his/her own work. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We have created an assignment &amp;quot;Noself review&amp;quot; with allow self review option unchecked. Then, from the instructor page, we have created a team with student13 and student 14 as teammates. Then we logged into student14 account and submitted a hyperlink for that assignment. After that, from the instructor page we clicked on the assign review button and tried assigning student13 as the reviewer for that work and then tried the same with student14. In both the cases, the assignment failed by rendering a flash error message, &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Unchecked allow self-review option in &amp;quot;Noself review&amp;quot; assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-option-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page containing add reviewer button &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Duo-team-submission.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Adding student13 as reviewer for his/her own work &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-assign-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Flash error message displayed&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We followed the same process for &amp;quot;self_review assignment&amp;quot;, which gave student an option to self review his/her own work immediately after submitting their work. However, when the instructor tried assigning the user with his/her own work, same flash error message was displayed, not allowing the user to review their work.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Checked allow self-review option in &amp;quot;self_review assignment&amp;quot; &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-review-checked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page of self review assignment&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Participants_page_for_self-review_assignment.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Assigning student13 as reviewer for own work&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Student-13-self-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Display of error message after assigning own artifact&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File: Error-message-checked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test case added&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Previously implemented test cases of review_map controller have covered most of the tests pertaining to a user being assigned review work for his own artifact. These test cases primarily focused on the add_reviewer function of the review_mapping controller. However a test case checking for the display of flash error message on trying to assign reviewer to his/her own work was not covered, which we have added in the respective spec file. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   Scenario: Display of flash error message when instructor tries student their own artifact for reviewing&lt;br /&gt;
   Given instructor has logged in &lt;br /&gt;
   When the instructor visits the assignment page and&lt;br /&gt;
   When the instructor clicks on assign reviewer for an assignment and&lt;br /&gt;
   when the instructor tries to assign the owner of the artifact as the reviewer&lt;br /&gt;
   Then a flash error message is displayed saying &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       context 'when instructor tries to assign a student their own artifact for reviewing' do&lt;br /&gt;
       it 'flashes an error message' do&lt;br /&gt;
         allow(TeamsUser).to receive(:exists?).with(team_id: '1', user_id: 1).and_return(true)&lt;br /&gt;
         post :add_reviewer, @params&lt;br /&gt;
         expect(flash[:error]).to eq('You cannot assign this student to review his/her own artifact.')&lt;br /&gt;
         expect(response).to redirect_to '/review_mapping/list_mappings?id=1'&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 2 : Review comments from the first round not being displayed&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The Round 1 review (and the Round 1 heat grid) are missing when the instructor (instructor6) goes to Assign Grade for Student 9277. The Round 1 review should be in the first heat grid on the Assign Grades page. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; For this problem, we have tried the similar thing as the first problem. We have observed that if the instructor checks the option &amp;quot;review rubric varies by round&amp;quot; when the instructor creates an assignment, reviews from all the rounds are displayed in the heat grid. When the instructor unchecks that option, only the most recent review set is being displayed. As this is dependent on the user preference, we identified this not to be a problem.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Review rubric varies by round option, which is unchecked by default &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File: Unchecked-rubric-varies.jpeg|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Display of only the reviews of latest round when &amp;quot;Review rubric varies by round&amp;quot; is unchecked&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Latest_review_on_uncheck.jpeg|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Display of reviews of all the rounds when &amp;quot;Review rubric varies by round&amp;quot; is checked&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:All-round-display.jpeg|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&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>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:All-round-display.jpeg&amp;diff=145635</id>
		<title>File:All-round-display.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:All-round-display.jpeg&amp;diff=145635"/>
		<updated>2022-05-02T04:01:02Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Latest_review_on_uncheck.jpeg&amp;diff=145634</id>
		<title>File:Latest review on uncheck.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Latest_review_on_uncheck.jpeg&amp;diff=145634"/>
		<updated>2022-05-02T03:58:49Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Unchecked-rubric-varies.jpeg&amp;diff=145633</id>
		<title>File:Unchecked-rubric-varies.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Unchecked-rubric-varies.jpeg&amp;diff=145633"/>
		<updated>2022-05-02T03:52:25Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</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=145632</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=145632"/>
		<updated>2022-05-02T03:30:34Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&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;
&amp;lt;p&amp;gt; This issue encompasses many problems such as review reports not displaying correctly and a user being able to review his/her work. Each problem has been dealt with individually. Main problems identified as part of this issue and relevant observations and corrections are jotted down in this section. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 1 : A user being able to review his/her own work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On Madeup Problem 3, assignment 1055, there are several anomalies in the review report. User 9277 reviewed Team_2323 and gave this comment: &amp;quot;This question seems a little suspicious. It is nearly identical to Question 4a on page 327 in the 2016 edition book. The only thing change was variable name A to B and value 2 to 3.&amp;quot; However, according to the View Submissions page, User 9277 is the only member of Team_2323. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We tried reproducing the issue as specified in the issue comment, but we could not find Madeup Problem 3, assignment 1055. So, we have created two assignments with different parameters to check if the instructor is able to assign a reviewer his/her own work. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We have created an assignment &amp;quot;Noself review&amp;quot; with allow self review option unchecked. Then, from the instructor page, we have created a team with student13 and student 14 as teammates. Then we logged into student14 account and submitted a hyperlink for that assignment. After that, from the instructor page we clicked on the assign review button and tried assigning student13 as the reviewer for that work and then tried the same with student14. In both the cases, the assignment failed by rendering a flash error message, &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Unchecked allow self-review option in &amp;quot;Noself review&amp;quot; assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-option-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page containing add reviewer button &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Duo-team-submission.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Adding student13 as reviewer for his/her own work &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-assign-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Flash error message displayed&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We followed the same process for &amp;quot;self_review assignment&amp;quot;, which gave student an option to self review his/her own work immediately after submitting their work. However, when the instructor tried assigning the user with his/her own work, same flash error message was displayed, not allowing the user to review their work.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Checked allow self-review option in &amp;quot;self_review assignment&amp;quot; &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-review-checked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page of self review assignment&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Participants_page_for_self-review_assignment.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Assigning student13 as reviewer for own work&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Student-13-self-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Display of error message after assigning own artifact&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File: Error-message-checked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test case added&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Previously implemented test cases of review_map controller have covered most of the tests pertaining to a user being assigned review work for his own artifact. These test cases primarily focused on the add_reviewer function of the review_mapping controller. However a test case checking for the display of flash error message on trying to assign reviewer to his/her own work was not covered, which we have added in the respective spec file. /p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   Scenario: Display of flash error message when instructor tries student their own artifact for reviewing&lt;br /&gt;
   Given instructor has logged in &lt;br /&gt;
   When the instructor visits the assignment page and&lt;br /&gt;
   When the instructor clicks on assign reviewer for an assignment and&lt;br /&gt;
   when the instructor tries to assign the owner of the artifact as the reviewer&lt;br /&gt;
   Then a flash error message is displayed saying &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       context 'when instructor tries to assign a student their own artifact for reviewing' do&lt;br /&gt;
       it 'flashes an error message' do&lt;br /&gt;
         allow(TeamsUser).to receive(:exists?).with(team_id: '1', user_id: 1).and_return(true)&lt;br /&gt;
         post :add_reviewer, @params&lt;br /&gt;
         expect(flash[:error]).to eq('You cannot assign this student to review his/her own artifact.')&lt;br /&gt;
         expect(response).to redirect_to '/review_mapping/list_mappings?id=1'&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &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>Gkogant</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=145631</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=145631"/>
		<updated>2022-05-02T03:28:16Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&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;
&amp;lt;p&amp;gt; This issue encompasses many problems such as review reports not displaying correctly and a user being able to review his/her work. Each problem has been dealt with individually. Main problems identified as part of this issue and relevant observations and corrections are jotted down in this section. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 1 : A user being able to review his/her own work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On Madeup Problem 3, assignment 1055, there are several anomalies in the review report. User 9277 reviewed Team_2323 and gave this comment: &amp;quot;This question seems a little suspicious. It is nearly identical to Question 4a on page 327 in the 2016 edition book. The only thing change was variable name A to B and value 2 to 3.&amp;quot; However, according to the View Submissions page, User 9277 is the only member of Team_2323. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We tried reproducing the issue as specified in the issue comment, but we could not find Madeup Problem 3, assignment 1055. So, we have created two assignments with different parameters to check if the instructor is able to assign a reviewer his/her own work. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We have created an assignment &amp;quot;Noself review&amp;quot; with allow self review option unchecked. Then, from the instructor page, we have created a team with student13 and student 14 as teammates. Then we logged into student14 account and submitted a hyperlink for that assignment. After that, from the instructor page we clicked on the assign review button and tried assigning student13 as the reviewer for that work and then tried the same with student14. In both the cases, the assignment failed by rendering a flash error message, &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Unchecked allow self-review option in &amp;quot;Noself review&amp;quot; assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-option-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page containing add reviewer button &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Duo-team-submission.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Adding student13 as reviewer for his/her own work &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-assign-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Flash error message displayed&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We followed the same process for &amp;quot;self_review assignment&amp;quot;, which gave student an option to self review his/her own work immediately after submitting their work. However, when the instructor tried assigning the user with his/her own work, same flash error message was displayed, not allowing the user to review their work.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Checked allow self-review option in &amp;quot;self_review assignment&amp;quot; &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-review-checked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page of self review assignment&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Participants_page_for_self-review_assignment.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Assigning student13 as reviewer for own work&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Student-13-self-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Display of error message after assigning own artifact&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Error-message-checked.png.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test case added&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Previously implemented test cases of review_map controller have covered most of the tests pertaining to a user being assigned review work for his own artifact. These test cases primarily focused on the add_reviewer function of the review_mapping controller. However a test case checking for the display of flash error message on trying to assign reviewer to his/her own work was not covered, which we have added in the respective spec file. /p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   Scenario: Display of flash error message when instructor tries student their own artifact for reviewing&lt;br /&gt;
   Given instructor has logged in &lt;br /&gt;
   When the instructor visits the assignment page and&lt;br /&gt;
   When the instructor clicks on assign reviewer for an assignment and&lt;br /&gt;
   when the instructor tries to assign the owner of the artifact as the reviewer&lt;br /&gt;
   Then a flash error message is displayed saying &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       context 'when instructor tries to assign a student their own artifact for reviewing' do&lt;br /&gt;
       it 'flashes an error message' do&lt;br /&gt;
         allow(TeamsUser).to receive(:exists?).with(team_id: '1', user_id: 1).and_return(true)&lt;br /&gt;
         post :add_reviewer, @params&lt;br /&gt;
         expect(flash[:error]).to eq('You cannot assign this student to review his/her own artifact.')&lt;br /&gt;
         expect(response).to redirect_to '/review_mapping/list_mappings?id=1'&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &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>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Student-13-self-review.png&amp;diff=145630</id>
		<title>File:Student-13-self-review.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Student-13-self-review.png&amp;diff=145630"/>
		<updated>2022-05-02T03:27:55Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Error-message-checked.png&amp;diff=145629</id>
		<title>File:Error-message-checked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Error-message-checked.png&amp;diff=145629"/>
		<updated>2022-05-02T03:27:18Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Participants_page_for_self-review_assignment.png&amp;diff=145627</id>
		<title>File:Participants page for self-review assignment.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Participants_page_for_self-review_assignment.png&amp;diff=145627"/>
		<updated>2022-05-02T03:24:59Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-checked.png&amp;diff=145626</id>
		<title>File:Self-review-checked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-checked.png&amp;diff=145626"/>
		<updated>2022-05-02T03:19:20Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</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=145625</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=145625"/>
		<updated>2022-05-02T03:12:53Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&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;
&amp;lt;p&amp;gt; This issue encompasses many problems such as review reports not displaying correctly and a user being able to review his/her work. Each problem has been dealt with individually. Main problems identified as part of this issue and relevant observations and corrections are jotted down in this section. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 1 : A user being able to review his/her own work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On Madeup Problem 3, assignment 1055, there are several anomalies in the review report. User 9277 reviewed Team_2323 and gave this comment: &amp;quot;This question seems a little suspicious. It is nearly identical to Question 4a on page 327 in the 2016 edition book. The only thing change was variable name A to B and value 2 to 3.&amp;quot; However, according to the View Submissions page, User 9277 is the only member of Team_2323. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We tried reproducing the issue as specified in the issue comment, but we could not find Madeup Problem 3, assignment 1055. So, we have created two assignments with different parameters to check if the instructor is able to assign a reviewer his/her own work. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We have created an assignment &amp;quot;Noself review&amp;quot; with allow self review option unchecked. Then, from the instructor page, we have created a team with student13 and student 14 as teammates. Then we logged into student14 account and submitted a hyperlink for that assignment. After that, from the instructor page we clicked on the assign review button and tried assigning student13 as the reviewer for that work and then tried the same with student14. In both the cases, the assignment failed by rendering a flash error message, &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Unchecked allow self-review option in &amp;quot;Noself review&amp;quot; assignment &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-option-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Participants page containing add reviewer button &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Duo-team-submission.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Adding student13 as reviewer for his/her own work &amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:Self-assign-review.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Flash error message displayed&amp;lt;/li&amp;gt;&lt;br /&gt;
[[File:self-review-unchecked.png|600px]]&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We followed the same process for &amp;quot;self review&amp;quot; assignment, which gave student an option to self review his/her own work immediately after submitting their work. However, when the instructor tried assigning the user with his/her own work, same flash error message was displayed, not allowing the user to review their work.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test case added&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Previously implemented test cases of review_map controller have covered most of the tests pertaining to a user being assigned review work for his own artifact. These test cases primarily focused on the add_reviewer function of the review_mapping controller. However a test case checking for the display of flash error message on trying to assign reviewer to his/her own work was not covered, which we have added in the respective spec file. /p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   Scenario: Display of flash error message when instructor tries student their own artifact for reviewing&lt;br /&gt;
   Given instructor has logged in &lt;br /&gt;
   When the instructor visits the assignment page and&lt;br /&gt;
   When the instructor clicks on assign reviewer for an assignment and&lt;br /&gt;
   when the instructor tries to assign the owner of the artifact as the reviewer&lt;br /&gt;
   Then a flash error message is displayed saying &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       context 'when instructor tries to assign a student their own artifact for reviewing' do&lt;br /&gt;
       it 'flashes an error message' do&lt;br /&gt;
         allow(TeamsUser).to receive(:exists?).with(team_id: '1', user_id: 1).and_return(true)&lt;br /&gt;
         post :add_reviewer, @params&lt;br /&gt;
         expect(flash[:error]).to eq('You cannot assign this student to review his/her own artifact.')&lt;br /&gt;
         expect(response).to redirect_to '/review_mapping/list_mappings?id=1'&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &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>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-assign-review.png&amp;diff=145624</id>
		<title>File:Self-assign-review.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-assign-review.png&amp;diff=145624"/>
		<updated>2022-05-02T03:10:01Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Duo-team-submission.png&amp;diff=145623</id>
		<title>File:Duo-team-submission.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Duo-team-submission.png&amp;diff=145623"/>
		<updated>2022-05-02T03:06:20Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-option-unchecked.png&amp;diff=145622</id>
		<title>File:Self-review-option-unchecked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-option-unchecked.png&amp;diff=145622"/>
		<updated>2022-05-02T03:03:02Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-unchecked.png&amp;diff=145621</id>
		<title>File:Self-review-unchecked.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Self-review-unchecked.png&amp;diff=145621"/>
		<updated>2022-05-02T02:56:30Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</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=145620</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=145620"/>
		<updated>2022-05-02T02:52:18Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&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;
&amp;lt;p&amp;gt; This issue encompasses many problems such as review reports not displaying correctly and a user being able to review his/her work. Each problem has been dealt with individually. Main problems identified as part of this issue and relevant observations and corrections are jotted down in this section. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Problem 1 : A user being able to review his/her own work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Problem comment &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On Madeup Problem 3, assignment 1055, there are several anomalies in the review report. User 9277 reviewed Team_2323 and gave this comment: &amp;quot;This question seems a little suspicious. It is nearly identical to Question 4a on page 327 in the 2016 edition book. The only thing change was variable name A to B and value 2 to 3.&amp;quot; However, according to the View Submissions page, User 9277 is the only member of Team_2323. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue Reproduction and Observations &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; We tried reproducing the issue as specified in the issue comment, but we could not find Madeup Problem 3, assignment 1055. So, we have created two assignments with different parameters to check if the instructor is able to assign a reviewer his/her own work. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We have created an assignment &amp;quot;Noself review&amp;quot; with allow self review option unchecked. Then, from the instructor page, we have created a team with student13 and student 14 as teammates. Then we logged into student14 account and submitted a hyperlink for that assignment. After that, from the instructor page we clicked on the assign review button and tried assigning student13 as the reviewer for that work and then tried the same with student14. In both the cases, the assignment failed by rendering a flash error message, &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; We followed the same process for &amp;quot;self review&amp;quot; assignment, which gave student an option to self review his/her own work immediately after submitting their work. However, when the instructor tried assigning the user with his/her own work, same flash error message was displayed, not allowing the user to review their work.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Test case added&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Previously implemented test cases of review_map controller have covered most of the tests pertaining to a user being assigned review work for his own artifact. These test cases primarily focused on the add_reviewer function of the review_mapping controller. However a test case checking for the display of flash error message on trying to assign reviewer to his/her own work was not covered, which we have added in the respective spec file. /p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   Scenario: Display of flash error message when instructor tries student their own artifact for reviewing&lt;br /&gt;
   Given instructor has logged in &lt;br /&gt;
   When the instructor visits the assignment page and&lt;br /&gt;
   When the instructor clicks on assign reviewer for an assignment and&lt;br /&gt;
   when the instructor tries to assign the owner of the artifact as the reviewer&lt;br /&gt;
   Then a flash error message is displayed saying &amp;quot;You cannot assign this student to review his/her own artifact.&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       context 'when instructor tries to assign a student their own artifact for reviewing' do&lt;br /&gt;
       it 'flashes an error message' do&lt;br /&gt;
         allow(TeamsUser).to receive(:exists?).with(team_id: '1', user_id: 1).and_return(true)&lt;br /&gt;
         post :add_reviewer, @params&lt;br /&gt;
         expect(flash[:error]).to eq('You cannot assign this student to review his/her own artifact.')&lt;br /&gt;
         expect(response).to redirect_to '/review_mapping/list_mappings?id=1'&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &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>Gkogant</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=145578</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=145578"/>
		<updated>2022-05-01T17:41:01Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;
&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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&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>Gkogant</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=145577</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=145577"/>
		<updated>2022-05-01T17:39:47Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Unit Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
As our project does not deal with actually adding new metrics, but just facilitating a low-coupling addition of new metrics, we need not add any unit test cases for metric implementations. There is only one metric in the system as of now for which test cases are already written.&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&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>Gkogant</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=145572</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=145572"/>
		<updated>2022-05-01T07:35:40Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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; Manual Testing &amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Visibility of all the unchecked metric checkboxes in View Scores view&lt;br /&gt;
Given user has logged in&lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then all the unchecked  metric checkboxes are present above the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Default invisibility of metric columns in View Scores view&lt;br /&gt;
Given user has logged in &lt;br /&gt;
When user visits View Scores page&lt;br /&gt;
Then metric columns are not visible in the heat grid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Checking a metric checkbox displays the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on unchecked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; gets displayed with corresponding values&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Unchecking a metric checkbox hides the corresponding metric column&lt;br /&gt;
Given user  has logged in&lt;br /&gt;
When user visits  View Scores page and &lt;br /&gt;
When user clicks on checked comments#10 metric&lt;br /&gt;
Then column with column name &amp;quot; comments#10&amp;quot; and corresponding values get hidden&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&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;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Implementation of Issue 2019&amp;lt;/h2&amp;gt;&lt;br /&gt;
&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>Gkogant</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=144981</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=144981"/>
		<updated>2022-04-12T03:46:40Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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; 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>Gkogant</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=144582</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=144582"/>
		<updated>2022-04-07T03:31:21Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;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;
* 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>Gkogant</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=144580</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=144580"/>
		<updated>2022-04-07T03:25:29Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &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;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>Gkogant</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=144534</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=144534"/>
		<updated>2022-04-07T02:09:58Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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; Restrict teammates from reviewing their own work (Issue #2019)&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. 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;
&amp;lt;h3&amp;gt; Deal with the metrics of the heat grid (Issue #1869)&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;
&amp;lt;h2&amp;gt; Current Implementation &amp;lt;/h2&amp;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; Restrict teammates from reviewing their own work (Issue #2019)&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;
&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&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;
&amp;lt;p&amp;gt;For Assignment&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>Gkogant</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=143865</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=143865"/>
		<updated>2022-03-31T21:56:23Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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 Theda (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; Restrict teammates from reviewing their own work (Issue #2019)&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. 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;
&amp;lt;h3&amp;gt; Deal with the metrics of the heat grid (Issue #1869)&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;
&amp;lt;h2&amp;gt; Plan of work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</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=143863</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=143863"/>
		<updated>2022-03-31T21:54:44Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: Created page with &amp;quot;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.  __TOC__  &amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt; &amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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 Theda (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; Restrict teammates from reviewing their own work (Issue #2019)&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. 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;
&amp;lt;h3&amp;gt; Deal with the metrics of the heat grid (Issue #1869)&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;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143860</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143860"/>
		<updated>2022-03-31T21:47:11Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2200: Testing advice_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Adding tests for courses_controller, eula_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2204: Adding tests for markup_styles_controller, lock_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2208: Testing for submission_records_controller, profile_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2218: Refactor response_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2216: Refactor late_policies_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2215: Refactor student_quizzes_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2219: Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2211: Testing for summary_helper]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2225: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2221: Refactor submitted content controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2206: Testing for users_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2207: Testing for submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2205: Testing for participants_controller, versions_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2212: Testing for hamer.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2200: Refactoring evaluation of SQL queries (Java/JUnit)]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2222: Refactor impersonate_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2202- Testing for badges_controller, publishing_controller]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2022 - E2220: Refactor reputation_web_service_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2224: Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2209: Testing for analytic helper.rb, join team requests helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2227: SQL Injection Fix]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2201: Testing for assignment_questionnaire_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2243. Refactor student_teams functionality]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements]]&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143555</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143555"/>
		<updated>2022-03-23T18:34:10Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments. It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issues pertaining to the below mentioned fixes and had to debug the file extensively. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2291/commits/673fe2099991c21237c59c71d7ee51f063e55b70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make the code compact&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the changes manually use the following link to access the reputation web service endpoint.&lt;br /&gt;
&amp;lt;br/&amp;gt;http://152.7.177.155:8080/reputation_web_service/client&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Username :&amp;lt;/b&amp;gt; instructor6 &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Password :&amp;lt;/b&amp;gt; password &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Enter assignment id which is a mandatory field, the secondary assignment id is optional. Enter the round number for which we want to calculate the reputation for (1-3) &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Select the type of algorithm to calculate the reputation for the peer reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Based on the type of algorithm selected, some of the additional information is automatically passed. Other additional information is optional.&lt;br /&gt;
&amp;lt;p&amp;gt; Click send request (This might take a few minutes, please be patient)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On clicking the send request, the JSON for the post request to the reputation web service is formed, and then sent. &amp;lt;br/&amp;gt;On receiving the response, we parse it and update the reputation of participants of the assignment provided. &amp;lt;br/&amp;gt;The request and response JSONs can be seen in both minified and beautified versions.&lt;br /&gt;
&amp;lt;br/&amp;gt; There is also a summary of the choices selected above the beautified JSONs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
Only a few methods and flows have automated test cases. Adding test cases is not in the scope of this project, and will be taken up later, to make the entire controller robust.&amp;lt;br/&amp;gt; However, we have made sure that all the existing test cases are not broken and working as they are supposed to be.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; To run the automated rspec cases run the below command to verify if all the test cases are working.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143530</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143530"/>
		<updated>2022-03-22T04:34:37Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issues pertaining to the below mentioned fixes and had to debug the file extensively. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2291/commits/673fe2099991c21237c59c71d7ee51f063e55b70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make the code compact&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143528</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143528"/>
		<updated>2022-03-22T04:04:30Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issues pertaining to the below mentioned fixes and had to debug the file extensively. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make the code compact&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143526</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143526"/>
		<updated>2022-03-22T03:56:56Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issued pertaining to the below mentioned fixes and had to debug the file extensively to make the below fixes. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
 prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make some changes&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143524</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143524"/>
		<updated>2022-03-22T03:55:28Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issued pertaining to the below mentioned fixes and had to debug the file extensively to make the below fixes. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
 prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make some changes&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143523</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143523"/>
		<updated>2022-03-22T03:47:59Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issued pertaining to the below mentioned fixes and had to debug the file extensively to make the below fixes. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
 prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make some changes&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143521</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143521"/>
		<updated>2022-03-22T03:30:58Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issued pertaining to the below mentioned fixes and had to debug the file extensively to make the below fixes. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. These functions further use helper methods to abide by the SRP principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods. These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make some changes&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143506</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143506"/>
		<updated>2022-03-22T02:33:22Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. These functions further use helper methods to abide by the SRP principle. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods. These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to be more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Function description&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143488</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143488"/>
		<updated>2022-03-22T02:17:24Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt;method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to be more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Function description&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143458</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143458"/>
		<updated>2022-03-22T01:16:54Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Before sending the request, please assign values for assignment_id and round, choose an algorithm.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143432</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143432"/>
		<updated>2022-03-22T00:38:21Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Send_post_references.png&amp;diff=143369</id>
		<title>File:Send post references.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Send_post_references.png&amp;diff=143369"/>
		<updated>2022-03-21T23:41:00Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143367</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143367"/>
		<updated>2022-03-21T23:39:07Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Deleted, unused code:&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
[[File: commented_code.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143348</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143348"/>
		<updated>2022-03-21T23:26:59Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the sen_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Deleted, unused code:&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
[[File: commented_code.png|800px|]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Commented_code.png&amp;diff=143341</id>
		<title>File:Commented code.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Commented_code.png&amp;diff=143341"/>
		<updated>2022-03-21T23:16:09Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143316</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143316"/>
		<updated>2022-03-21T22:58:01Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the sen_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143312</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143312"/>
		<updated>2022-03-21T22:54:38Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issue identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary references in the sen_post_request body&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Changed method names to be more meaningful&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Function description&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Removed unnecessary code&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Corrected spelling mistakes &amp;lt;/h3&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143194</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143194"/>
		<updated>2022-03-21T20:33:52Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issue identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143190</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143190"/>
		<updated>2022-03-21T20:29:21Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&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;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments . It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issue identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143176</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143176"/>
		<updated>2022-03-21T20:05:14Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issue identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
1. Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task.&lt;br /&gt;
2. In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed.&lt;br /&gt;
3. Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&lt;br /&gt;
4. Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&lt;br /&gt;
5. Detailed method descriptions are needed to be inserted into the code as comments.&lt;br /&gt;
6. Client is a bad method name and needs to be changed.&lt;br /&gt;
7. There is a lot of unused/commented code, which should be removed.&lt;br /&gt;
8. Some spelling mistakes are identified in the code.&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda&lt;br /&gt;
* Gokul Krishna Koganti&lt;br /&gt;
* Krishna Saurabh Vankadaru&lt;br /&gt;
* Naman Shrimali (Mentor)&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143173</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143173"/>
		<updated>2022-03-21T20:00:07Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: Created page with &amp;quot;  __TOC__  &amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;  &amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;  Expertiza provides a way for students to peer review others' works. The motive of...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issue identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
1. Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task.&lt;br /&gt;
2. In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed.&lt;br /&gt;
3. Password for a private key is place in the code. As this code is open-sourced, this causes security concerns and must be handled.&lt;br /&gt;
4. Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&lt;br /&gt;
5. Detailed method descriptions are needed to be inserted into the code as comments.&lt;br /&gt;
6. Client is a bad method name and needs to be changed.&lt;br /&gt;
7. There is a lot of unused/commented code, which should be removed.&lt;br /&gt;
8. Some spelling mistakes are identified in the code.&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda&lt;br /&gt;
* Gokul Krishna Koganti&lt;br /&gt;
* Krishna Saurabh Vankadaru&lt;br /&gt;
* Naman Shrimali (Mentor)&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143172</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=143172"/>
		<updated>2022-03-21T19:57:05Z</updated>

		<summary type="html">&lt;p&gt;Gkogant: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Link title]]== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Adding tests for courses_controller, eula_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2204: Adding tests for markup_styles_controller, lock_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2218: Refactor response_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2216: Refactor late_policies_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2215: Refactor student_quizzes_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2219: Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2211: Testing for summary_helper]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2221: Refactor submitted content controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2206: Testing for users_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2205: Testing for participants_controller, versions_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2212: Testing for hamer.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2200: Refactoring evaluation of SQL queries (Java/JUnit)]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2222: Refactor impersonate_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2202- Testing for badges_controller, publishing_controller]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2022 - E2220: Refactor reputation_web_service_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2224: Refactor review_mapping_controller]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;/div&gt;</summary>
		<author><name>Gkogant</name></author>
	</entry>
</feed>