galahq / gala

An open tool for collaboratively authoring, teaching, and learning with learning modules.
https://www.learngala.com
MIT License
11 stars 4 forks source link

Validation for QID input field #710

Open annefitzatomic opened 2 weeks ago

annefitzatomic commented 2 weeks ago

User Story As someone adding a wikidata item, I don't want to be able to enter an invalid QID for a category.

**Acceptance Criteria***

  1. Check for a “Q” Prefix: Ensure that the input begins with an uppercase “Q”.
  2. Only Digits After “Q”: The characters after “Q” should consist solely of digits.
  3. Minimum Length: The shortest possible QID is “Q1”, so ensure a minimum length of 2 characters.
  4. Reasonable Maximum Length: Wikidata’s QID numbers have not yet exceeded 8 digits (as of 2023). Setting an upper limit, such as 12 characters (1 “Q” + up to 11 digits), will allow room for growth without being excessively large.
  5. Case Sensitivity: Ensure that the “Q” is uppercase, as lowercase “q” is invalid.
elkusbry commented 1 week ago

Via Ed: it might be nice to have this not be case sensitive so "q937" works the same as "Q937"