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

#initialize(args) ⇒ SimpleChoice

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

#distractorObject

Returns the value of attribute distractor.



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

def distractor
  @distractor
end

#rightObject

Returns the value of attribute right.



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

def right
  @right
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_sObject



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