Some time ago, we introduced a convention of using a parameters column for specifying attributes that only apply to a particular question type as key/value pairs. This allows us to do specialized validation on those parameters without adding columns to forms.
That pattern has served us well and we're likely to keep adding to it. Checking for and validating parameters is now a bunch of spaghetti code. Ideally that functionality could be pulled out for easier extensibility and maintenance.
One high-level concept would be to introduce a json spec for specifying parameters. That might make it possible to define what types they apply to and what function should be used to validate their values. Some types of things that might be tricky to represent:
- the
value and ref params only apply to select_*_from_file, not other selects
- the
capture-accuracy param only applies to geopoint and not to geoshape and geotrace. Some other params apply to all three.
Some time ago, we introduced a convention of using a
parameterscolumn for specifying attributes that only apply to a particular question type as key/value pairs. This allows us to do specialized validation on those parameters without adding columns to forms.That pattern has served us well and we're likely to keep adding to it. Checking for and validating parameters is now a bunch of spaghetti code. Ideally that functionality could be pulled out for easier extensibility and maintenance.
One high-level concept would be to introduce a json spec for specifying parameters. That might make it possible to define what types they apply to and what function should be used to validate their values. Some types of things that might be tricky to represent:
valueandrefparams only apply toselect_*_from_file, not other selectscapture-accuracyparam only applies togeopointand not togeoshapeandgeotrace. Some other params apply to all three.