search

Home  >  Q&A  >  body text

php - If you build an online examination system, how should you store indefinite multiple-choice questions?

I am currently working on an online examination system. The test questions are very open. Multiple-choice questions not only have options, but also open options

For example, in a question, ABCDE option E is, do you have any other good ideas for options like ________, and this option is also indefinite. Is there any suitable storage method? I plan to use json to store it.

phpcn_u1582phpcn_u15822751 days ago1065

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-17 09:57:53

    The key fields are as follows:

    Field name Field type Instructions
    id integer Question id
    question varchar(100) Title
    answer_options text Answer configuration items, such as single choice, multiple choice, what are the options, or fill in the blanks
    answers text Correct answer

    Just use json to store it. This is how I made an exam system before

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-17 09:57:53

    You can also just split it with commas and save it

    reply
    0
  • 为情所困

    为情所困2017-05-17 09:57:53

    json structure storage [{"question_id":"1","answer":"A,B,C"},{"question_id":"2","answer":"B,C,D"}]

    reply
    0
  • 黄舟

    黄舟2017-05-17 09:57:53

    It feels easy to just divide it up

    reply
    0
  • Cancelreply