Class: Course::Assessment::SubmissionQuestion::SubmissionQuestionsController

Inherits:
Controller show all
Defined in:
app/controllers/course/assessment/submission_question/submission_questions_controller.rb

Instance Method Summary collapse

Methods included from ApplicationSignInCallbacksConcern

#sign_in

Methods included from ApplicationPaginationConcern

#page_param

Methods included from ApplicationAnnouncementsConcern

#global_announcements, #unread_global_announcements

Methods included from ApplicationInstanceUserConcern

#current_instance_user

Methods included from ApplicationUserTimeZoneConcern

#set_time_zone

Methods included from ApplicationUserConcern

#handle_access_denied, #publicly_accessible?

Methods included from ApplicationComponentsConcern

#handle_component_not_found

Instance Method Details

#past_answersObject

Gets the 10 most recent past answers of a specific question


5
6
7
8
9
10
11
12
# File 'app/controllers/course/assessment/submission_question/submission_questions_controller.rb', line 5

def past_answers
  answers_to_load = past_answers_params[:answers_to_load] || 10
  answers = @submission_question.past_answers(answers_to_load)

  respond_to do |format|
    format.json { render 'past_answers', locals: { answers: answers } }
  end
end