muccg / rdrf

The Rare Disease Registry Framework (RDRF) is an open source tool for the creation of web-based patient registries.
GNU Affero General Public License v3.0
15 stars 8 forks source link

Add validation logic for Integer survey questions #1371

Closed jithendralal closed 4 years ago

jithendralal commented 4 years ago

The integer type survey questions do not have validations -- the validations work on admin forms only

id2359 commented 4 years ago

only datatype

jithendralal commented 4 years ago

For testing:

jithendralal commented 4 years ago

Currently you cannot start typing with a symbol '-', so validate only when Next is clicked

gmaloneccg commented 4 years ago

Testing failed as the HEIGHTCLIN CDE in the Baseline PROMS survey can accept decimal and exponential (×10n) notation. The info entered is pulled, but shows a validation error when opening the Baseline PROMS data page.

"Very wrong" data, such as using multiple decimals in a row (e.g. "125....2..e....e...e....eeeee.44.") is erased when clicking Next in the survey. Accepted data will persist when clicking Next -- the data entered in the field will be present in the next field when clicking Next. Not interacting with the field leaves it blank, but entering more data or backspacing any "persisted" data in the new field will update as entered data.

jithendralal commented 4 years ago

With the addition of the integer validation, this strange behaviour was noted in the HEIGHTCLIN question:

Step 1. Enter 'a' (shows invalid) Step 2. Clear 'a' (shows valid) Step 3. Try to enter 'a' (this is not allowed)

Step 1. Enter '-' (shows invalid) Step 2. Enter '2' (shows valid) Step 3. Now try to clear '2' (not allowed) (shows invalid) Step 4. Clear '-' (shows valid) Step 5. Clear '2' (shows valid) Step 6. Try to enter '-' (not allowed) (shows invalid)

Once the user's input is invalid, the buttons remain disabled, even after clearing the input box. (A blank input box remains invalid.)

To make the buttons enable again, the user has to type some digit. OR Even to skip the question, the user has to type some digit and delete it.

gmaloneccg commented 4 years ago

In Google Chrome, on an Android One phone;

gmaloneccg commented 4 years ago

Device: mobile

Failed as the integer behaviour (field HEIGHTCLIN) is odd;

jithendralal commented 4 years ago

These issues are fixed by the commit https://github.com/muccg/rdrf/commit/8ac920e5f5aec388043f08b9b1f471fab984a69b