One way to test for a professor is the following:
if $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL;since
$permissionLevelis the current user's permission level, and
PRINT_FILE_NAMES_PERMISSION_LEVELis usually at least professor level. You might want to use
$permissionLevelif you want to avoid the re-randomize button when viewing student versions of the problems (so you don't accidentally re-randomize the problem in use by a student).