Episodes
asjer said 12 months ago on Gathering Questionnaire Responses :
How would you go about turning this into something like an exam?

David Kimura PRO said 12 months ago on Gathering Questionnaire Responses :
  asjer 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.

asjer said 12 months ago on Gathering Questionnaire Responses :
Ah great thanks, sounds about right for what I need! 👌🏼

Only thing I'd want to add would be different questions weights, but would only require an extra column to the questions table.

David Kimura PRO said 12 months ago on Gathering Questionnaire Responses :
Just some thoughts on weights... For the weights, I would recommend not trying to match 100%. It's not too difficult, but it's really annoying. So much front end validation to do and requiring the user to do some math to match up values to 100%. Instead, if you have 10 questions and you give them a weight of 50 each, then each question would be 10% of the total score. This will be much easier logic to handle. You could use a stimulus controller to add up each of the weight inputs and show a percentage value as you setup the questionnaire. 

Login to Comment