refactoring: more fixes, first attempt at tagRenderingAnswer

This commit is contained in:
Pieter Vander Vennet 2023-03-30 04:51:56 +02:00
parent aaaaf1948d
commit 29372c465e
24 changed files with 278 additions and 113 deletions

View file

@ -9,7 +9,17 @@ export default class DirectionValidator extends IntValidator {
)
}
isValid(str): boolean {
if (str.endsWith("°")) {
str = str.substring(0, str.length - 1)
}
return super.isValid(str)
}
reformat(str): string {
if (str.endsWith("°")) {
str = str.substring(0, str.length - 1)
}
const n = Number(str) % 360
return "" + n
}

View file

@ -2,6 +2,6 @@ import { Validator } from "../Validator"
export default class TextValidator extends Validator {
constructor() {
super("text", "A longer piece of text. Uses an textArea instead of a textField", "text")
super("text", "A longer piece of text. Uses an textArea instead of a textField", "text", true)
}
}