Class: StageT

Inherits:
BaseStage show all
Defined in:
lib/asker/ai/stages/stage_t.rb

Overview

StageT create questions based con Table data range t1-t9

Instance Method Summary collapse

Methods inherited from BaseStage

#concept, #images, #initialize, #lang, #name, #names, #neighbors, #num, #random_image_for, #texts, #type

Constructor Details

This class inherits a constructor from BaseStage

Instance Method Details

#run(table, row, list) ⇒ Object

process_tableXfields



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/asker/ai/stages/stage_t.rb', line 10

def run(table, row, list)
  questions = []
  return questions unless concept.type == "text"

  if table.fields.count == 2
    questions += process_table2fields(table, row, list, 0, 1)
  elsif table.fields.count == 3
    questions += process_table2fields(table, row, list, 0, 1)
    questions += process_table2fields(table, row, list, 0, 2)
  elsif table.fields.count == 4
    questions += process_table2fields(table, row, list, 0, 1)
    questions += process_table2fields(table, row, list, 0, 2)
    questions += process_table2fields(table, row, list, 0, 3)
  end

  questions
end