Skip to content

Store quiz scores by question #44

@takakonishimura

Description

@takakonishimura

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:

  1. Rename toynet_quiz_scores to toynet_submissions
  2. 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
  1. 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.
  2. Add thorough unit tests
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions