Class: Training

Inherits:
Object
  • Object
show all
Defined in:
lib/ruql/open_assessment/training.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Training

Initializes a training response



7
8
9
# File 'lib/ruql/open_assessment/training.rb', line 7

def initialize(options={})
  @training_criterions = []
end

Instance Attribute Details

#training_answerObject

Returns the value of attribute training_answer.



3
4
5
# File 'lib/ruql/open_assessment/training.rb', line 3

def training_answer
  @training_answer
end

#training_criterionsObject

Returns the value of attribute training_criterions.



3
4
5
# File 'lib/ruql/open_assessment/training.rb', line 3

def training_criterions
  @training_criterions
end

Instance Method Details

#answer(s) ⇒ Object

Sets the answer for the training response



13
# File 'lib/ruql/open_assessment/training.rb', line 13

def answer(s) ; @training_answer = s ; end

#training_criterion(*args) ⇒ Object

Adds a training criterion and evaluates to proc block



17
18
19
20
# File 'lib/ruql/open_assessment/training.rb', line 17

def training_criterion(*args)
  training = TrainingCriterion.new(*args)
  @training_criterions << training
end