PubTrivia's four free tools are the only pages on the site a stranger can type into without an account. There is no API behind them: a team name generator, a round planner, a scoresheet PDF builder and a QR code generator, all of them client-side, which means every limit they have is a limit somebody wrote in a React component.
I probed all three of the ones that take input, on the live pages, and found three different strategies. None of them is wrong. The interesting part is that nobody decided to have three.
One: clamp in the state setter
The scoresheet generator builds a printable answer sheet and score grid. Its inputs carry the bounds twice, once as HTML attributes and once in the code behind them:
const LIMITS = { rounds : { min : 1 , max : 12 }, questionsPerRound : { min : 1 , max : 20 }, teams : { min : 1 , max : 40 }, }
function clamp ( value : number , { min , max }: { min : number ; max : number }) { if ( ! Number . isFinite ( value )) return min return Math . max ( min , Math .…