<commit_before>require 'factory_girl'

FactoryGirl.define do
  factory :user do
    name "user"
    email "<EMAIL>"
    password "<PASSWORD>"
    password_confirmation "<PASSWORD>"
    after(:build) do |user|
      user.confirmed_at = Time.now.to_s[0..-7]
    end
  end

  factory :admin, parent: :user do
    name "admin"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 1
      #user.confirmed_at = Time.now.to_s[0..-7]
    end
  end

  factory :student, parent: :user do
    name "student"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 5
    end
  end


  factory :lecturer, parent: :user do
    name "lecturer"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 3
    end
  end


  factory :course do
    title "Programming"
    description "It's a programming course"
    start_at Time.now
    end_at 1.day.from_now
    after(:create) do |course, evaluator|
      if evaluator.creator
        course.creator = evaluator.creator
        user_course = course.user_courses.build()
        user_course.course = course
        user_course.user = evaluator.creator
        user_course.role = Role.find_by_name(:lecturer)
        user_course.save
      end
    end
  end

  factory :training, class: Assessment::Training do
    title "Danger Room"
    description "Fight sentinels."
    exp 200
    open_at Time.now
    bonus_cutoff_at Time.now

    after(:build) do |announcement, evaluator|
      announcement.course_id = evaluator.course.try(:id)
    end
  end

  factory :announcement do
    title "sample announcement"
    description "sample content"
    publish_at Time.now
    expiry_at 3.day.from_now
    after(:build) do |announcement, evaluator|
      announcement.course_id = evaluator.course.try(:id)
      announcement.creator_id = evaluator.creator.try(:id)
      announcement.expiry_at = evaluator.expiry_at if evaluator.expiry_at
    end
  end
<commit_msg>Refactor misnamed variable<commit_after>require 'factory_girl'

FactoryGirl.define do
  factory :user do
    name "user"
    email "<EMAIL>"
    password "<PASSWORD>"
    password_confirmation "<PASSWORD>"
    after(:build) do |user|
      user.confirmed_at = Time.now.to_s[0..-7]
    end
  end

  factory :admin, parent: :user do
    name "admin"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 1
      #user.confirmed_at = Time.now.to_s[0..-7]
    end
  end

  factory :student, parent: :user do
    name "student"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 5
    end
  end


  factory :lecturer, parent: :user do
    name "lecturer"
    email "<EMAIL>"
    after(:build) do |user|
      user.system_role_id = 3
    end
  end


  factory :course do
    title "Programming"
    description "It's a programming course"
    start_at Time.now
    end_at 1.day.from_now
    after(:create) do |course, evaluator|
      if evaluator.creator
        course.creator = evaluator.creator
        user_course = course.user_courses.build()
        user_course.course = course
        user_course.user = evaluator.creator
        user_course.role = Role.find_by_name(:lecturer)
        user_course.save
      end
    end
  end

  factory :training, class: Assessment::Training do
    title "Danger Room"
    description "Fight sentinels."
    exp 200
    open_at Time.now
    bonus_cutoff_at Time.now

    after(:build) do |training, evaluator|
      training.course_id = evaluator.course.try(:id)
    end
  end

  factory :announcement do
    title "sample announcement"
    description "sample content"
    publish_at Time.now
    expiry_at 3.day.from_now
    after(:build) do |announcement, evaluator|
      announcement.course_id = evaluator.course.try(:id)
      announcement.creator_id = evaluator.creator.try(:id)
      announcement.expiry_at = evaluator.expiry_at if evaluator.expiry_at
    end
  end

{'fraction_non_alphanumeric': 0.09665047302480184, 'fraction_numerical': 0.006136537969828688, 'mean_word_length': 2.7507190795781398, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '575652', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1288, 'n_words': 318}