David Kimura PRO said over 3 years ago on Gathering Questionnaire Responses :
  I would start by having an attribute on the response that is tied to the user/student (user:belongs_to) and put a validation uniqueness scope on the response which scopes the user and questionnaire. This would limit the user for one response per questionnaire/exam. What other kind of functionality are you looking for?

A couple of thoughts, 

  • when displaying out the answers when gathering the response, you could shuffle the array of answers so they do not appear in the same order for everyone.
  • the creator of the exam could mark an answer as correct on each question. when a response is submitted, a background job can be queued up to grade the questionnaire response.
  • A grading table which has user:belongs_to, questionnaire:belongs_to, and response:belongs_to along with grade could be created as a result. This would increase the performance of the application as it doesn't have to do the grading calculations every time.