Supported Data Types
Responses The following is a list of data types for the survey responses. They are structured for compatibility with Matlab. Several types from MySQL have also been adopted, but they are easily converted to Matlab types. Most answers can probably be submitted as a varchar, text, double, enum, or one of the int types.
- varchar - A variable length string. The maximum length is determined by the "range" field. If no range is entered, the user will be able to enter an indefinite length of characters. Limits are imposed by the maximum allowable packet transmission in MySQL. This is currently set to 1 Mb, which corresponds to roughly over a million characters.
- text - A string with essentially no length limit. Limits are imposed by packet transmission size (see varchar type).
- int16 - A signed integer value with 16 bits. Values between -32768 and 32767.
- int32 - A signed integer value with 32 bits. Values between -2,147,483,648 and 2,147,483,647.
- int64 - A signed integer value with 64 bits. Values between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807.
- double - A signed 64 bit floating point number with a value between -1.79769e+308 to -2.22507e-308 (for negative numbers), 0, or between 2.22507e-308 to 1.79769e+308 (for positive numbers).
- date - A date value submitted in the format MM-DD-YYYY but stored in the format YYYY-MM-DD. The format of the submission is different than the storage format for user friendliness. Note: type checking is not yet implemented for this field type, although you may still use it. It will be regarded as normal text.
- time - A 12 hour time value submitted in the format HH:MM:SS XM, where XM is AM or PM (lower or upper case). The time is stored in a 24 hour format as HH:MM:SS. Note: type checking is not yet implemented for this field type, although you may still use it. It will be regarded as normal text.
- year - A four digit year value.
- enum - An enumerated type. You will want to use this type for questions with a "yes" or "no" answer, or if you want a standardized answer (such as a selection from a specific list of musical genres). Values are selected from a set of choices. This type supports single or multiple choices. The html field type (menu, radiogroup, or checkbox) determines whether single or multiple choices are allowed. The checkbox html field type allows multiple choices while the radiogroup and menu types support only single choices. The choices are mapped to a 64 bit bitmask, each bit indicating whether or not an enum value has been chosen. The least significant digit of the bitmask corresponds to the first enum value. The bitmask is then converted to a 64 bit integer before it is stored in the database. Note that since the bitmask is 64 bits, the maximum number of enum values allowed is 64.
HTML Fields HTML field types determine how the response fields appear in the generated HTML form. Each HTML field type is compatible only with certain data types.
- text - note that this is the "text" HTML field type and that it has no direct correlation to the "text" data type. This type will place a single line text field on the form, limited in length by the "range" field if a varchar is used. Supported data types are varchar,text,int,double,date,time, and year.
- textarea - A multi-line entry field with no limitation on character length. The only supported data type is text.
- menu - A drop down menu of choices. Supported for enum types or integers with a range less than or equal to 30.
- radiogroup - Choices appear with selectable buttons. Only single choices are allowed. Supported for enum types or integers with a range less than or equal to 30.
- checkbox - Choices are made by placing checkmarks in boxes. Multiple choices are allowed. Supported only for enum types.