app/importers/file_importers/student_section_assignments_importer.rb
# Matches a row from a CSV export with an existing or new (unsaved) Insights record
# Returns nil if something about the CSV row is invalid and it can't process the row.
Matches a row from a CSV export with an existing or new (unsaved) Insights record
Returns nil if something about the CSV row is invalid and it can't process the row.
Matches a row from a CSV export with an existing or new ( unsaved ) Insights record Returns nil if something about the CSV row is invalid and it can ' t process the row .
def matching_insights_record_for_row(row)
    student_id = find_student_id(row)
    if student_id.nil?
      @invalid_student_count += 1
      return nil
    end
    course = find_course(row)
    if course.nil?
      @invalid_course_count +=1
      return nil
    end
    section = find_section(row, course)
    if section.nil?
      @invalid_section_count +=1
      return nil
    end
    StudentSectionAssignment.find_or_initialize_by({
      student_id: student_id,
      section: section
    })
  end
def matching_insights_record_for_row ( row ) student_id = find_student_id ( row ) if student_id . nil? @invalid_student_count += 1 return nil end course = find_course ( row ) if course . nil? @invalid_course_count += 1 return nil end section = find_section ( row , course ) if section . nil? @invalid_section_count += 1 return nil end StudentSectionAssignment . find_or_initialize_by ( { student_id : student_id , section : section } ) end
Matches a row from a CSV export with an existing or new (unsaved) Insights record
Returns nil if something about the CSV row is invalid and it can't process the row.
Matches a row from a CSV export with an existing or new ( unsaved ) Insights record Returns nil if something about the CSV row is invalid and it can ' t process the row .
row
<not_specific>