Sha256: 57d1f787fc43b869a669104d10c1c42e5374545e7ad922fc701f850140cd8b00

Contents?: true

Size: 978 Bytes

Versions: 1

Compression:

Stored size: 978 Bytes

Contents

class Fe::ReferenceSheetsController < Fe::AnswerSheetsController
  skip_before_filter :ssm_login_required, :login
  before_filter :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 'answer_sheets/edit'
  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

1 entries across 1 versions & 1 rubygems

Version Path
fe-0.0.3 app/controllers/fe/reference_sheets_controller.rb