From: Mike G. v. a. <we...@ma...> - 2009-07-18 03:05:34
|
Log Message: ----------- added effectivePermissionLevel to the PG environment -- the permission level of the effectiveUser, the user to which the question has been assigned. Changed the printing of the path to files in beginproblem so that it is shown if the effectivePermissionLevel is higher than the "PRINT_FILE_NAMES_PERMISSION_LEVEL" value. This responds to user requests that make it easier for an instructor to print hardcopy for the student. Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.61 retrieving revision 1.62 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.61 -r1.62 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -1007,7 +1007,7 @@ sub hint { my @in = @_; my $out = ''; - my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); + my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); #user permission level my $PRINT_FILE_NAMES_PERMISSION_LEVEL = (PG_restricted_eval(q!defined( $main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'} )!))? PG_restricted_eval(q!$main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}!) : 10000; # protect against undefined values my $printHintForInstructor = $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL; @@ -1811,11 +1811,11 @@ $points = 'pt' if $problemValue == 1; ## Prepare header for the problem grep($inlist{$_}++,@{ $envir->{'PRINT_FILE_NAMES_FOR'} }); - my $permissionLevel = $envir->{permissionLevel}; + my $effectivePermissionLevel = $envir->{effectivePermissionLevel}; # permission level of user assigned to question my $PRINT_FILE_NAMES_PERMISSION_LEVEL = $envir->{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}; my $studentLogin = $envir->{studentLogin}; my $print_path_name_flag = - (defined($permissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL) + (defined($effectivePermissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $effectivePermissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL) || ( defined($inlist{ $studentLogin }) and ( $inlist{ $studentLogin }>0 ) ) ; if ( $print_path_name_flag ) { |