The Kobo tab takes an XLSForm plus, optionally, the responses, and gives back the DDI with its case count and a data.csv. The LimeSurvey tab (Lstsv2DdiTab.svelte) takes only the structure file (lstsvToDdi(tsv, { assetName })), so a LimeSurvey survey's data can't be documented in the app.
formtransform already supports this in the library and CLI (formtransform lstsv2ddi survey.tsv --data responses.csv). The app doesn't expose it.
Change
Mirror the Kobo tab's two modes: structure only (as now) and with responses.
- An optional second file input for the LimeSurvey response export (
.csv, or .json from RemoteControl export_responses), with question codes as headings. Parse it with parseResponses(text, file.name), as the Kobo tab does.
- With responses:
const xml = lstsvToDdi(tsv, { assetName, submissions, onWarning }); // sets <caseQnty>
const csv = lstsvToDataCsv(tsv, submissions, { onWarning }); // columns = the DDI's <var>s
Offer both files for download, like the Kobo tab's result.
- Show warnings via
messages(findings, 'warning'). lstsvToDataCsv reports export columns it can't match to the structure.
- i18n: add the hint text (de/en) for the new input, e.g. "LimeSurvey-Antwortexport (CSV mit Fragecodes als Spaltenköpfen)".
What the export may look like
normalizeLimeSurveyResponses handles LimeSurvey's quirks, so the app passes the rows through unchanged. It copes with:
- stripped underscores and changed case in question codes (
beruf_post → berufpost);
- one
q[code] = Y column per multiple-choice option, with codes truncated to 5 characters;
- one
array[sq] column per array subquestion;
- the native "other":
-oth- plus q[other].
formtransform tests these on real exports (tests/ts/contract/lstsvRealExports.test.ts).
Done when
- The LimeSurvey tab converts structure-only as before.
- With a response export, it gives a DDI whose
<caseQnty> is the number of responses, and a data.csv whose header matches the DDI's <var name> order.
- A test with one of formtransform's real LimeSurvey exports (fixtures tarball,
formtransform-fixtures-<version>.tar.gz) passes.
Needs formtransform ≥ v0.7.1 (#20), though both functions exist since earlier releases.
The Kobo tab takes an XLSForm plus, optionally, the responses, and gives back the DDI with its case count and a
data.csv. The LimeSurvey tab (Lstsv2DdiTab.svelte) takes only the structure file (lstsvToDdi(tsv, { assetName })), so a LimeSurvey survey's data can't be documented in the app.formtransform already supports this in the library and CLI (
formtransform lstsv2ddi survey.tsv --data responses.csv). The app doesn't expose it.Change
Mirror the Kobo tab's two modes: structure only (as now) and with responses.
.csv, or.jsonfrom RemoteControlexport_responses), with question codes as headings. Parse it withparseResponses(text, file.name), as the Kobo tab does.messages(findings, 'warning').lstsvToDataCsvreports export columns it can't match to the structure.What the export may look like
normalizeLimeSurveyResponseshandles LimeSurvey's quirks, so the app passes the rows through unchanged. It copes with:beruf_post→berufpost);q[code]=Ycolumn per multiple-choice option, with codes truncated to 5 characters;array[sq]column per array subquestion;-oth-plusq[other].formtransform tests these on real exports (
tests/ts/contract/lstsvRealExports.test.ts).Done when
<caseQnty>is the number of responses, and adata.csvwhose header matches the DDI's<var name>order.formtransform-fixtures-<version>.tar.gz) passes.Needs formtransform ≥ v0.7.1 (#20), though both functions exist since earlier releases.