Good idea! shellcheck shows the mistake:
^-- SC2076: Don't quote rhs of =~, it'll match literally rather than as a regex.
The right hand side must not be in quotes.
Note: [[ ]] does not do globbing, in contrast to [ ] (that's why there cannot be a =~ operator in [ ], and there shouldn't be a == operator - well bash allows it but treats it like the = operator)
What is the ?: for - allowing a preceding ? or : ??
Suggestion: first check the allowed characters then the range
Code:
if [[ $uservar =~ ^[0-9]+$ ]] && [[ $uservar -le 10 ]]
then
...