app/models/activities/accountability_report.rb
# Stores the following values for a specific activity into the results hash.
# 
# :activity::         The activity that resulted in this record being added to the hash. This is often an Activity or related record
#                     (like an ActivityCourse), but could be a ServiceLearningPlacement or other EXPO object.
# :source::           This is the actual object that was used to calculate the number of hours. For example, if the :activity is an
#                     ActivityCourse, this :source might be an individual StudentRegistrationCourse object. This is done because a
#                     student may have taken the course for variable credit and so we cannot rely on the number of credits from the
#                     course itself. For activity objects outside the Activity space, like an Offering, this might be a specific item
#                     like an ApplicationForOffering. In some cases, :activity and :source could be the same.
# :number_of_hours::  The number of hours calculated for this activity, calculated using the #number_of_hours method.
# 
# The format of the results hash is:
#     Student_system_key => {
#           quarter_abbrev => [ :activity => "ModelName_id",
#                               :source => "ModelName_id",
#                               :number_of_hours => 140.0,
#                             ]
#           }
Stores the following values for a specific activity into the results hash.
:activity::         The activity that resulted in this record being added to the hash. This is often an Activity or related record
(like an ActivityCourse), but could be a ServiceLearningPlacement or other EXPO object.
:source::           This is the actual object that was used to calculate the number of hours. For example, if the :activity is an
ActivityCourse, this :source might be an individual StudentRegistrationCourse object. This is done because a
student may have taken the course for variable credit and so we cannot rely on the number of credits from the
course itself. For activity objects outside the Activity space, like an Offering, this might be a specific item
like an ApplicationForOffering. In some cases, :activity and :source could be the same.
:number_of_hours::  The number of hours calculated for this activity, calculated using the #number_of_hours method.


Stores the following values for a specific activity into the results hash . : activity :: The activity that resulted in this record being added to the hash . This is often an Activity or related record ( like an ActivityCourse ) but could be a ServiceLearningPlacement or other EXPO object . : source :: This is the actual object that was used to calculate the number of hours . For example if the : activity is an ActivityCourse this : source might be an individual StudentRegistrationCourse object . This is done because a student may have taken the course for variable credit and so we cannot rely on the number of credits from the course itself . For activity objects outside the Activity space like an Offering this might be a specific item like an ApplicationForOffering . In some cases : activity and : source could be the same . : number_of_hours :: The number of hours calculated for this activity calculated using the #number_of_hours method .
def add_result(system_key, quarter, activity, source)
    @results[system_key] = {} if @results[system_key].nil?
    h = @results[system_key]
    h[quarter.abbrev] = h[quarter.abbrev] || []
    data = {
      :activity =>        "#{activity.class.to_s}_#{activity.id}",
      :source =>          "#{source.class.to_s}_#{source.id}",
      :number_of_hours => Activity.number_of_hours(source)
    }
    h[quarter.abbrev] << data
    @results
  end
def add_result ( system_key , quarter , activity , source ) @results [ system_key ] = { } if @results [ system_key ] . nil? h = @results [ system_key ] h [ quarter . abbrev ] = h [ quarter . abbrev ] || [ ] data = { :activity => "#{activity.class.to_s}_#{activity.id}" , :source => "#{source.class.to_s}_#{source.id}" , :number_of_hours => Activity . number_of_hours ( source ) } h [ quarter . abbrev ] << data @results end
Stores the following values for a specific activity into the results hash.
Stores the following values for a specific activity into the results hash .
system_key
quarter
activity
source