Scoring & Grading Methods (Fall '21)

From Expertiza_Wiki
Jump to navigation Jump to search

Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.


Key Files

assignment_helper.rb

Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using self).

The following methods in assignment_helper are part of the Scoring and Grading refactor:

  • compute_total_score(scores): When called with assignment.compute_total_score(scores) (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.
  • compute_reviews_hash: When called with @assignment.compute_reviews_hash (such as in report_formatter_helper.rb), it will itself call the private methods scores_varying_rubrics or scores_non_varying_rubrics based on the @assignment.vary_by_round value. When calling these private methods, it passes an empty review_scores hash and the response_maps of the assignment. The chosen private method then iterates through each of the response_maps for the assignment and returns the filled review_scores hash in the format {response_map.reviewer_id: respective_scores}. This respective_scores value is calculated through calc_review_score - another private method in assignment_helper.rb.
  • compute_avg_and_ranges_hash: When called with @assignment.compute_avg_and_ranges_hash (such as in report_formatter_helper.rb), it will find the contributors (assignment_teams) for the assignment, and then find two variables for each team - questions and assessments. The first, questions, are the peer review questions for that team. The second, assessments are the team's owned assessments in ReviewResponseMap. Then Response.compute_scores(assessments, questions) is called to calculate scores. Finally, a hash of {contributor.id: <computed scores>} is returned.

These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.

Significant Pull Requests

These are the pull requests responsible for the refactor: