Class: ProblemAI

Inherits:
Object
  • Object
show all
Defined in:
lib/asker/ai/problem/problem_ai.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#problemObject

Returns the value of attribute problem.



7
8
9
# File 'lib/asker/ai/problem/problem_ai.rb', line 7

def problem
  @problem
end

Instance Method Details

#call(problem) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/asker/ai/problem/problem_ai.rb', line 9

def call(problem)
  @problem = problem

  questions = StageAnswers.new(@problem).make_questions
  @problem.stats[:answer] = questions.size
  @problem.questions = questions

  questions = StageSteps.new(@problem).make_questions
  @problem.stats[:steps] = questions.size
  @problem.questions += questions

  @problem
end