From: Mike G. v. a. <we...@ma...> - 2009-01-17 03:33:25
|
Log Message: ----------- Fixed error in hint() associated with always showing the instructor that a hint exists. Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.56 retrieving revision 1.57 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.56 -r1.57 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -998,22 +998,23 @@ my @in = @_; my $out = ''; my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); - my $PRINT_FILE_NAMES_PERMISSION_LEVEL = PG_restricted_eval(q!$envir->{'PRINT_FILE_NAMES_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; my $showHint = PG_restricted_eval(q!$main::showHint!); - my $displayHint = PG_restricted_eval(q!$envir->{'displayHintsQ'}!); + my $displayHint = PG_restricted_eval(q!$envir{'displayHintsQ'}!); PG_restricted_eval(q!$main::hintExists =1!); PG_restricted_eval(q!$main::numOfAttempts = 0 unless defined($main::numOfAttempts);!); my $attempts = PG_restricted_eval(q!$main::numOfAttempts!); if ($displayMode eq 'TeX') { if ($printHintForInstructor) { - $out = join(' ',@in, "$BR(Show hint after $showHint attempts. ) $BR"); + $out = join(' ', "$BR(Show the student hint after $showHint attempts: ) $BR",@in); } else { $out = ''; # do nothing since hints are not available for download for students } } elsif ($printHintForInstructor) { # always print hints for instructor types - $out = join(' ',@in, "$BR(Show hint after $showHint attempts. )$BR "); + $out = join(' ', "$BR(Show the student hint after $showHint attempts: )$BR ", @in); } elsif ( $displayHint and ( $attempts > $showHint )) { ## the second test above prevents a hint being shown if a doctored form is submitted |