Link each change to form data to an individual describes a high-level need to keep track of who has made changes to form instance contents across instance opens.
Below are some options of how this could be done, none of which I am fully satisfied with. I hate to provide so many options but I think there are lots of different ways we could meet this requirement and I think putting them out there will help get to a better approach. I’m very interested in:
- Which option(s) you like
- Which options you’d like to take off the table
- Any other directions we should explore
Option 1: generic way to clear a form field on instance load and require it filled before form save
Introduce an event that is dispatched every time an instance is loaded (as opposed to
odk-instance-first-load which is dispatched only the first time an instance is loaded). This would make it possible to author a form that clears one or more fields on instance open using
setvalue. For example, consider fields that prompt for the “Last person to modify this form” or “Comments about the latest revisions to this form”. If these are required and cleared on form open, whoever is editing the form would need to populate them. Only the last value would be saved in the data submission but if the audit log is configured to track changes, all values would be saved in the log.
In Collect, this would also require introducing a configuration option to validate on save. Currently validation is only required on finalization (and by default it's done on forward swipe as well). I think design decisions of when to validate, user interface settings, etc, have been left up to individual clients so I don’t believe there would be spec modifications needed for this.
Option 2: audit log attribute, custom client UI and new audit log convention
Add an audit attribute (e.g.
odk:track-user). If that attribute is set to
true, clients will define UI outside the form to prompt for user identification each time that a form instance is opened. For example, Collect might pop a dialog up while the form instance is loading in the background.
Add an audit log event type (e.g.
user details) and when the user provides identification, write one of these events with the user identification in the
When the user provides identification, write the user identification to the
new-value column of the
form start or
form resume event.
Option 3: generic way to identify a field as needing confirmationAdd a bind attribute that can go on any field and that if set to true, prompts the user for confirmation with client-specific UI any time an instance is opened. This is similar to the option above but it’s on specific fields and the latest confirmed value is what gets written to the form instance. Interim values are saved to the audit log by the usual mechanism.
Option 4: generic way to link formsThe idea here would be to make it possible to log change information with a companion form. The main form would prompt the person editing it to fill this companion form on each open.
This might best be done in a client-specific way. For example, this is almost possible today in Collect using a combination of the activities the app exports and the external data questions. The big thing that’s missing is a way to pass the No, this should be done in a portable way.
instanceID of the main form to the dependent form. I’m guessing it’s either possible or almost possible in Enketo with HTML links.
See also this features thread.
Option 5: generic way to insert a node on instance load
Introduce something like the W3C XForms insert action, perhaps limited to repeat instances and an event that fires every time an instance is opened. This would make it possible to add arbitrary new repeat instances with required questions (or perhaps fields not in a repeat).
Like with option 1, clients would need a way to require validation on save for this to force user identification.
The fifth option (generic insert) is the most principled but it also represents a ton of work and I’m not sure it provides a ton of user benefit beyond this context.
I’m getting pretty intrigued by the possibilities doing this with linked forms might open up.