Skip to content

xlsform2lstsv: carry randomize=true to LimeSurvey and support coalesce() #213

Closed

Description

@jstet

Two gaps we hit in the Kommunaler Weiterbildungsindex forms (formtransform 0.10.0, xlsform2lstsv).

1. parameters: randomize=true is not carried to LimeSurvey

For select_one / select_multiple with randomize=true in the parameters column, the DDI keeps it as a cdl:parameters note, but the LimeSurvey TSV has no answer-order setting. As a result, the order is randomized in KoboToolbox but fixed in LimeSurvey, so the same form behaves differently depending on the platform. We need randomization to avoid primacy effects in lists whose options are compared in hypothesis tests.

Expected: map randomize=true to the LimeSurvey question attribute random_order = 1 (list, multiple choice, and the filtered "most important" select_one that uses choice_filter). Ideally, options marked exclusive (e.g. "keine", "weiß nicht") and sonst/other stay at the end. If LimeSurvey can't pin them, a warning in the conversion output would help.

Reverse direction: random_order = 1 → parameters: randomize=true.

2. coalesce() is not in supportedXPathFunctions

coalesce() is a standard ODK XPath function and a common way to treat empty numeric fields as 0 in sum checks, e.g.

. >= 0 and . <= 100 and (coalesce(${a},0) + coalesce(${b},0) + .) = 100

At the moment the transpiler throws. Workaround: if(string-length(${a}) = 0, 0, ${a}).

Expected: transpile coalesce(x, y) to LimeSurvey EM, e.g. if(is_empty(x), y, x), and back.

🤖 Generated with Claude Code

Activity

  1. jstet commented on Nov 4, 2026

    @jstet
    MemberAuthor

    Both parts shipped in v0.11.0: randomize=true → answer_order/subquestion_order with keep_codes_order (#215), and coalesce() (#216, together with #214). Pinning further options came later with the fixed choices column (#237, #238, v0.12.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions