<commit_before>class StudentsInGroup < ActiveRecord::Base
  attr_accessible :study_group_id, :student_id, :scholarship, :hostel, :subgroup
  
  belongs_to :study_group
  belongs_to :student
  
  validates :study_group, :student, :presence => true
  validates :subgroup, :numericality => { :only_integer => true }
  validates :scholarship, :hostel, :inclusion => { :in => [true, false] }
  validates_uniqueness_of :student_id, :scope => [:study_group_id]

  default_scope joins(:student).order('people.last_name ASC, subgroup ASC')
  
  def full_name
    self.student.full_name
  end

  def study_info(subject)
    subject_marks = {}
    (1..NUMBER_OF_MODULES).to_a.each do |study_module|
      presence_mark = Presence.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      lesson_mark = LessonMark.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      additional_mark = AdditionalMark.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      subject_marks.merge!({
          study_module => {
              :presence_mark => presence_mark,
              :lesson_mark => lesson_mark,
              :additional_mark => additional_mark
          }
        }
      )
    end
    subject_marks
  end
end<commit_msg>Deleted order by lat name in student in group query clause.<commit_after>class StudentsInGroup < ActiveRecord::Base
  attr_accessible :study_group_id, :student_id, :scholarship, :hostel, :subgroup
  
  belongs_to :study_group
  belongs_to :student
  
  validates :study_group, :student, :presence => true
  validates :subgroup, :numericality => { :only_integer => true }
  validates :scholarship, :hostel, :inclusion => { :in => [true, false] }
  validates_uniqueness_of :student_id, :scope => [:study_group_id]

  default_scope order('subgroup ASC')
  
  def full_name
    self.student.full_name
  end

  def study_info(subject)
    subject_marks = {}
    (1..NUMBER_OF_MODULES).to_a.each do |study_module|
      presence_mark = Presence.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      lesson_mark = LessonMark.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      additional_mark = AdditionalMark.get_score(subject.id, self.study_group_id, self.student_id, study_module)
      subject_marks.merge!({
          study_module => {
              :presence_mark => presence_mark,
              :lesson_mark => lesson_mark,
              :additional_mark => additional_mark
          }
        }
      )
    end
    subject_marks
  end
end
{'fraction_non_alphanumeric': 0.10124127230411172, 'fraction_numerical': 0.0007757951900698216, 'mean_word_length': 3.621863799283154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '643993', 'n_tokens_mistral': 860, 'n_tokens_neox': 841, 'n_words': 159}