Randomization and Informational Functions

The following list includes both WebAssign-specific and commonly-used Perl functions that are available when creating questions.

Operation

Usage

Notes

Pick values from a list

pick(n,list)

Returns n randomly selected values from list.

Pick a random integer

randnum(low, 
high, 
increment, 
exclude)

Returns a random integer in the range from low through high in the specified increments. Optionally, specify a single value to exclude.

Time submitted before due

&beforeDue('days')
                      &beforeDue('hours')
                      &beforeDue('minutes')

Returns the number of days, hours, or minutes before the assignment is due (including any granted extensions) that the question was submitted.

Deprecated Functions

The following functions have been deprecated and should no longer be used:

  • get_data()
  • pickone()
  • picksame()