Open MartijnR opened 4 years ago
Inventory of tasks:
NOT part of scope:
~24 hours without iframe
http://localhost:8005/fs/participant/x/#d8fdeecf11ec44a518a2e529ab660b4a
@MartijnR - We need to think a little more about the exact expected behavior and when the queue should be populated and submitted.
We want to enabled online Anonymous mode as well. I think that aligns closely with this offline ticket. Online Anonymous mode would also be only for the new Participant record view and would have Submit button that would trigger the entire queue of items to be submitted (as field submissions).
How much additional work is needed on your end to enable online Anonymous mode (separate from the 24 hours above for offline Anonymous mode)?
online: probably multi-submission, tbc
This has been de-prioritized for now.
If this ever becomes relevant again, IE11 won't be possible to support with offline-capable forms as Chrome is removing support for applicationCache in version 82, so we are switching to a different technology: https://github.com/enketo/enketo/issues/1204
We want to support this in a true anonymous, non-authenticated model and also in a model that requires authentication to submit data and load the form.
We think full record submission (not field submission would make more sense after all).
Estimate: 10 hrs
The remaining part of this issue:
some complications, I hadn't considered so far:
This makes me wonder again, if it wouldn't be better to split up the whole XML record on the OC side.
@MartijnR - If a submission fails, could it be added back into the queue or would this require more complex development?
It will be more complex, because we also have to deal with the other use case, where a user tries again next day in which case I think it's not really feasible to only try the failed fields.
Right now, I haven't spent any time on actually splitting a record into fieldsubmissions. So it wouldn't be a waste to go back to the idea of doing this on the OC side. We could do this to a new /submission-xx endpoint on the OC side. I could write pseudo code for the splitting of a record. I don't remember what the argument for not doing this was @pbowen-oc
Work so far on creating the record UI with the OC customizations in the fieldsubmission views would still be relevant.
[x] new submission endpoint
[x] when record is marked as final, run checks - In Participate, there are no queries, just a Close button, so it should be similar to what is used now for Participate (strict required and constraint, and relevantErrors to be resolved. - http://localhost:8005/fs/participant/x/77291353cc70be078ba826a61452206b?ecid=a
[x] button should say Close (and Save Draft)
[x] Save Draft on every page and Close on last page only - http://localhost:8005/fs/participant/x/f992be996b8eb0342fbab92d589d8b81?ecid=a
[x] Last page button styling messed up due to addition of Save Draft
[x] look into whether customizations made to webform-controller.js can be undone - PREVIEW and VIEW still use this webform-controller, so we may still need to maintain a few customizations. I think it is best to wait until the next merge from enketo/enketo-express (2.8.1 or 2.9.0?). - Seems easiest to cut-and-paste the latest enketo-webform-controller in and then bring back the required customizations by discarding changed lines.
[x] Clear Storage button is broken
Changes:
Any submissions sent to this OC endpoint from special OC webform URLs are now always fieldsubmissions
Any submissions sent to this OC endpoint from special OC webform URLs are now always full submissions that are expected to be spit up on the OC side,
@pbowen-oc should the new online-only participant anonymous view direct back to OC after each submission or is the user allowed to keep submitting new records without going back to the OC interface?
@MartijnR - The user in that case would not be an authenticated OC user. I think we would just want to show them a success message after the submission was successful.
I would prefer if they had to manually go back to the URL in order to submit again in order to prevent confusion about whether they had already submitted. In the vast majority of cases for online mode, we would expect only one submission per person for the form.
Done in master
. See the two anonymous endpoints here: https://github.com/OpenClinica/enketo-express-oc/blob/master/tutorials/oc-api.md#post-surveycollectanonymousparticipant
I do not know if this can be easily merged into an old branch. It touched quite a parts of the code which makes me afraid.
Ready for testing. See updated API Docs https://github.com/OpenClinica/enketo-express-oc/blob/master/tutorials/oc-api.md#post-surveycollectfullparticipant