ljbha007
2015-09-17 21:56:49 +08:00
forms
====
id int (pk )
userId int (fk )
title varchar
description varchar
questions
=====
id int (pk )
form_id int (fk )
question varchar
answer_type enum (multi_choice, single_choice, text )
choices
=====
id int (pk )
question_id int (fk )
description varchar
text_answers
======
id int (pk )
session_id int
question_id int (fk )
content varchar
choice_answers
=======
id int (pk )
session_id int
question_id int (fk )
choice_id int
大概这个样子
根据问题表的 answer_type 判断时多选、单选还是 文字回答
1. 单选、多选都去 choices 表查选项 只是前端控件不一样
用户填完就插入到 choice_answers
2. 文字回答就直接插入到 text_answers 里
大概就是这样