app/models/committees/committee_member.rb
def average_score(offering = nil, offering_review_criterion = nil)
    application_reviewers_set = offering.nil? ? application_reviewers : application_reviewers.for(offering)
    if offering_review_criterion.nil?
      scores = application_reviewers_set.collect{|r| (r.started_scoring? ? r.total_score.to_f : nil) rescue nil }.compact
    else
      scores = application_reviewers_set.collect{|r| (r.started_scoring? ? (r.get_score(offering_review_criterion).to_f rescue nil) : nil ) || nil }.compact
    end
    scores.sum/scores.size rescue 0.0
  end
# Computes the average score that this committee member has given to applications_for_review. An Offering can be specified to
# to limit the selection to only a specific Offering review process. If a review_criterion 
# is specified, then the average scores for only that criterion is computed.
Computes the average score that this committee member has given to applications_for_review. An Offering can be specified to
to limit the selection to only a specific Offering review process. If a review_criterion
is specified, then the average scores for only that criterion is computed.
Computes the average score that this committee member has given to applications_for_review . An Offering can be specified to to limit the selection to only a specific Offering review process . If a review_criterion is specified then the average scores for only that criterion is computed .
def average_score(offering = nil, offering_review_criterion = nil)
    application_reviewers_set = offering.nil? ? application_reviewers : application_reviewers.for(offering)
    if offering_review_criterion.nil?
      scores = application_reviewers_set.collect{|r| (r.started_scoring? ? r.total_score.to_f : nil) rescue nil }.compact
    else
      scores = application_reviewers_set.collect{|r| (r.started_scoring? ? (r.get_score(offering_review_criterion).to_f rescue nil) : nil ) || nil }.compact
    end
    scores.sum/scores.size rescue 0.0
  end
def average_score ( offering = nil , offering_review_criterion = nil ) application_reviewers_set = offering . nil? ? application_reviewers : application_reviewers . for ( offering ) if offering_review_criterion . nil? scores = application_reviewers_set . collect { | r | ( r . started_scoring? ? r . total_score . to_f : nil ) rescue nil } . compact else scores = application_reviewers_set . collect { | r | ( r . started_scoring? ? ( r . get_score ( offering_review_criterion ) . to_f rescue nil ) : nil ) || nil } . compact end scores . sum / scores . size rescue 0.0 end
Computes the average score that this committee member has given to applications_for_review.
Computes the average score that this committee member has given to applications_for_review .
offering
offering_review_criterion