app/models/activities/accountability_report.rb
# Same quarter, same course: If a student is enrolled in the same course for the same course_no (e.g., they are enrolled in both a
# lecture section and a quiz section for the same course), only the section with the larger number of credits are counted.
Same quarter, same course: If a student is enrolled in the same course for the same course_no , only the section with the larger number of credits are counted.
Same quarter same course : If a student is enrolled in the same course for the same course_no only the section with the larger number of credits are counted .
def check_same_course
      for activity in @activities
        source = source(activity)
        if source.is_a?(StudentRegistrationCourse)
          for other_activity in @activities.reject{|a| a == activity}
            other_source = source(other_activity)
            if type(other_activity) == StudentRegistrationCourse && source.crs_number == other_source.crs_number
              if activity[:number_of_hours] <= other_activity[:number_of_hours]
                remove_activity(activity)
                report = "[SameCourse]: DEL #{activity[:source]} "
                report << "(#{activity[:number_of_hours]} hours <= #{other_activity[:number_of_hours]} hours)"
                @reports << report
              end
            end
          end
        end
      end   
    end
def check_same_course for activity in @activities source = source ( activity ) if source . is_a? ( StudentRegistrationCourse ) for other_activity in @activities . reject { | a | a == activity } other_source = source ( other_activity ) if type ( other_activity ) == StudentRegistrationCourse && source . crs_number == other_source . crs_number if activity [ :number_of_hours ] <= other_activity [ :number_of_hours ] remove_activity ( activity ) report = "[SameCourse]: DEL #{activity[:source]} " report << "(#{activity[:number_of_hours]} hours <= #{other_activity[:number_of_hours]} hours)" @reports << report end end end end end end
Same quarter, same course: If a student is enrolled in the same course for the same course_no (e.g., they are enrolled in both a
lecture section and a quiz section for the same course), only the section with the larger number of credits are counted.
Same quarter same course : If a student is enrolled in the same course for the same course_no ( e . g . they are enrolled in both a lecture section and a quiz section for the same course ) only the section with the larger number of credits are counted .
# it's the same course number... now pick which one to delete