grade.isscalar checks to see if x is a finite numeric scalar
(vector of length 1). If usena=TRUE, NA is also
accepted. If useinf=TRUE, Inf and -Inf are also
accepted. Input to the grade.parse functions can be a string or a vector.
grade.parsechunk will only return scalars, the other two will
return a vector. All three check return values using
grade.isscalar on each element.
grade.parse delegates character types to either
grade.parsechunk or grade.parseset. If the string
contains any of the characters '[', ']', '(', ')', or ',' the string is
sent to grade.parseset. Otherwise it is sent to
grade.parsechunk.
If x is a character, grade.parsechunk checks for
any of the forbidden characters '[', ']', '(', ')', or ','. If any are
found grade.parsechunk refuses to evaluate the string.
If x is a character, grade.parsechunk makes sure
that it looks like a vector or set. I.e. it starts with an open
bracket or parenthesis and ends with a close bracket or parenthesis. No
other brackets or parenthesis are allowed. The middle is expected to be
a comma delimited list. See the examples for more clarification.
If useeval=TRUE, text elements are evaluated using
eval. If useeval=FALSE text elements are coerced
using as.numeric. eval is more forgiving to input,
i.e. eval of text input '1/2' returns .25, but
as.numeric of text '1/2' returns NA. However, eval
does leave an opening for unchecked code to be run in R. Text
containing parenthesis or brackets is not put into either eval or
as.numeric by the grade.parse functions, but there is
still a risk. If you are concerned, set useeval=FALSE.