app/models/activities/accountability_report.rb
# Same quarter, multiple activities: Students who have multiple activities for the same quarter will only count the larger of 
# the number of hours. Note that for this rule, activities are not actually removed from the data hash; instead, they are
# marked with a "duplicate" flag so they are not double counted in the final statistics but can still be counted separately
# for different department counts.
Same quarter, multiple activities: Students who have multiple activities for the same quarter will only count the larger of
the number of hours. Note that for this rule, activities are not actually removed from the data hash; instead, they are
marked with a "duplicate" flag so they are not double counted in the final statistics but can still be counted separately
for different department counts.
Same quarter multiple activities : Students who have multiple activities for the same quarter will only count the larger of the number of hours . Note that for this rule activities are not actually removed from the data hash ; instead they are marked with a " duplicate " flag so they are not double counted in the final statistics but can still be counted separately for different department counts .
def check_multiple_activities
      if @activities.size > 1
        sorted = @activities.sort_by{|a| a[:number_of_hours].to_f}.reverse
        max_hours = sorted.first[:number_of_hours]
        for activity in sorted[1..sorted.size]
          remove_activity(activity, false)
          report = "[MultipleActivities]: DUP #{activity[:source]} "
          report << "(#{activity[:number_of_hours]} hours <= #{max_hours} hours)"
          @reports << report
        end
      end
    end
def check_multiple_activities if @activities . size > 1 sorted = @activities . sort_by { | a | a [ :number_of_hours ] . to_f } . reverse max_hours = sorted . first [ :number_of_hours ] for activity in sorted [ 1 .. sorted . size ] remove_activity ( activity , false ) report = "[MultipleActivities]: DUP #{activity[:source]} " report << "(#{activity[:number_of_hours]} hours <= #{max_hours} hours)" @reports << report end end end
Same quarter, multiple activities: Students who have multiple activities for the same quarter will only count the larger of
the number of hours.
Same quarter multiple activities : Students who have multiple activities for the same quarter will only count the larger of the number of hours .
# puts sorted.collect{|a| a[:number_of_hours]}.join(" > ")