Class: QuestionFather

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/question/questionFather/base.rb

Direct Known Subclasses

SimpleChoice, TrueOrFalse

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (QuestionFather) initialize(args)

Returns a new instance of QuestionFather



6
7
8
9
10
11
# File 'lib/question/questionFather/base.rb', line 6

def initialize(args)
	@text = args[:text]
	@right = args[:right]
	@distractor = args[:distractor]
	@dif = args[:dif]
end

Instance Attribute Details

- (Object) dif

Returns the value of attribute dif



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def dif
  @dif
end

- (Object) distractor

Returns the value of attribute distractor



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def distractor
  @distractor
end

- (Object) right

Returns the value of attribute right



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def right
  @right
end

- (Object) text

Returns the value of attribute text



4
5
6
# File 'lib/question/questionFather/base.rb', line 4

def text
  @text
end

Instance Method Details

- (Object) <=>(other)



12
13
14
# File 'lib/question/questionFather/base.rb', line 12

def <=>(other)
	self.dif <=> other.dif
end