Class: Moodle2CC::Moodle2::Models::Quizzes::QuestionCategory

Inherits:
Object
  • Object
show all
Defined in:
lib/moodle2cc/moodle2/models/quizzes/question_category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQuestionCategory

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_idObject

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_idObject

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_levelObject

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

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4

def id
  @id
end

#infoObject

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_formatObject

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

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4

def name
  @name
end

#parentObject

Returns the value of attribute parent.



4
5
6
# File 'lib/moodle2cc/moodle2/models/quizzes/question_category.rb', line 4

def parent
  @parent
end

#questionsObject

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_orderObject

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

#stampObject

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 resolve_embedded_question_references(question_categories)
  @questions.select{|q| q.is_a?(MultianswerQuestion)}.each do |q|
    q.resolve_embedded_question_references(question_categories)
  end
end