Hyperlink to other ODK Collect questions for non-linear flow

odk-collect
xlsform

(James Pringle) #1

What is the general goal of the feature?
When using ODK Collect, I would like to be able to click a link to move me to a different part of the questionnaire. This is different from the jump view (hierarchy view) because I know where I would like to be able to go with my hyperlink.

What are some example use cases for this feature?
There may be several sections of the questionnaire. The hyperlink would let me go to the beginning of each section, for example. I believe this is already a feature in SurveyCTO, for comparison.

What can you contribute to making this feature a reality?
I can contribute by adding code to pyxform, ODK Collect, helping discuss a specification, writing documentation, etc.


(Dr. Gareth S. Bestor) #2

By 'sections' I assume you mean groups?

How does SurveyCTO (ie how would we) handle links that might go to questions or groups that are not relevant (ie their relevant='...' expression evaluates to false). One issue I envision with being able to 'jump' anywhere - and to any depth - within a form is that it would appear to bypasses the relevant show/hide navigation logic intrinsic to XForms. So I'd be interested to understand how SurveyCTO deals with hyperlinks vs relevance.


(James Pringle) #3

I do not mean groups necessarily. We have surveys where there are several related questions in a row. They do not necessarily have to be in a group (in our case, they are usually not in a group).

I agree that it doesn't make sense to be able to jump to a prompt that is not relevant. As for how SurveyCTO handles it, I do not know. One simple way to handle trying to jump to a prompt with a false relevant is to show a toast message saying the prompt is not relevant and do nothing.

This is very similar to the jump view / hierarchy activity in ODK Collect where instead of opening up the jump view then clicking a prompt and then moving to that prompt, we would have in mind the prompt we want to move to with the hyperlink and after clicking it, move to that prompt.


(Joseph E. Flack IV) #4

How SurveyCTO handles hyperlinks to other parts of a form

Instructions
Taken from https://pma2020trial.surveycto.com/help.html;#Help_Designing-forms_additional-topics_designing-for-nav:

Within a field or group label, for example, you can hyperlink to another field or group by simply adding a ${fieldname} or ${groupname} reference (hyperlinked references are always enabled for web forms; on Android, enable the Hyperlink field references option in SurveyCTO Collect). For example, say that you have two different modules for two different respondents (in groups named "module1" and "module2"), followed by a concluding section for the surveyor (in a group named "module3"), and you want to offer surveyors the option to easily fill out these modules in any order. Just before module1, between module1 and module2, and between module2 and module3, you can add note fields that reference ${module1}, ${module2}, and ${module3} in each of their labels. When hyperlinked field references are enabled, these group references will display hyperlinked labels that the surveyor can use to jump to any of the three modules.

Example snippet of question definition in the form editor

Example of what it looks like in the browser

I'm not actually sure why the hyperlinks are displaying as "...", but I haven't used SurveyCTO much so I'm probably missing something obvious.


TLDR

Basically, if the hyperlink points to something that is currently relevant, the hyperlink is active. If the question is not relevant, then hyperlink is deactivated, and the hyperlink label simply displays as plain text. Selecting the text will not do anything.


(Dr. Gareth S. Bestor) #5

Presumably SurveyCTO must also be walking up the target's group hierarchy too when determining whether to disable a link or not, since its possible for a specific question's relevant expression to be true, but the subgroup its contained in (or any of its parents) is not-relevant (which would normally prevent you from reaching the question...).

Being able to jump around a form like this - whilst still preserving relevant logic - would certainly allow for some interesting non-linear form workflows! Though I imagine it could make it a bit harder for a form designer to determine best-practices around when to use skip logic (ie relevance) vs these psuedo-goto links.... "spaghetti forms" anyone? :wink:

Very interesting. Thanks for sharing. :+1: