You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
407 B

class QuestionsController < ApplicationController
include QuizHelperMethods
def show
not_found unless question
@answer = Answer.new(player_id: current_player.id, node_id: question.id)
end
def answer
@answer = Answer.find_by(node_id: question.id, player_id: current_player.id)
@question_answer = question.attachments.with_text.each_slice(2).to_a[@answer.value]
end
end