I'm a bit confused about how I need to store the answers to a multiple question type of exercise coming from an app I'm trying to create.
I have 2 tables pertaining to this:
"Question" and "Answer"
In Question, I have the following general structure:
• id BIGINT(20) NOT_NULL AUTO_INC
• q_question TEXT NOT_NULL
In Answer, I have the following general structure:
• id (QUESTION ID) BIGINT(20) NOT_NULL
• a_mc_answer TEXT NULL
I'm unsure about how to store the wrong answers of the multiple choices in the answers table.
Here's the thing: the user will have the ability to create any number of possible answers to each question they decide to submit. Each question can have any number of possible answers due to its multiple choice nature. Because of this, I'll need a JavaScript-powered form that can populate the page with text inputs the user designates. Each input will correspond to a given answer and with each text input, there will be a respective check box beside it to tick and this will indicate which answer is the correct answer.
How should I store the incorrect answers, though? I thought that using some sort of string separator, but I'm not sure this would be a good idea...
Advice?







I honestly have no idea what data type to use half the time because it seems so up in the air. It's like with text or varchar... Int vs. tinyint or whatever... There's so many types to select from that half the time I find myself wasting time just trying to decide between them.


Bookmarks