Forms feature: Prevent guests from reviewing answers#2205
Open
alexsavage wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue / Use Case
I would like to collect CryptPad Forms responses using mobile devices, such as tablets or laptops, at an in-person community event. The reason is to collect feedback and voluntary contact information from attendees, because registration for the event is not required.
CryptPad currently retains form responses from guest sessions in local storage for review. This is undesirable for my case because a later user of the shared device should not know about or see an earlier user's answers. It's not feasible to clear the browser's cache/storage between users, since that requires an additional step after submission, and I want this to be more scalable to similar events and less-attended devices (e.g. with a browser locked to the form submission page).
Proposal / Implementation
This PR creates an option to bypass saving response history to local storage. The new flow brings the user back to a blank form after submission, with a transient pop-up/toast message informing the user that their submission was saved.
The
Q_FORM_SUBMITmessage gains aforgetAnonymousproperty to gate this new behavior, and the editor adds a checkbox managing the property on the document. This checkbox can only be visible and true when the form allows guest submissions with multiple responses are allowed but editing is not allowed.The form submission notification uses the existing Messages.saved key ("Saved" in English).
The editor changes use two new Messages keys, which are not included in this PR:
Please let me know what y'all think and if any changes would help make this acceptable to include in a future release. Thank you!