Class: SimpleChoice

Inherits:
QuestionFather show all
Defined in:
lib/question/simpleChoice/base.rb

Instance Attribute Summary (collapse)

Attributes inherited from QuestionFather

#dif

Instance Method Summary (collapse)

Methods inherited from QuestionFather

#<=>

Constructor Details

- (SimpleChoice) initialize(args)

Returns a new instance of SimpleChoice



5
6
7
# File 'lib/question/simpleChoice/base.rb', line 5

def initialize(args)
    super
end

Instance Attribute Details

- (Object) distractor

Returns the value of attribute distractor



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

def distractor
  @distractor
end

- (Object) right

Returns the value of attribute right



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

def right
  @right
end

- (Object) text

Returns the value of attribute text



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

def text
  @text
end

Instance Method Details

- (Object) to_s



9
10
11
12
13
14
# File 'lib/question/simpleChoice/base.rb', line 9

def to_s
  options = @distractor + [@right]
  options = options.shuffle
  puts "- Elige la pregunta correcta de la siguiente pregunta #{@text} ?"
  options.each {|o|}
end