Although we originally designed quizzes such that user scores were stored in aggregate by number wrong and right answers, a business need now exists for us to identify which questions users get wrong so that we can look to improve the curriculum.
Proposed Solution:
- Rename
toynet_quiz_scores to toynet_submissions
- Create a new table called
toynet_submission_results which has:
- a primary key of (
quiz_id, submission_id, question_id)
- another field called
answer which holds the student's answer (one of the 4 multiple choice options)
- a foreign key to the primary key of
toynet_submissions (submission_id)
- a foreign key to the primary key of
toynet_quiz_options (quiz_id, question_id, option_id) where answer is mapped to option_id
- Alter toynet_quiz_score to make it possible to send an array of
answers, and write toynet_submission_results if array is populated with data. If array is empty, do not write to toynet_submission_results.
- Add thorough unit tests
- Create an issue in toynet-react to start using this data.
Please Note:
that quiz_id is redundant here from a pure data perspective as it can be deduced from submission_id, but it makes the toynet_quizzes table a lot more queryable for very little extra information (we can find all answers to a particular question without joins. This decision is negotiable.
Design doc: https://docs.google.com/document/d/14I8HlklMHjxC23IoFRS9nPnzXAslZbdGzGU3mN_qsW0/edit#heading=h.vtrimkf7p9v8
Although we originally designed quizzes such that user scores were stored in aggregate by number wrong and right answers, a business need now exists for us to identify which questions users get wrong so that we can look to improve the curriculum.
Proposed Solution:
toynet_quiz_scorestotoynet_submissionstoynet_submission_resultswhich has:quiz_id,submission_id,question_id)answerwhich holds the student's answer (one of the 4 multiple choice options)toynet_submissions(submission_id)toynet_quiz_options(quiz_id,question_id,option_id) whereansweris mapped tooption_idanswers, and writetoynet_submission_resultsif array is populated with data. If array is empty, do not write totoynet_submission_results.Please Note:
that
quiz_idis redundant here from a pure data perspective as it can be deduced fromsubmission_id, but it makes thetoynet_quizzestable a lot more queryable for very little extra information (we can find all answers to a particular question without joins. This decision is negotiable.Design doc: https://docs.google.com/document/d/14I8HlklMHjxC23IoFRS9nPnzXAslZbdGzGU3mN_qsW0/edit#heading=h.vtrimkf7p9v8