Forum OpenACS Development: Re: complex survey datamodel suggestion/question

Collapse
Posted by Stan Kaufman on
Cathy, good point. We already had separate integer and numeric data types in the metadata model for as_item_types; I've added exponential also; see https://openacs.org/projects/openacs/packages/assessment/design/as_items#item_types

In the table where we store returned data (as_item_data -- see https://openacs.org/projects/openacs/packages/assessment/design/data), we use a single numeric_answer column to stuff the actual values for integer and numeric data, but we know from the corresponding as_item_types value which type it really is. Similarly, we can stuff an "exponential" value in the varchar_answer column of as_item_data but we'll know that it's a "number string" from as_item_types.

Thanks for your offer of the procs. Hopefully we'll start cranking out code for Assessment soon.

Collapse
Posted by Malte Sussdorff on
In some other systems which had to deal with dynamic data, all information has been stored in one "value" column of type text. Wouldn't this be the better solution and have the TCL API make sure that one valid values get stored in the column?

Rephrased: Is there a compelling need for the database to make sure of integrity, thereby adding additional columns to the table and confusing things, instead of having the API make sure that only items that have been checked for validity (pending on the item_type as Stan pointed out) are stored.