<commit_before>module FindDataForStudentProfile

  def mcas_math_result(student)
    student.student_assessments.latest_mcas_math
  end

  def mcas_ela_result(student)
    student.student_assessments.latest_mcas_ela
  end

  def mcas_math_results(student)
    student.student_assessments.ordered_mcas_math
  end

  def mcas_ela_results(student)
    student.student_assessments.ordered_mcas_ela
  end

  def star(student)
    student.student_assessments.ordered_star_math + student.student_assessments.ordered_star_reading
  end

  def star_reading_results(student)
    student.student_assessments.ordered_star_reading
  end

  def star_math_results(student)
    student.student_assessments.ordered_star_math
  end

  def dibels(student)
    student_assessments.dibels.find_by_student(student).order_or_missing<commit_msg>Guard against missing STAR student assessments more carefully<commit_after>module FindDataForStudentProfile

  def mcas_math_result(student)
    student.student_assessments.latest_mcas_math
  end

  def mcas_ela_result(student)
    student.student_assessments.latest_mcas_ela
  end

  def mcas_math_results(student)
    student.student_assessments.ordered_mcas_math
  end

  def mcas_ela_results(student)
    student.student_assessments.ordered_mcas_ela
  end

  def star(student)
    star_math = student.student_assessments.ordered_star_math
    star_reading = student.student_assessments.ordered_star_reading
    if !star_math.is_a?(MissingStudentAssessmentCollection) && \
       !star_reading.is_a?(MissingStudentAssessmentCollection)
      student.student_assessments.ordered_star_math + student.student_assessments.ordered_star_reading
    else
      star_math || star_reading || MissingStudentAssessmentCollection.new
    end
  end

  def star_reading_results(student)
    student.student_assessments.ordered_star_reading
  end

  def star_math_results(student)
    student.student_assessments.ordered_star_math
  end

  def dibels(student)
    student_assessments.dibels.find_by_student(student).order_or_missing
{'fraction_non_alphanumeric': 0.05193532582067614, 'fraction_numerical': 0.0, 'mean_word_length': 5.482539682539683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3944419', 'n_tokens_mistral': 673, 'n_tokens_neox': 644, 'n_words': 86}