Class: Moodle2CC::Moodle::Mod::QuestionInstance

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/moodle2cc/moodle/mod.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modObject

Returns the value of attribute mod.



10
11
12
# File 'lib/moodle2cc/moodle/mod.rb', line 10

def mod
  @mod
end

Instance Method Details

#questionObject



17
18
19
20
21
# File 'lib/moodle2cc/moodle/mod.rb', line 17

def question
  @question ||= mod.course.question_categories.map do |qc|
    qc.questions.find { |q| q.id == question_id }
  end.compact.first
end