Have a play at the following form:
grouptimer.xls (5.5 KB)
Basically, it takes a timestamp the moment you finish answering the question that is immediately before your group/section [there’s no way short of pulling raw data out of the audit log to get the actual timestamp you started the group, so this is the next best thing…]. Then it takes another timestamp to moment you finish answering all the questions in the group; since you might answer them in any order, I check all of them not merely the last in the group.
The ‘secret sauce’ here is probably capturing the timestamp with a conditional
once(now()) - if the condition isnt met the calculation returns null, so the calculation will keep firing till its met. Once met, the timestamp wont be overwritten.
Note: unfortunately, Enketo currently truncates
decimal-date-time() values to 3 decimal places (!) which severely limits the precision of these timestamps to approx 86sec (1/1000 of a day). This will hopefully soon be fixed in https://github.com/enketo/enketo-xpathjs/issues/70. So if you test this under Kobo preview, go get a coffee before answering the last question in the group…