CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 21: Line 21:


*''' 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.
*''' 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.
=== Problem: The method feedback_response_maps violates the Expert pattern ===
It is not clear why <code> feedback_response_maps </code> are here.
*''' Proposed Solution ''':
Look up the expertiza wiki for the documentation, and make it clearer what they are doing
=== Problem: three small classes violates the Expert pattern ===
It is not clear why <code> ReviewStrategy </code>, <code> StudentReviewStrategy </code>, <code>TeamReviewStrategy</code> are here.
*''' Proposed Solution ''':
Look up the expertiza wiki for the documentation, add comments, and Refactor three classes

Revision as of 23:00, 30 March 2022

Background

This project builds on the work done by E2125, which focused on simplifying the methods in review_mapping_helper. This project focuses on refactoring that seeks to make the current code more understandable and transparent.

Problems and planned changes

Problem: The method get_data_for_review_report violates the Expert pattern

get_data_for_review_report passes back a data structure with multiple response objects to the _review_report.html.erb view. This violates the Expert pattern, because the given view does not know how to break apart the structure passed to it.

  • Proposed Solution : get_data_for_review_report will be refactored to use partials, which


Problem: The method get_awarded_review_score needs to be updated

get_awarded_review_score 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 response_map.rb .

  • Proposed Solution : Change the method to utilize the standard code from response_map.rb


Problem: The method sort_reviewer_by_review_volume_desc needs to be generalized

sort_reviewer_by_review_volume_desc only sorts by review volume, which is very specific.

  • 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.


Problem: The method feedback_response_maps violates the Expert pattern

It is not clear why feedback_response_maps are here.

  • Proposed Solution :

Look up the expertiza wiki for the documentation, and make it clearer what they are doing

Problem: three small classes violates the Expert pattern

It is not clear why ReviewStrategy , StudentReviewStrategy , TeamReviewStrategy are here.

  • Proposed Solution :

Look up the expertiza wiki for the documentation, add comments, and Refactor three classes