<commit_before>class Exam < ActiveRecord::Base
	LEVELS = [ '1', '2', '3']

	validates :title, presence: true
	validates :level, presence: true, inclusion: LEVELS

	has_many :questions

	def self.levels
		LEVELS
	end
end<commit_msg>Added method video_id to model exam<commit_after>class Exam < ActiveRecord::Base
	YOUTUBE_SORT = 'youtu.be'
	YOUTUBE_LONG = 'youtube.com'
	LEVELS = [ '1', '2', '3']

	validates :title, presence: true
	validates :level, presence: true, inclusion: LEVELS

	has_many :questions

	def self.levels
		LEVELS
	end

	def video_id
		result = ''
		result = video.match(/(?:^.*\/)([^#?]*)/)[1] if video.include? YOUTUBE_SORT
		result = video.match(/(?:^.*\=)(.*)/)[1] if video.include? YOUTUBE_LONG
		result
	end
end
{'fraction_non_alphanumeric': 0.15625, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 4.419117647058823, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2311533', 'n_tokens_mistral': 298, 'n_tokens_neox': 280, 'n_words': 71}