Class: Moodle2CC::Moodle::Question
- Inherits:
-
Object
- Object
- Moodle2CC::Moodle::Question
- Includes:
- HappyMapper
- Defined in:
- lib/moodle2cc/moodle/question.rb
Defined Under Namespace
Classes: Answer, Calculation, Choice, Match, Numerical
Instance Attribute Summary collapse
-
#grade ⇒ Object
Returns the value of attribute grade.
-
#instance_id ⇒ Object
Returns the value of attribute instance_id.
-
#question_category ⇒ Object
Returns the value of attribute question_category.
Instance Method Summary collapse
Instance Attribute Details
#grade ⇒ Object
Returns the value of attribute grade.
5 6 7 |
# File 'lib/moodle2cc/moodle/question.rb', line 5 def grade @grade end |
#instance_id ⇒ Object
Returns the value of attribute instance_id.
5 6 7 |
# File 'lib/moodle2cc/moodle/question.rb', line 5 def instance_id @instance_id end |
#question_category ⇒ Object
Returns the value of attribute question_category.
5 6 7 |
# File 'lib/moodle2cc/moodle/question.rb', line 5 def question_category @question_category end |
Instance Method Details
#instance ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/moodle2cc/moodle/question.rb', line 90 def instance question_category.course.mods.select do |mod| mod.mod_type == 'quiz' end.map do |mod| mod.question_instances.find do |qi| qi.question_id == id end end.compact.first end |