surveysolutions / surveysolutions

Survey Solutions is a survey management and data collection system developed by the World Bank.
https://mysurvey.solutions
Other
94 stars 30 forks source link

Pattern in masked text edit is interpreted differently in CAPI and CAWI modes #1763

Open radyakin opened 2 years ago

radyakin commented 2 years ago

When a pattern for a text question contains a star (*) character it is interpreted differently in CAPI and CAWI modes.

CAPI

image

NB: 1 = special characters are accepted and 2 = Cyrillic (non-English) letters are accepted in the CAPI input field.

CAWI

Non-English letters and special characters are not accepted in the entry field anywhere when the mask is active.

Wanted:

  1. Consistent behavior of the CAPI and CAWI modes
  2. Possibility to permit ANY character
  3. Possibility to permit ANY LETTER (of any alphabet, but NOT a special character)
  4. Possibility to permit ANY ENGLISH LETTER (of specifically English alphabet)
  5. Possibility to permit ANY character from a specific set

Items 2-5 are to extend the capabilities of the masked edit. The bug itself is in the inconsistent behavior of the CAPI vs CAWI (item nr. 1).

Untested:

It appears that the preloading procedure will follow the CAPI convention if data for masked edit fields is specified in the data file, but creating assignments interactively from the web interface will follow the CAWI convention, and will not allow to enter the same values.

vlasvlasvlas commented 1 year ago

this would be great,

can "*" add "whitespace" also?

radyakin commented 2 months ago

Consider using Char.IsLetter() method for nr. 3 above, as per: https://learn.microsoft.com/en-us/dotnet/api/system.char.isletter?view=net-8.0