Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Signature Widget in forms #8308

Open
jkuester opened this issue Jun 8, 2023 · 5 comments
Open

Add support for Signature Widget in forms #8308

jkuester opened this issue Jun 8, 2023 · 5 comments
Labels
Enketo Affects Enketo forms Type: Feature Add something new

Comments

@jkuester
Copy link
Contributor

jkuester commented Jun 8, 2023

Is your feature request related to a problem? Please describe.
As noted on this forum thread there is a need to collect signatures within Enketo forms.

Describe the solution you'd like
An Enketo Widget already exists for doing this, but is not one of our currently enabled widgets. During the uplift to Enketo 5.x, I did briefly test that widget, but it was ultimately not included. At the time we did not have any usecases where it was needed and so there was not much to justify the increase to the bundle size for the webapp (the drawing libs associated with the widget are not small),

Describe alternatives you've considered
We could roll our own drawing widget. This might result in a more lightweight solution, but would be extra code to maintain.

Another alternative would be to see if the use-cases for the signature widget could be covered by just using the trigger widget (I know a lot of "official" online forms that let me "sign" just by checking a box...).

@jkuester jkuester added Type: Feature Add something new Enketo Affects Enketo forms labels Jun 8, 2023
@jkuester
Copy link
Contributor Author

I have started a branch containing changes for this issue: https://github.com/medic/cht-core/tree/8308_signature_widget

Currently all I did was add the linkage for the Enketo widget so the widget can be used in a form. Here are the issues that i have noted so far:

  • Something is weird with the widget when it is initially loaded. Drawing works, but the displayed lines do not match with where I am drawing. Reloading the widget fixes this problem. Not sure exactly what is causing this.
  • Using the widget causes the form to fail to submit. This is due to an error when trying to save the attached image. I think that code is setup to handle saving uploaded images, but needs to be tweaked to support saving drawn images as well!

@jkuester
Copy link
Contributor Author

@garethbowen do you have any concerns with including this widget (once we get the functional issues resolved)? I know we originally excluded it due to bundle size, but based on the ongoing forum thread linked above, there is community interest in having this widget and seems worth including in the bundle....

@latin-panda
Copy link
Contributor

latin-panda commented Jul 7, 2023

I had a look at that branch. For now, importing the widget increases 125.87kB the cht bundle size (CSS + JavaScript), which is still fine IMO. The widget is used by adding the signature appearance attribute.

We need to include an explanation of how it works and the implications of adopting this feature. Such as having the user’s phone store the form’s images.
Even if we decide to build it ourselves, it will be an HTML canvas, and it will save the signature as a Base64 image. We already have a way to display Base64 images

I have some questions related to the project logistics; when it comes to using this feature effectively:

  1. How do they know that the signature is the user’s real one? Someone can draw a dot and submit it. Will they require CHWs to submit their ID picture before the project starts to compare signatures?

    1.1. Along this line, how is that different from having a checkbox consent, like many other websites and software do for their terms and conditions? - cht supports this way

    1.2. If the signature is wrong, what happens with the data collected in the form - because we still don’t have a tool to verify if the drawing is just a line or a dot

  2. Would a picture of the CHW holding a paper with a signature + date be more accurate or enough? Many people find it challenging to sign using a phone. And we already support image uploads.

@jkuester
Copy link
Contributor Author

@latin-panda Great questions!

For #1.1, I did already ask about that on the forum thread and the response was that capturing the signature is a hard requirement from "stakeholders". I will pass along the rest of these questions on the forum and we can collect some more information!

@fardarter
Copy link
Contributor

fardarter commented Jul 25, 2023

@latin-panda These are all great questions but governance environments are weird. Anything other than strong biometrics or cryptographic key can be faked, and even these can be threatened in some ways.

I know we require a signature. It doesn't make sense. But IMO an app like CHT needs to be able (within limits) to operate in irrational regulatory environments.

Re bundle size, surely something like this should be easy to lazy load?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enketo Affects Enketo forms Type: Feature Add something new
Projects
None yet
Development

No branches or pull requests

3 participants