Sha256: d72ae002aad39751c92bb350107cf3e621f74e28a93d8dafefccb0518802b375

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 KB

Contents

# TODO determine how this relates to Fe::ReferencesController and if we can delete one of the two
class Fe::ReferenceSheetsController < Fe::AnswerSheetsController
  skip_before_action :ssm_login_required, :login, raise: false
  before_action :edit_only, except: [:edit]

  def edit
    @reference_sheet = @answer_sheet
    unless @answer_sheet
      render :not_found and return
    end
    @answer_sheet.start! if @answer_sheet.created?
    # Set up question_sheet if needed
    if @answer_sheet.question_sheets.empty?
      @answer_sheet.question_sheets << Fe::QuestionSheet.find(@answer_sheet.question.related_question_sheet)
    end
    @presenter = Fe::AnswerPagesPresenter.new(self, @answer_sheet, params[:a])
    @elements = @presenter.questions_for_page(:first).elements
    @page = @presenter.pages.first
    render 'fe/answer_sheets/edit', layout: 'fe/application'
  end

  protected
    def get_answer_sheet
      @answer_sheet ||= Fe::ReferenceSheet.find_by_id_and_access_key(params[:id], params[:a])
      return false unless @answer_sheet
    end

    def edit_only
      return false
    end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fe-2.1.5 app/controllers/fe/reference_sheets_controller.rb
fe-2.1.4 app/controllers/fe/reference_sheets_controller.rb
fe-2.1.3 app/controllers/fe/reference_sheets_controller.rb
fe-2.1.2 app/controllers/fe/reference_sheets_controller.rb
fe-2.1.1 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.8 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.6 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.5 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.4 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.3 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.2 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.1 app/controllers/fe/reference_sheets_controller.rb
fe-2.0.0 app/controllers/fe/reference_sheets_controller.rb