<?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=Webrown2</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=Webrown2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Webrown2"/>
	<updated>2026-05-09T09:20:31Z</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_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145567</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145567"/>
		<updated>2022-04-30T19:00:57Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-d158325bd4fd49ca872c3468ac2193f04d7c9fbe32a0497f7181bbc74c21ed8f here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to remove the &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt;, and now follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': File Changes: [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''Changes Made''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove expert pattern violation, a model is newly added: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt; and it includes &amp;lt;code&amp;gt;student_review_strategy&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_review_strategy&amp;lt;/code&amp;gt; classes. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. Updated Rspec files according to refactoring project:&lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. Rspec Tested files: All rspec tests are passed &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Our refactoring didn't change functionality. Functionality tests were not needed and included.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145444</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145444"/>
		<updated>2022-04-26T19:55:44Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-d158325bd4fd49ca872c3468ac2193f04d7c9fbe32a0497f7181bbc74c21ed8f here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': File Changes: [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''Changes Made''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. Updated Rspec files according to refactoring project:&lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. Rspec Tested files: All rspec tests are passed &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Our refactoring didn't change functionality. Functionality tests were not needed and included.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145443</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145443"/>
		<updated>2022-04-26T18:49:38Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-d158325bd4fd49ca872c3468ac2193f04d7c9fbe32a0497f7181bbc74c21ed8f here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''Changes Made''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. Updated Rspec files according to refactoring project:&lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. Rspec Tested files: All rspec tests are passed &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Our refactoring didn't change functionality. Functionality tests were not needed and included.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145442</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145442"/>
		<updated>2022-04-26T18:48:57Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 6: Investigate the use of  list_review_submissions  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-d158325bd4fd49ca872c3468ac2193f04d7c9fbe32a0497f7181bbc74c21ed8f here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''Changes Made''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. Updated Rspec files according to refactoring project:&lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. Rspec Tested files: All rspec tests are passed &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Our refactoring didn't change functionality. Functionality tests were not needed and included.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145441</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145441"/>
		<updated>2022-04-26T18:48:15Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-d158325bd4fd49ca872c3468ac2193f04d7c9fbe32a0497f7181bbc74c21ed8f here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''Changes Made''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1. Updated Rspec files according to refactoring project:&lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. Rspec Tested files: All rspec tests are passed &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  * &amp;lt;code&amp;gt;/rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Our refactoring didn't change functionality. Functionality tests were not needed and included.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=145138</id>
		<title>File:517 E2239 UML Diagram.vpd.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=145138"/>
		<updated>2022-04-25T18:13:33Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: Webrown2 uploaded a new version of File:517 E2239 UML Diagram.vpd.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=145137</id>
		<title>File:517 E2239 UML Diagram.vpd.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=145137"/>
		<updated>2022-04-25T18:12:16Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: Webrown2 uploaded a new version of File:517 E2239 UML Diagram.vpd.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145136</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145136"/>
		<updated>2022-04-25T18:05:03Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 3: The method get_awarded_review_score needs to be updated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c]&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
following Rspec files have updated according to refactoring&lt;br /&gt;
* &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt; /rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files#]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145135</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145135"/>
		<updated>2022-04-25T18:04:50Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 3: The method get_awarded_review_score needs to be updated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
*'' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 link]&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
*'''Changes Made''':[https://github.com/expertiza/expertiza/pull/2385/files#diff-1ffe08b34487becc1b3e011ae44988b88a2e7da38462753ebc16d6a828e42d6c]&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 here]&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
following Rspec files have updated according to refactoring&lt;br /&gt;
* &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt; /rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files#]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145107</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145107"/>
		<updated>2022-04-25T02:32:51Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 Link to pull request]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
following Rspec files have updated according to refactoring&lt;br /&gt;
* &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt; /rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files#]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145106</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145106"/>
		<updated>2022-04-25T02:32:27Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
*''' Changes Made ''': [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 link]&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
*''' Changes Made ''': File Changes:  [https://github.com/expertiza/expertiza/pull/2385/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 here],  [https://github.com/expertiza/expertiza/pull/2385/files#diff-dd3da33cc930dd8c0ea397047960fedc8ad0ddd531fa579844c9725d23bdd003 here], [https://github.com/expertiza/expertiza/pull/2385/files#diff-6ed94fc2c563ffb24d16737ab83e290c7f9348e82209013580a0e822848947af here]&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update. The function.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
following Rspec files have updated according to refactoring&lt;br /&gt;
* &amp;lt;code&amp;gt;/rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt; /rspec/review_mapping_chart_helper_spec.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
* GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
* GitHub Pull Request [https://github.com/expertiza/expertiza/pull/2385/files#]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145091</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145091"/>
		<updated>2022-04-24T22:08:04Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 6: Investigate the use of  list_review_submissions  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
[[File:E2239Problem6.png]]&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2239Problem6.png&amp;diff=145090</id>
		<title>File:E2239Problem6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2239Problem6.png&amp;diff=145090"/>
		<updated>2022-04-24T22:07:26Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145089</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145089"/>
		<updated>2022-04-24T22:06:04Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 1: The method get_data_for_review_report violates the Expert pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145088</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145088"/>
		<updated>2022-04-24T22:05:44Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;&amp;lt;_review_report.html.erb&amp;gt;&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*&amp;lt;code&amp;gt;team_reviewed.html.erb&amp;lt;/code&amp;gt; has been added to render partials used by &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145085</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145085"/>
		<updated>2022-04-24T22:03:16Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': The columns of the view that were displaying the score and average score were already using partials. This logic was adopted to change the &amp;quot;Team Reviewed&amp;quot; section to use a partial as well. This included moving the code from this section of &amp;lt;code&amp;gt;&amp;lt;_review_report.html.erb&amp;gt;&amp;lt;/code&amp;gt; into a new file in order to render the partial: &amp;lt;code&amp;gt;_team_reviewed.html.erb&amp;lt;/code&amp;gt;. This new file was commented to note what it is doing, and the calling code was modified to pass necessary local variables. The code was also cleaned up to look nicer and align with how other calls in the same block of code were being done.&lt;br /&gt;
  &lt;br /&gt;
    &amp;lt;td align = 'left'&amp;gt;&lt;br /&gt;
      &amp;lt;% @response_maps.each_with_index do |reviewer_map, index| %&amp;gt;&lt;br /&gt;
        &amp;lt;% if Team.where(id: reviewer_map.reviewee_id).length &amp;gt; 0 %&amp;gt;&lt;br /&gt;
          &amp;lt;% @team = Team.find(reviewer_map.reviewee_id) %&amp;gt;&lt;br /&gt;
          &amp;lt;%= render partial: 'team_reviewed', locals: {bgcolor: @bgcolor, team_id: @team.id, reviewer_id: reviewer.id, reviewer_map: reviewer_map, index: index, reviewer: reviewer} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view (&amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt;). Need clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Investigate the validity of the method. If useless, remove it; else, document it and refactor if necessary.&lt;br /&gt;
          &lt;br /&gt;
*''' Solution Implemented ''': Investigation yields the purpose of this method - it adds a link to the associated files that a reviewer uploaded in association with a review (as seen in below image). As such, this is a useful function, so it remains in place. Comments were added to the method header to explain what it is doing. Additionally, the file name was changed to &amp;lt;code&amp;gt;list_review_uploaded_files&amp;lt;/code&amp;gt; to better reflect its functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145084</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145084"/>
		<updated>2022-04-24T21:42:22Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. This method should not be counting the number of review rounds, as that is calculated elsewhere in the system.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145083</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145083"/>
		<updated>2022-04-24T21:34:22Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145082</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145082"/>
		<updated>2022-04-24T21:24:42Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 3: The method get_awarded_review_score needs to be updated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;, and rename it to &amp;lt;code&amp;gt;awarded_review_score?&amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Solution Implemented ''': After investigation, it was found that &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; does not actually perform any score computation, and shares very similar functionality with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt;. Both methods set instance variables that are retrieved by &amp;lt;code&amp;gt;team_score_score_awarded.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;team_score.html.erb&amp;lt;/code&amp;gt; respectively. The &amp;lt;code&amp;gt;scoring.rb&amp;lt;/code&amp;gt; model and the models that include it were investigated to find code that could possibly substitute for &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;, but it was found that no comparable method exists. Ultimately, it was decided to keep &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; as-is, but rename it to &amp;lt;code&amp;gt;awarded_review_metrics?&amp;lt;/code&amp;gt;, both to standardize its naming with &amp;lt;code&amp;gt;review_metrics&amp;lt;/code&amp;gt; and to better reflect the fact this method is not involved in score calculation.&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145081</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145081"/>
		<updated>2022-04-24T21:15:47Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 3: The method get_awarded_review_score needs to be updated */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
*''' Implemented Solution ''': After investigation, it was found that&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145051</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145051"/>
		<updated>2022-04-24T01:06:22Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; to follow standard naming conventions. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
'''FeedbackResponseMap''' found in two places in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; =&amp;gt; will add comments to make this code understandable.&lt;br /&gt;
&lt;br /&gt;
   def get_certain_review_and_feedback_response_map(author)&lt;br /&gt;
       @feedback_response_maps = '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?', @all_review_response_ids, author.id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145050</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145050"/>
		<updated>2022-04-24T01:05:51Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
*''' Solution Implemented ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to end with &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Respective calls to these methods in various views and tests have also been refactored to use the updated names&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
'''FeedbackResponseMap''' found in two places in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; =&amp;gt; will add comments to make this code understandable.&lt;br /&gt;
&lt;br /&gt;
   def get_certain_review_and_feedback_response_map(author)&lt;br /&gt;
       @feedback_response_maps = '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?', @all_review_response_ids, author.id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
*'''Solution Implemented''':The method &amp;lt;code&amp;gt;feedback_response_map_record&amp;lt;/code&amp;gt; is for the assignment has multiple rounds. However, the same function is already in &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;feedback_response_map&amp;lt;/code&amp;gt;. This method is better to be removed from this helper method for DRY. Rspec test also applied this update.&lt;br /&gt;
&lt;br /&gt;
*'''One thing found''': For the multiple round assignment, &amp;quot;Author feedback report&amp;quot; doesn't create appropriate table. It may require refactor &amp;lt;code&amp;gt;views/reports/feedback_report&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
*'''Solution Implemented''': To remove single responsibility violation, extra model files are created: &amp;lt;code&amp;gt; review_strategy.rb&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;student_review_strategy.rb&amp;lt;/code&amp;gt;.and &amp;lt;code&amp;gt;team_review_strategy.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
The associated method &amp;lt;code&amp;gt;automatic_reivew_mapping_startegy&amp;lt;/code&amp;gt; rspec test pass with this change.&lt;br /&gt;
&lt;br /&gt;
=== Problem 9: The method get_team_color begins with &amp;lt;code&amp;gt;get_&amp;lt;/code&amp;gt; and another method called &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; exists ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; violates naming conventions, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; also has a similar name and is only used by &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; can be considered a private method, so testing could be removed if its callee is alredy being tested.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, the contents of &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; will be moved to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/22/2022&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt; get_team_color&amp;lt;/code&amp;gt; method was renamed to &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, tests and view files have been updated with the proper naming. &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;'s code as been moved into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. The tests for it have also been deleted since the code was already testing the called method contents before refactoring.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''': Refactor Aim for &amp;quot; Always have working Code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145030</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145030"/>
		<updated>2022-04-22T03:50:25Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
'''FeedbackResponseMap''' found in two places in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; =&amp;gt; will add comments to make this code understandable.&lt;br /&gt;
&lt;br /&gt;
   def get_certain_review_and_feedback_response_map(author)&lt;br /&gt;
       @feedback_response_maps = '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?', @all_review_response_ids, author.id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;, as the the former was called by the latter and was not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145029</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=145029"/>
		<updated>2022-04-22T03:48:18Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 5: Several methods are used for generating charts and should be moved to another file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses more on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== History: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ==&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
== Previous Methods/Classes and their Usages ==&lt;br /&gt;
&lt;br /&gt;
This Chart shows each method in the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; file before our changes will be implemented. Since this project is a refactor, the overall usage of the file will not change, but some methods may be combined, added, destroyed, or moved to other files. The helper file also contains inner classes that work with the &amp;lt;code&amp;gt;review_mapping_controller.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MethodUsage.JPG|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as a number of suggestions, or a number of suggestions + number of problems detected. This will also justify a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*''' Solution Implemented ''': &amp;lt;code&amp;gt; Done 4/21/2022 &amp;lt;/code&amp;gt; These methods were moved to &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, all related tests were also moved, comments were added to the view files to reflect changes.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
'''FeedbackResponseMap''' found in two places in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; =&amp;gt; will add comments to make this code understandable.&lt;br /&gt;
&lt;br /&gt;
   def get_certain_review_and_feedback_response_map(author)&lt;br /&gt;
       @feedback_response_maps = '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?', @all_review_response_ids, author.id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def feedback_response_map_record(author)&lt;br /&gt;
      instance_variable_set('@feedback_response_maps_round_' + round_num,&lt;br /&gt;
                            '''FeedbackResponseMap'''.where(['reviewed_object_id IN (?) and reviewer_id = ?',&lt;br /&gt;
                                                       instance_variable_get('@all_review_response_ids_round_' + round_num), author.id]))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. Case#1: Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include it in the Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144851</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144851"/>
		<updated>2022-04-12T01:40:28Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144849</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144849"/>
		<updated>2022-04-12T01:36:44Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 5: Several methods are used for generating charts and should be moved to another file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': These methods will be moved to a new helper class, &amp;lt;code&amp;gt;review_mapping_chart_helper.rb&amp;lt;/code&amp;gt;. This should separate their functionality from &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;, and better illustrate their independent usage by &amp;lt;code&amp;gt;review_report.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;answer_tagging.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144848</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144848"/>
		<updated>2022-04-12T01:35:03Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem 2: Several method names begin with get */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;. Other method names beginning with verbs will also be reviewed&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144844</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144844"/>
		<updated>2022-04-12T01:34:12Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; =&amp;gt; Better to move this Class to * * * 8 &lt;br /&gt;
&amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Class ReviewStrategy&amp;lt;/code&amp;gt; example in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_model&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144840</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144840"/>
		<updated>2022-04-12T01:32:56Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &lt;br /&gt;
Class &amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
Better to move this Class to &amp;lt;code&amp;gt;reveiw_mapping_model.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    def automatic_review_mapping_strategy()&lt;br /&gt;
    ...&lt;br /&gt;
       if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
       elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
         review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
       end&lt;br /&gt;
    ...&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The updated schema makes these changes:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt; has been refactored into &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt;, as the the former is called by the latter and is not unique enough to exist as a separate method&lt;br /&gt;
*&amp;lt;code&amp;gt;initialze_chart_elements&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;calculate_key_chart_information&amp;lt;/code&amp;gt; have been refactored into a separate helper class, as their functionality is self-contained enough to exist on their own&lt;br /&gt;
*&amp;lt;code&amp;gt;ReviewStrategy&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; have ben refactored as inner classes of &amp;lt;code&amp;gt;review_mapping_controler&amp;lt;/code&amp;gt; as this is the only class that interacts with these inner-classes.&lt;br /&gt;
*All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; have been refactored to use &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; in order to conform to ruby standards&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144830</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144830"/>
		<updated>2022-04-12T01:25:40Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
  *Class &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def automatic_review_mapping_strategy(assignment_id,&lt;br /&gt;
                                        participants, teams, student_review_num = 0,&lt;br /&gt;
                                        submission_review_num = 0)&lt;br /&gt;
    ...&lt;br /&gt;
    if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
    elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144829</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144829"/>
		<updated>2022-04-12T01:25:16Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
  *Class &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def automatic_review_mapping_strategy(assignment_id,&lt;br /&gt;
                                        participants, teams, student_review_num = 0,&lt;br /&gt;
                                        submission_review_num = 0)&lt;br /&gt;
    ...&lt;br /&gt;
    if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
    elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517 E2239 UML Diagram.vpd.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144828</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144828"/>
		<updated>2022-04-12T01:24:36Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
  *Class &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def automatic_review_mapping_strategy(assignment_id,&lt;br /&gt;
                                        participants, teams, student_review_num = 0,&lt;br /&gt;
                                        submission_review_num = 0)&lt;br /&gt;
    ...&lt;br /&gt;
    if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
    elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[File:517E2239UMLDiagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144827</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144827"/>
		<updated>2022-04-12T01:23:56Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;StudentReviewStrategy&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
  *Class &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt; is called in &amp;lt;code&amp;gt;reveiw_mapping_controller.rb&amp;lt;/code&amp;gt; &lt;br /&gt;
  *&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def automatic_review_mapping_strategy(assignment_id,&lt;br /&gt;
                                        participants, teams, student_review_num = 0,&lt;br /&gt;
                                        submission_review_num = 0)&lt;br /&gt;
    ...&lt;br /&gt;
    if !student_review_num.zero? &amp;amp;&amp;amp; submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::StudentReviewStrategy'''.new(participants, teams, student_review_num)&lt;br /&gt;
    elsif student_review_num.zero? &amp;amp;&amp;amp; !submission_review_num.zero?&lt;br /&gt;
      review_strategy = '''ReviewMappingHelper::TeamReviewStrategy'''.new(participants, teams, submission_review_num)&lt;br /&gt;
    end&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[517E2239UMLDiagram.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144823</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144823"/>
		<updated>2022-04-12T01:22:49Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Histories: Previous project for refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; ===&lt;br /&gt;
 * E2225 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2022_-_E2225:_Refactor_review_mapping_helper.rb]&lt;br /&gt;
 * E2162 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper]&lt;br /&gt;
 * E1913 [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2019_-_Project_E1913._Refactor_review_mapping_helper.rb]&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
A picture of the current and proposed UML diagram is included below&lt;br /&gt;
&lt;br /&gt;
[[517 E2239 UML Diagram.vpd.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=144819</id>
		<title>File:517 E2239 UML Diagram.vpd.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:517_E2239_UML_Diagram.vpd.png&amp;diff=144819"/>
		<updated>2022-04-12T01:21:50Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144793</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144793"/>
		<updated>2022-04-12T00:59:56Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144792</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144792"/>
		<updated>2022-04-12T00:56:01Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144791</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144791"/>
		<updated>2022-04-12T00:55:26Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem 1: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem 2: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names. e.g. &amp;lt;code&amp;gt;get_team_color&amp;lt;/code&amp;gt; will be refactored into &amp;lt;code&amp;gt;team_color?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 3: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Problem 4: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
=== Problem 5: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin.&lt;br /&gt;
&lt;br /&gt;
=== Problem 6: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method.&lt;br /&gt;
&lt;br /&gt;
=== Problem 7: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing&lt;br /&gt;
&lt;br /&gt;
=== Problem 8: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
*''' RSpec Unit Tests''':&lt;br /&gt;
&lt;br /&gt;
Rspec file &amp;lt;code&amp;gt; /rspec/review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; will be updated depending on the following cases.&lt;br /&gt;
&lt;br /&gt;
1. case#1 : Methods not included in Rspec =&amp;gt; review the method to refactor &amp;amp; include in Rspec file. &lt;br /&gt;
&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;initialize_chart_elements&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_volume_metric_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;display_tagging_interval_chart&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;list_hyperlink_submission&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_each_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;get_certain_review_and_feedback_response_map&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class ReviewStrategy &amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class StudentReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
 - &amp;lt;code&amp;gt;Class TeamReviewStrategy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Case #2: Refactoring may cause to break existing Rspec. =&amp;gt; refactor Rspec as well&lt;br /&gt;
&lt;br /&gt;
3. Case #3: Adding a new method =&amp;gt; Add new Rspec scenario&lt;br /&gt;
&lt;br /&gt;
4. Case #4: Removing methods =&amp;gt; Remove from Rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Functionality Tests''':&lt;br /&gt;
&lt;br /&gt;
Functionality test will be added when our refactor causes to change in the logic. Our focus on this project is refactoring &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; to be more readable and understandable.&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144669</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144669"/>
		<updated>2022-04-11T20:34:48Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Within Expertiza, one of the functionalities is for one participant to review the submission of another participant (or team) by answering specific questions about the submission and leaving comments and feedback. This involves the interaction of many tables: users, assignments, teams, reviews, and review_mappings. The &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; is the primary file which handles the code for reviews, but it also relies on &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; for additional methods. While &amp;lt;code&amp;gt;review_mapping_controller&amp;lt;/code&amp;gt; focuses mostly on CRUD operations for reviews, reviewers, and scores, &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; focuses moreso on which data are presented and how (colors, sorting, charts, etc). This project focuses on refactoring &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; and seeks to make the current code more understandable and transparent, such as by using partials, renaming methods with more standard conventions, adding additional comments, removing/modifying unnecessary methods, and making other methods more robust and useful. This project builds on the work done by E2125, which focused on simplifying some methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;.&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144015</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=144015"/>
		<updated>2022-04-04T23:18:13Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problem: The method get_data_for_review_report violates the Expert pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several methods are used for generating charts and should be moved to another file  ===&lt;br /&gt;
Including &amp;lt;code&amp;gt; initialize_chart_elements &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_volume_metric_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; display_tagging_interval_chart &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; calculate_key_chart_information &amp;lt;/code&amp;gt;.They are cohesive enough to just be moved to another file.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Move these methods to a new helper or mixin. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Investigate the use of &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; ===&lt;br /&gt;
It is not all clear that this method is needed, though it is used in one view. Needs clarification if this function is being used or not.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': See if there is a way to get rid of it or incorporate it into the main method. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=144013</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=144013"/>
		<updated>2022-04-04T22:58:12Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Final Projects */&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 - E2245: View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2201: Improving User Experience for SQLFE]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2236: Fix issues related to deadlines and late policies]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2244. Support for saying your team pair-programmed]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2246: Email your authors/reviewers, with complete tests]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2228: Refactor JavaScript]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb ]]&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143846</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143846"/>
		<updated>2022-03-30T23:12:30Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* GitHub links and Pull Request */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
GitHub link [https://github.com/andypip88/expertiza here]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143845</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143845"/>
		<updated>2022-03-30T23:06:24Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GitHub links and Pull Request==&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143844</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143844"/>
		<updated>2022-03-30T23:05:28Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143843</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143843"/>
		<updated>2022-03-30T23:05:20Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
&lt;br /&gt;
Evan Brown&lt;br /&gt;
Chaitanya Patel&lt;br /&gt;
Rachel Hyo Son&lt;br /&gt;
Andrew Pippin&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143842</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143842"/>
		<updated>2022-03-30T23:03:15Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143841</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143841"/>
		<updated>2022-03-30T23:02:56Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143840</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143840"/>
		<updated>2022-03-30T23:02:46Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
=== Problem: Several method names begin with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; ===&lt;br /&gt;
This naming convention is not Ruby-like, and needs to be changed&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': All method names beginning with &amp;lt;code&amp;gt;get&amp;lt;/code&amp;gt; will be refactored to use more appropriate names&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143839</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143839"/>
		<updated>2022-03-30T23:01:27Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143838</id>
		<title>CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2239:_Further_refactoring_and_improvement_of_review_mapping_helper.rb&amp;diff=143838"/>
		<updated>2022-03-30T23:00:01Z</updated>

		<summary type="html">&lt;p&gt;Webrown2: /* Problems and planned changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
This project builds on the work done by E2125, which focused on simplifying the methods in &amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt;. This project focuses on refactoring that seeks to make the current code more understandable and transparent.&lt;br /&gt;
&lt;br /&gt;
== Problems and planned changes ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_data_for_review_report violates the Expert pattern ===&lt;br /&gt;
&amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; passes back a data structure with multiple &amp;lt;code&amp;gt;response&amp;lt;/code&amp;gt; objects to the &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.&lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': &amp;lt;code&amp;gt;get_data_for_review_report&amp;lt;/code&amp;gt; will be refactored to use partials, which&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method get_awarded_review_score needs to be updated ===&lt;br /&gt;
&amp;lt;code&amp;gt; get_awarded_review_score &amp;lt;/code&amp;gt; computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Change the method to utilize the standard code from &amp;lt;code&amp;gt; response_map.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized ===&lt;br /&gt;
&amp;lt;code&amp;gt; sort_reviewer_by_review_volume_desc &amp;lt;/code&amp;gt; only sorts by review volume, which is very specific. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''': Modify the method to be able to sort by multiple different metrics such as number of suggestions, or number of suggestions + number of problems detected. This will also jusity a method name change (and possible parameter change/additions), which will have to be updated elsewhere in the app.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problem: The method feedback_response_maps violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; feedback_response_maps &amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, and make it clearer what they are doing &lt;br /&gt;
&lt;br /&gt;
=== Problem: three small classes violates the Expert pattern ===&lt;br /&gt;
It is not clear why &amp;lt;code&amp;gt; ReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; StudentReviewStrategy &amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TeamReviewStrategy&amp;lt;/code&amp;gt; are here. &lt;br /&gt;
&lt;br /&gt;
*''' Proposed Solution ''':&lt;br /&gt;
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes&lt;/div&gt;</summary>
		<author><name>Webrown2</name></author>
	</entry>
</feed>