-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Future Dev
I'm helping out with MDL-81376 which is a fairly typical export / import features. It exports some table of data using the dataformat api for free via tablelib, and then accepts an upload of a csv file.
Technically this is a slight mismatch - in theory the site admin could turn off the csv dataformat plugin so you would be downloading in say json, and then accepting an upload in csv. I think in practice it's not a big deal, but the proper solution would:
- Allow each dataformat plugin to declare if it supports import
- Have a helper function which takes an arbitrary uploaded file, infers its type, hands it off to the right dataformat and gets back a format agnostic list of records
- Possibly we could also add a custom formslib element of a 'dataformatfileupload' which handles everything and the form handler just gets nice data without knowing how it got it.
- When exporting have an optional flag in code which filters the exports to only those which can be imported, or at least give a clear indication in the download widget that only some would be supported for import
- has a non-specific relationship to
-
MDL-81376 Import/export quiz group overrides
- Reopened