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

David Kimura PRO said over 1 year 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.

asjer said over 1 year 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 over 1 year 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. 

Kam kara PRO said 17 days ago on Gathering Questionnaire Responses :
Hello   David Kimura I try to rebuild this project after I want to integrate on my Start up like Exercise feature.
why did you choose the json format for answer? when you created Responses Scaffold, Why important?
I think json is for answers coming from APIs

David Kimura PRO said 17 days ago on Gathering Questionnaire Responses :
  Kam kara  I chose json format since the structure and format of the responses are not a consistent structure. Basically, it makes it more simple to store the data. A questionnaire could have a few questions and then many answers or many questions and just a few answers each. If you were to create a table-based response, then you would need to almost mimic the structure of the questionnaire where you have a responses table which has many question_responses and the question responses has many answer_responses (since it could me multiple choice). Then you need to worry about the type of response for the answer where the some of them may be a boolean, string, or text and picking the correct type when storing the response. 

Luke Scott PRO said 9 days ago on Gathering Questionnaire Responses :
I've followed these videos to make a questionnaire system and now I want to be able to export the results as a csv.  I've watched the earlier video (EP 35), but can't get my head around how to go about this. What would be best?

Tom Murdoch PRO said 9 days ago on Gathering Questionnaire Responses :
Great tutorial   David Kimura  ..... is there a way to go back and edit questionnaire responses after a submission? Thanks in advance 

David Kimura PRO said 9 days ago on Gathering Questionnaire Responses :
  Luke Scott I would make a Ruby class which took in the results of a questionnaire and format it in a way that you're wanting the CSV to look. So, you'd basically make an array with the first item in the array being an array of all of the headers. Then you'd loop through each response and put their response in the appropriate position in the array. From there, you can generate the CSV response and send a file to the client.

David Kimura PRO said 9 days ago on Gathering Questionnaire Responses :
  Tom Murdoch  If a questionnaire has already received responses, then I would not recommend altering the questionnaire. I've seen this before and it caused so many problems where the first several responses has the old questionnaire in mind but no longer valid. While, as developers of the questionnaire feature, we would know how to navigate this "safely", but end users will always surprise you with what they'd do. The safest thing would be to recall a questionnaire and generate a copy of an existing one to then modify.

Tom Murdoch PRO said 9 days ago on Gathering Questionnaire Responses :
Hi David, thanks for the fast response! I do not wish to alter the questionnaire questions or associated answers. The questions/answers will never change in my particular case. I would however like the ability for the user to be able to edit their responses though. So they can go back and correct grammar and spelling if they need to in the future.   

Login to Comment