Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizKindly log in to use this feature. We’ll take you to the login page automatically.
LoginCourse Queries Competitions/Entrance Exams 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I am trying to model an exam object and wanted to your opinions.
In a exam, there are multiple types of question, like Multiple Choice (MC), Short Question (SQ), True or False (TF), etc..
Each types of question has its own data, for example: (MC) would need question, potential answers, correct answer and (SQ) would only need a question.
Originally, I was thinking to just have an Exam model and a Question model (with single table inheritance) for the different type of question. However, since different types of question behaves differently and have different data attributes, I don't think that's going to work.
What I am thinking now is to have a Exam object which has_many "ExamQuestion" object which has attributes (exam_id, question_type, question_id).
I think this is going to work, but kinda don't like the fact that I have to have a column like 'question_type' in the "cross section" table like "ExamQuestion". ex. the query might become ugly.
Does anyone see a better way of doing this?
Thanks!