WeBWorK uses of the language perl with extra packages to author questions.

A parameter/variable in Perl starts with “$”, for example $a, $integer, $var.

Supported by the PGrandom package, in WeBWork random variables can be defined.

One random number

Two or more different random numbers

Random variables

To generate a random variable, we can use the RandomVariableName function supported by the package PCCmacros.pl.

A random element from a list

References