Actions

Database Storage Engine Project M1 Database Design: Difference between revisions

From LimeSurvey Manual

No edit summary
No edit summary
Line 34: Line 34:
These are database mockups of the question types presented [[Question types in version 1.90|here]]. Since the question types are presented as single questions, there is no difference between the 3 proposed database layouts.
These are database mockups of the question types presented [[Question types in version 1.90|here]]. Since the question types are presented as single questions, there is no difference between the 3 proposed database layouts.


==Array==
==Mappings for questions to QuestionType classes==


{|
{|
Line 43: Line 43:
|Multi scale array || ChoiceMatrixQuestionType (''NumberOfRows'' rows and ''NumberOfCols'' columns) with ''NumberOfRows * NumberOfCols'' child questions of type ChoiceQuestionType
|Multi scale array || ChoiceMatrixQuestionType (''NumberOfRows'' rows and ''NumberOfCols'' columns) with ''NumberOfRows * NumberOfCols'' child questions of type ChoiceQuestionType
|-
|-
|Various matrix questions || MatrixQuestionType (''NumberOfRows'' rows and ''NumberOfCols'' columns) with ''NumberOfRows * NumberOfCols'' child questions of a type by choice.
|Various matrix questions || MatrixQuestionType (''NumberOfRows'' rows and ''NumberOfCols'' columns) with ''NumberOfRows * NumberOfCols'' child questions of a type by choice
|-
|Date question || DateQuestionType
|-
|Gender question || ChoiceQuestionType (possible to make a specific GenderQuestionType later)
|-
|Numerical input || IntegerQuestionType or DoubleQuestionType
|-
|Multiple numerical input || MatrixQuestionType (''NumberOfRows'' rows and 1 column) with ''NumberOfRows'' child questions of type IntegerQuestionType or DoubleQuestionType
|-
|-
|
|
|}
|}
==Mappings for QuestionType classes to table columns==
TODO


= Todo=
= Todo=

Revision as of 20:08, 24 June 2010

About the milestone

This milestone includes creating documentation and descriptions of the database schemes explained at Database Storage Engine Project.

Questions : Database Layout

This is the design to store survey, section and question information and their related metadata.

Responses : Flat Database Layout

This is the layout we propose for storing survey responses in a single database table.

Responses : Multitable Database Layout

This is the layout we propose for storing survey responses in multiple tables. Responses for each question get stored in a seperate table.

Responses : Sectionflat Database Layout

This is the layout we propose for storing survey responses in multiple tables. Responses for each section get stored in a seperate table.

Question Type mockups

These are database mockups of the question types presented here. Since the question types are presented as single questions, there is no difference between the 3 proposed database layouts.

Mappings for questions to QuestionType classes

Type of question Mapping in QuestionType classes
Choice matrix questions ChoiceMatrixQuestionType (NumberOfRows rows and 1 column) with NumberOfRows child questions of type ChoiceQuestionType
Multi scale array ChoiceMatrixQuestionType (NumberOfRows rows and NumberOfCols columns) with NumberOfRows * NumberOfCols child questions of type ChoiceQuestionType
Various matrix questions MatrixQuestionType (NumberOfRows rows and NumberOfCols columns) with NumberOfRows * NumberOfCols child questions of a type by choice
Date question DateQuestionType
Gender question ChoiceQuestionType (possible to make a specific GenderQuestionType later)
Numerical input IntegerQuestionType or DoubleQuestionType
Multiple numerical input MatrixQuestionType (NumberOfRows rows and 1 column) with NumberOfRows child questions of type IntegerQuestionType or DoubleQuestionType

Mappings for QuestionType classes to table columns

TODO

Todo

  • Design flat DB layout (Awaiting comments)
  • Design normalized DB layout (Awaiting comments)
  • Design section-flat DB layout (Awaiting comments)
  • Keep in mind all the Question types supported by Limesurvey1 : Question types
  • Problem with loops with current response layouts (sectionflat and multitable), flat has no support for loops. (Done)

Discussions

Comments and ideas here please:

Metadata requirements for databases

- time question displayed/made available to participant (added by Jason)

this may be an indication of when the page was served to the participants browser (time can be generated by web server/php) or in the case of conditional questions, it may need to indicate the time that the question became visible on the page (in which case it may need to be generated by javascript, with all those inherent problems.. maybe it should indicate how many seconds since the page was loaded, and that can be added to the page-load time?)

- time question answered by participant (added by Jason)

this may be a recording of the time that the data in the question was posted (time could be generated by web serer/php) or the time that the question lost focus (after having gained it) - which would be a javascript issue

Any other metadata requirements?