class Moodle2CC::Moodle2::Models::Quizzes::Question
Constants
- STANDARD_TYPES
Attributes
answers[RW]
default_mark[RW]
general_feedback[RW]
id[RW]
length[RW]
max_mark[RW]
name[RW]
parent[RW]
penalty[RW]
qtype[RW]
question_text[RW]
question_text_format[RW]
stamp[RW]
type[RW]
version[RW]
Public Class Methods
create(type)
click to toggle source
# File lib/moodle2cc/moodle2/models/quizzes/question.rb, line 8 def self.create(type) if c = @@subclasses[type] q = c.new q.type = type q elsif STANDARD_TYPES.include?(type) q = self.new q.type = type q else raise "Unknown question type: #{type}" end end
new()
click to toggle source
# File lib/moodle2cc/moodle2/models/quizzes/question.rb, line 29 def initialize @answers = [] end
register_question_type(name)
click to toggle source
# File lib/moodle2cc/moodle2/models/quizzes/question.rb, line 22 def self.register_question_type(name) @@subclasses[name] = self end