class Senkyoshi::Answer

Attributes

answer_text[R]
feedback[RW]
fraction[RW]
id[R]
resp_ident[RW]

Public Class Methods

new(text, id = Senkyoshi.create_random_hex) click to toggle source
# File lib/senkyoshi/models/answer.rb, line 23
def initialize(text, id = Senkyoshi.create_random_hex)
  @answer_text = text
  @resp_ident = ""
  @fraction = ""
  @feedback = ""
  @points = 0
  @id = id
end

Public Instance Methods

canvas_conversion(question, resources) click to toggle source
# File lib/senkyoshi/models/answer.rb, line 36
def canvas_conversion(question, resources)
  answer = CanvasCc::CanvasCC::Models::Answer.new(@answer_text)
  answer.answer_text = fix_html(@answer_text, resources)
  answer.id = @id
  answer.fraction = @fraction
  answer.feedback = @feedback
  answer.resp_ident = @resp_ident
  question.answers << answer
  question
end
iterate_xml() click to toggle source
# File lib/senkyoshi/models/answer.rb, line 32
def iterate_xml
  self
end