class Ta

Constants

CSV_UPLOAD_ORDER
SESSION_TIMEOUT

Public Instance Methods

get_criterion_associations_by_assignment(assignment) click to toggle source
# File app/models/ta.rb, line 26
def get_criterion_associations_by_assignment(assignment)
  if assignment.assign_graders_to_criteria
    criterion_ta_associations.map do |association|
      if association.assignment == assignment
        association
      else
        nil
      end
    end.compact
  else
    []
  end
end
get_criterion_associations_count_by_assignment(assignment) click to toggle source
# File app/models/ta.rb, line 40
def get_criterion_associations_count_by_assignment(assignment)
  assignment.criterion_ta_associations.count(
    :conditions => "ta_id = #{self.id}")
end
get_groupings_by_assignment(assignment) click to toggle source
# File app/models/ta.rb, line 52
def get_groupings_by_assignment(assignment)
  groupings.all(:conditions => {:assignment_id => assignment.id},
    :include => [:students, :tas, :group, :assignment])
end
get_membership_count_by_assignment(assignment) click to toggle source
# File app/models/ta.rb, line 45
def get_membership_count_by_assignment(assignment)
  memberships.count(:include => :grouping,
                    :conditions => {
                        :groupings => { :assignment_id => assignment.id }
                    })
end
get_membership_count_by_grade_entry_form(grade_entry_form) click to toggle source
# File app/models/ta.rb, line 57
def get_membership_count_by_grade_entry_form(grade_entry_form)
  return grade_entry_students.count(:include => :grade_entry_form,
    :conditions => "grade_entry_form_id = #{grade_entry_form.id}")
end
is_assigned_to_grouping?(grouping_id) click to toggle source
# File app/models/ta.rb, line 21
def is_assigned_to_grouping?(grouping_id)
  grouping = Grouping.find(grouping_id)
  grouping.ta_memberships.find_all_by_user_id(id).size > 0
end
memberships_for_assignment(assignment) click to toggle source
# File app/models/ta.rb, line 17
def memberships_for_assignment(assignment)
  assignment.ta_memberships.find_all_by_user_id(id, :include => {:grouping => :group})
end