OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

Participate anonymous mode - online and offline #156

Open MartijnR opened 4 years ago

MartijnR commented 4 years ago
MartijnR commented 4 years ago

Inventory of tasks:

NOT part of scope:

MartijnR commented 4 years ago

~24 hours without iframe

http://localhost:8005/fs/participant/x/#d8fdeecf11ec44a518a2e529ab660b4a

MartijnR commented 4 years ago
pbowen-oc commented 4 years ago

@MartijnR - We need to think a little more about the exact expected behavior and when the queue should be populated and submitted.

pbowen-oc commented 4 years ago

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)?

MartijnR commented 4 years ago

online: probably multi-submission, tbc

pbowen-oc commented 4 years ago

This has been de-prioritized for now.

MartijnR commented 4 years ago

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

MartijnR commented 3 years ago
pbowen-oc commented 3 years ago

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).

MartijnR commented 3 years ago
MartijnR commented 3 years ago

Estimate: 10 hrs

MartijnR commented 3 years ago

The remaining part of this issue:

MartijnR commented 3 years ago

http://localhost:8005/fs/participant/x/d8fdeecf11ec44a518a2e529ab660b4a (no hash!)

MartijnR commented 3 years ago

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.

pbowen-oc commented 3 years ago

@MartijnR - If a submission fails, could it be added back into the queue or would this require more complex development?

MartijnR commented 3 years ago

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.

MartijnR commented 3 years ago

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.

MartijnR commented 3 years ago
MartijnR commented 2 years ago

Changes:

/submission

Any submissions sent to this OC endpoint from special OC webform URLs are now always fieldsubmissions

/ submission-full

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,

MartijnR commented 2 years ago
MartijnR commented 2 years ago
MartijnR commented 2 years ago

@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?

pbowen-oc commented 2 years ago

@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.

MartijnR commented 2 years ago

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.

MartijnR commented 2 years ago
MartijnR commented 2 years ago

Ready for testing. See updated API Docs https://github.com/OpenClinica/enketo-express-oc/blob/master/tutorials/oc-api.md#post-surveycollectfullparticipant