Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Support guidance and short label #242

Closed
florianm opened this issue Dec 5, 2020 · 1 comment
Closed

Support guidance and short label #242

florianm opened this issue Dec 5, 2020 · 1 comment

Comments

@florianm
Copy link
Contributor

florianm commented Dec 5, 2020

Why

Guidance is very useful to include "training" / "one off explanation" level information which in itself would be too much for the form, but also should be "on tap" for novice enumerators.

What

It would be great if guidance fields were natively supported by ODK Build.
The implementation looks very similar to short labels, so if it's not too much extra work, it would make sense to add both.

Who

I don't yet understand the code architecture and what's happening well enough to offer a PR.
If anyone with deeper knowledge of the code base could point me into the right direction, I'd be happy to give it a go.
I'm lost as to where to generate the content of control.hint as dual node <value>, and <value form="guidance">(control.js:98?).

Alternatives

I'm aware of the XLSForm path but Build is just such an amazing tool I'd like to keep using.
My current hack is to enter the hint and the guidance text into the hint field, separated by "GUIDANCE", and to batch-replace "GUIDANCE" with </value><value form="guidance">.

More context

From #238
Most help text I'm showing as hints would be far better off as "guidance" with the option to collapse and thus make the form more compact for experienced enumerators, while allowing to include sufficient help text to enumerators in training.

Found in XForms spec:

<text id="how-old-label">
    <value>How old are you?</value>
    <value form="short">Age</value>
</text>
<text id="how-old-hint">
    <value>Enter a number</value>
    <value form="guidance">If the age is less than 18, the remainder of the survey will be hidden.</value>
</text>

Possible implementation:
ODK Build could offer a field "guidance" after the field "hint" input which adds the guidance as <value form="guidance"...</value> to the respective <text id="...:hint"> nodes.
And while we're there, support for a short label might be very similar to add.

A hack for now:

  • Append the guidance text to the text in hint, separated by a string like GUIDANCE.
  • Export to XML.
  • Edit XML, search-replace all occurrences of GUIDANCE with </value><value form="guidance">.
  • Publish form e.g. through ODK Central.
florianm pushed a commit to dbca-wa/build that referenced this issue Dec 13, 2020
@florianm
Copy link
Contributor Author

florianm commented Feb 1, 2021

Closing this issue as #244 was merged.

@florianm florianm closed this as completed Feb 1, 2021
@florianm florianm added this to the 0.4.0 milestone Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant