Class: QuickExam::Analyst::BaseDocx

Inherits:
Object
  • Object
show all
Includes:
Common, Format
Defined in:
lib/quick_exam/analyst/base_docx.rb

Constant Summary

Constants included from Format

Format::ALLOWED_ELEMENTS, Format::CORRECT_MARK, Format::FOLDER_NAME_EXPORT, Format::QUESTION_MARK

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#answer, #answer?, #clean_object, #collect_object_ticket, #correct_answer?, #end_of_line?, #end_of_one_ticket_for_next_question?, #get_answer, #get_correct_indexes_answer, #get_question, #question, #question?, #regex_answer_mark, #regex_answer_sentence, #regex_question_mark, #reset_object_ticket, #rid_non_ascii!

Methods included from Format

#correct_mark, #question_mark

Constructor Details

#initialize(file_path, f_ques: '', f_corr: '') ⇒ BaseDocx

Returns a new instance of BaseDocx.

Raises:



13
14
15
16
17
18
19
# File 'lib/quick_exam/analyst/base_docx.rb', line 13

def initialize(file_path, f_ques:'' , f_corr:'')
  raise ErrorAnalyze.new('No such file') unless File.exist? file_path
  @file_path = file_path
  @f_ques = f_ques
  @f_corr = f_corr
  @records = QuickExam::RecordCollection.new()
end

Instance Attribute Details

#recordsObject (readonly)

Returns the value of attribute records.



11
12
13
# File 'lib/quick_exam/analyst/base_docx.rb', line 11

def records
  @records
end

#total_lineObject (readonly)

Returns the value of attribute total_line.



11
12
13
# File 'lib/quick_exam/analyst/base_docx.rb', line 11

def total_line
  @total_line
end

Instance Method Details

#analyzeObject



21
22
23
24
25
26
# File 'lib/quick_exam/analyst/base_docx.rb', line 21

def analyze
  data_standardize
  self
rescue => e
  raise ErrorAnalyze.new('Data can not analyze')
end