E1466, Refactor grades_controller

Project Description

Classes involved: grades_controller.rb

What it does:

This class lists the grades of all the participants for an assignments and also their reviews. Instructor can edit scores, calculate penalties and send emails for conflicts.

What needs to be done:

1. Modify calculate_all_penalties method which is too complex and long.

2. Put the get_body_text method in a mailer rather than in the grades_controller.

3. Refactor conflict_nofication method to conflict_email and make it delegated to the mailer.

4. Refactor view_my_scores method to grades_show and delete the unnecessary variables.

5. Try not to query for reviews and meta reviews in grades_show method.

What we have done:

1. Modify calculate_all_penalties method.

2. Refactor the conflict_notification method to conflict_email method.

3. Simplify sending email function and make it delegated to the mailer.

4. Send a conflict email to the reviewer automatically when instructor click the button “email reviewer”.

5. Remove get_body_text and send_grading_email method from grades_controller.

6. Refactor conflict_nofication method to conflict_email and make it delegated to the mailer.

7. Use Design Pattern Delegation in ConflictMailer.

8. Refactor view_my_scores method to grades_show method.

9. Search for the key reasons which lead to huge waiting time for getting score.

10. Refactor get_assessments_for method in response_map.rb and lead to more than 90% off the original view scores' running time.

11. Eliminate the search for reviews and meta reviews during the grades_show method.

12. Delete unnecessary instance Variables.

Extra Credits:

1. Refactor get_assessments_for method in response_map.rb and lead to more than 90% off the original view scores' running time.

2. Use Design Pattern Delegation in ConflictMailer.

3. Send a conflict email to the reviewer automatically when instructor click the button “email reviewer”.
This is way too many local variables to be passing to a partial. It should be 1 or _maybe_ 2.