[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 6080 Revision 6085
1################################################################################ 1################################################################################
2# WeBWorK Program Generation Language 2# WeBWorK Program Generation Language
3# Copyright  2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright  2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader$ 4# $CVSHeader: pg/macros/PGbasicmacros.pl,v 1.61 2009/07/12 23:39:20 gage Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
1005 1005
1006 1006
1007sub hint { 1007sub hint {
1008 my @in = @_; 1008 my @in = @_;
1009 my $out = ''; 1009 my $out = '';
1010 my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); 1010 my $permissionLevel = PG_restricted_eval(q!$main::envir{permissionLevel}!); #user permission level
1011 my $PRINT_FILE_NAMES_PERMISSION_LEVEL = (PG_restricted_eval(q!defined( $main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'} )!))? 1011 my $PRINT_FILE_NAMES_PERMISSION_LEVEL = (PG_restricted_eval(q!defined( $main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'} )!))?
1012 PG_restricted_eval(q!$main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}!) : 10000; # protect against undefined values 1012 PG_restricted_eval(q!$main::envir{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}!) : 10000; # protect against undefined values
1013 my $printHintForInstructor = $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL; 1013 my $printHintForInstructor = $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL;
1014 my $showHint = PG_restricted_eval(q!$main::showHint!); 1014 my $showHint = PG_restricted_eval(q!$main::showHint!);
1015 my $displayHint = PG_restricted_eval(q!$main::envir{'displayHintsQ'}!); 1015 my $displayHint = PG_restricted_eval(q!$main::envir{'displayHintsQ'}!);
1809 my $points ='pts'; 1809 my $points ='pts';
1810 1810
1811 $points = 'pt' if $problemValue == 1; 1811 $points = 'pt' if $problemValue == 1;
1812 ## Prepare header for the problem 1812 ## Prepare header for the problem
1813 grep($inlist{$_}++,@{ $envir->{'PRINT_FILE_NAMES_FOR'} }); 1813 grep($inlist{$_}++,@{ $envir->{'PRINT_FILE_NAMES_FOR'} });
1814 my $permissionLevel = $envir->{permissionLevel}; 1814 my $effectivePermissionLevel = $envir->{effectivePermissionLevel}; # permission level of user assigned to question
1815 my $PRINT_FILE_NAMES_PERMISSION_LEVEL = $envir->{'PRINT_FILE_NAMES_PERMISSION_LEVEL'}; 1815 my $PRINT_FILE_NAMES_PERMISSION_LEVEL = $envir->{'PRINT_FILE_NAMES_PERMISSION_LEVEL'};
1816 my $studentLogin = $envir->{studentLogin}; 1816 my $studentLogin = $envir->{studentLogin};
1817 my $print_path_name_flag = 1817 my $print_path_name_flag =
1818 (defined($permissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $permissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL) 1818 (defined($effectivePermissionLevel) && defined($PRINT_FILE_NAMES_PERMISSION_LEVEL) && $effectivePermissionLevel >= $PRINT_FILE_NAMES_PERMISSION_LEVEL)
1819 || ( defined($inlist{ $studentLogin }) and ( $inlist{ $studentLogin }>0 ) ) ; 1819 || ( defined($inlist{ $studentLogin }) and ( $inlist{ $studentLogin }>0 ) ) ;
1820 1820
1821 if ( $print_path_name_flag ) { 1821 if ( $print_path_name_flag ) {
1822 $out = &M3("{\\bf ${probNum}. {\\footnotesize ($problemValue $points) $TeXFileName}}\\newline ", 1822 $out = &M3("{\\bf ${probNum}. {\\footnotesize ($problemValue $points) $TeXFileName}}\\newline ",
1823 " \\begin{rawhtml} ($problemValue $points) <B>$l2hFileName</B><BR>\\end{rawhtml}", 1823 " \\begin{rawhtml} ($problemValue $points) <B>$l2hFileName</B><BR>\\end{rawhtml}",

Legend:
Removed from v.6080  
changed lines
  Added in v.6085

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9