<commit_before>class CcaQuestion < ActiveRecord::Base
  belongs_to :cca
  has_many :cca_answers, :conditions => 'default_answer=0 OR default_answer is null'
  has_many :default_cca_answers, :class_name=>"CcaAnswer", :conditions => 'default_answer=1', :foreign_key => "cca_question_id"
  validates_presence_of   :cca_id, :question, :question_type, :position
  
  default_scope :order => "position asc"
  
  def self.QUESTION_TYPES
    ["text_small","text_big","radio","checkbox"]
  end
  
  def self.QUESTION_TYPE_DESCRIPTIONS
    "A single line textbox (short answer),A multi line textbox (longer answer),A radio button set (user selects an answer),A checkbox button set (user selects multiple answers)"
  end
  
  def answer_by_user(user, default_answer)
    default_answer ? CcaAnswer.find_by_cca_question_id_and_default_answer(self,default_answer) : CcaAnswer.find_by_cca_question_id_and_user_id(self,user,default_answer)
  end
end<commit_msg>fixing the missing remembering of the answers<commit_after>class CcaQuestion < ActiveRecord::Base
  belongs_to :cca
  has_many :cca_answers, :conditions => 'default_answer=0 OR default_answer is null'
  has_many :default_cca_answers, :class_name=>"CcaAnswer", :conditions => 'default_answer=1', :foreign_key => "cca_question_id"
  validates_presence_of   :cca_id, :question, :question_type, :position
  
  default_scope :order => "position asc"
  
  def self.QUESTION_TYPES
    ["text_small","text_big","radio","checkbox"]
  end
  
  def self.QUESTION_TYPE_DESCRIPTIONS
    "A single line textbox (short answer),A multi line textbox (longer answer),A radio button set (user selects an answer),A checkbox button set (user selects multiple answers)"
  end
  
  def answer_by_user(user, default_answer)
    default_answer ? CcaAnswer.find_by_cca_question_id_and_default_answer(self,default_answer) : CcaAnswer.find_by_cca_question_id_and_user_id(self,user.id)
  end
end
{'fraction_non_alphanumeric': 0.09309623430962342, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 6.301526717557252, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3484655', 'n_tokens_mistral': 644, 'n_tokens_neox': 625, 'n_words': 143}