mohan-nishit / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

default to string type if no type defined #283

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
if the form doesn't have a type defined, it should warn and default to type 
string -- it should not refuse to upload entirely. 

not having this functionality breaks a lot of existing (and large forms like 
imci) and it takes hours to update those forms. moreover, the parser in 
aggregate is not in any of the other tools so we can't check before updating. 

it's also not clear what we gain.

Original issue reported on code.google.com by yanokwa on 1 Aug 2011 at 9:33

GoogleCodeExporter commented 9 years ago
By defaulting to string, we can inadvertently assume a numeric or boolean field 
is a string value.  The biggest issue is with calculated fields -- the eIMCI 
form has many of these for numeric fields (e.g., computed dosing levels) and 
also for boolean conditions.  These don't have types defined in the form, and 
would be loaded as string values unless their types can be determined.

AFAIK, there is no way to ask JR statically what type a resulting calculation 
is, so I can't determine this outside of requiring an explicit type="" 
declaration.  If there is an API to determine the type of a calculated field, 
most of the data types could be determined and there would be less conversion 
pain involved.

Original comment by mitchellsundt@gmail.com on 2 Aug 2011 at 5:42

GoogleCodeExporter commented 9 years ago
the plan going forward is to as follows:

aggregate's form upload will show warnings if a form isn't properly typed, but 
will accept the form.

collect and validate will show warnings if form isn't valid (according to 
aggregate's new rules). 

we will make no changes to core, but will instead wrap the jr library with 
aggregate's parsing.

Original comment by yanokwa on 3 Aug 2011 at 2:16

GoogleCodeExporter commented 9 years ago
Now displays warning message with the list of form fields that don't have types.
Treats these as string values.

Original comment by mitchellsundt@gmail.com on 16 Aug 2011 at 10:56