Class: Moodle2CC::Moodle2::Models::Quizzes::QuestionCategory
- Inherits:
-
Object
- Object
- Moodle2CC::Moodle2::Models::Quizzes::QuestionCategory
- Defined in:
- lib/moodle2cc/moodle2/models/quizzes/question_category.rb
Instance Attribute Summary collapse
-
#context_id ⇒ Object
Returns the value of attribute context_id.
-
#context_instance_id ⇒ Object
Returns the value of attribute context_instance_id.
-
#context_level ⇒ Object
Returns the value of attribute context_level.
-
#id ⇒ Object
Returns the value of attribute id.
-
#info ⇒ Object
Returns the value of attribute info.
-
#info_format ⇒ Object
Returns the value of attribute info_format.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#questions ⇒ Object
Returns the value of attribute questions.
-
#sort_order ⇒ Object
Returns the value of attribute sort_order.
-
#stamp ⇒ Object
Returns the value of attribute stamp.
Instance Method Summary collapse
-
#initialize ⇒ QuestionCategory
constructor
A new instance of QuestionCategory.
- #resolve_embedded_question_references(question_categories) ⇒ Object
Constructor Details
#initialize ⇒ QuestionCategory
Returns a new instance of QuestionCategory.
8 9 10 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 8 def initialize @questions = [] end |
Instance Attribute Details
#context_id ⇒ Object
Returns the value of attribute context_id.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def context_id @context_id end |
#context_instance_id ⇒ Object
Returns the value of attribute context_instance_id.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def context_instance_id @context_instance_id end |
#context_level ⇒ Object
Returns the value of attribute context_level.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def context_level @context_level end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def id @id end |
#info ⇒ Object
Returns the value of attribute info.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def info @info end |
#info_format ⇒ Object
Returns the value of attribute info_format.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def info_format @info_format end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def parent @parent end |
#questions ⇒ Object
Returns the value of attribute questions.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def questions @questions end |
#sort_order ⇒ Object
Returns the value of attribute sort_order.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def sort_order @sort_order end |
#stamp ⇒ Object
Returns the value of attribute stamp.
4 5 6 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4 def stamp @stamp end |
Instance Method Details
#resolve_embedded_question_references(question_categories) ⇒ Object
12 13 14 15 16 |
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 12 def (question_categories) @questions.select{|q| q.is_a?(MultianswerQuestion)}.each do |q| q.(question_categories) end end |