DB设计帮助 - EAV +表单构建器 [英] DB design help - EAV + Form builder

查看:260
本文介绍了DB设计帮助 - EAV +表单构建器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一种表单生成器,它将允许我以灵活的方式定义,显示和存储'tests'。也就是说允许用户通过Web界面创建一种新类型的测试/表单(分组),并定义一组将显示在表单上的字段(任何类型的字段,包括日期,文本,收音机,复选框,等)。我还需要一个结果表来存储保存在每个表单/测试中的值。

I'm trying to build a sort of form builder that'll allow me to define, display and store 'tests' in a flexible way. I.e. Allow the user, through the web interface, to create a new type of test/form ("Grouping") and define a set of fields that will be displayed on the form (any type of field, including date, text, radio, checkbox, etc). I'll also need a results table that'll store the values saved in each form/test.

作为一个不足的例子,我有以下3个表:

As an inadequate example, I have the following 3 tables so far:

dd_TestGrouping
- TestGroupingID [pk]  
- TestGroupingName  "Algebra-1"
- TestGroupingTypeID "Math"

dd_TestFields
- TestFieldID [pk]
- TestGroupingID [fk]
- TestFieldName "Circumference"
- TestFieldType "TextBox"
- Sequence

TestResults
- TestResultID [pk]
- TestFieldID [fk]
- value "50"
- Unit "CM"

上述问题 - 如果没有其他 - 我不知道如何动态显示下拉列表和链接的无线电/复选框。此外,如何处理验证?

The problem with the above - if nothing else - I'm not sure how to dynamically display dropdown lists and linked radio/checkboxes. Also, how can I handle validation?

先感谢任何帮助/指针。

Thanks in advance for any help/pointers.

推荐答案

听起来像是使用 EAV模型

这篇关于DB设计帮助 - EAV +表单构建器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆