| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Grades.pm,v 1.16 2005/09/17 16:32:43 jj Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Grades.pm,v 1.17 2005/09/19 17:11:26 jj 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. |
| … | |
… | |
| 146 | return("There is no additional grade information. <br> The message file $filePath cannot be found.") |
146 | return("There is no additional grade information. <br> The message file $filePath cannot be found.") |
| 147 | } |
147 | } |
| 148 | $text = join( '', <FILE>); |
148 | $text = join( '', <FILE>); |
| 149 | close(FILE); |
149 | close(FILE); |
| 150 | |
150 | |
|
|
151 | my $status_name = $ce->status_abbrev_to_name($ur->status); |
|
|
152 | $status_name = $ur->status unless defined $status_name; |
|
|
153 | |
| 151 | my $SID = $ur->student_id; |
154 | my $SID = $ur->student_id; |
| 152 | my $FN = $ur->first_name; |
155 | my $FN = $ur->first_name; |
| 153 | my $LN = $ur->last_name; |
156 | my $LN = $ur->last_name; |
| 154 | my $SECTION = $ur->section; |
157 | my $SECTION = $ur->section; |
| 155 | my $RECITATION = $ur->recitation; |
158 | my $RECITATION = $ur->recitation; |
| 156 | my $STATUS = $ur->status; |
159 | my $STATUS = $status_name; |
| 157 | my $EMAIL = $ur->email_address; |
160 | my $EMAIL = $ur->email_address; |
| 158 | my $LOGIN = $ur->user_id; |
161 | my $LOGIN = $ur->user_id; |
| 159 | my @COL = defined($rh_merge_data->{$SID}) ? @{$rh_merge_data->{$SID} } : (); |
162 | my @COL = defined($rh_merge_data->{$SID}) ? @{$rh_merge_data->{$SID} } : (); |
| 160 | unshift(@COL,""); ## this makes COL[1] the first column |
163 | unshift(@COL,""); ## this makes COL[1] the first column |
| 161 | |
164 | |
| 162 | my $endCol = @COL; |
165 | my $endCol = @COL; |
| 163 | # for safety, only evaluate special variables |
166 | # for safety, only evaluate special variables |
|
|
167 | # FIXME /e is not required for simple variable interpolation |
| 164 | my $msg = $text; |
168 | my $msg = $text; |
| 165 | $msg =~ s/(\$PAR)/<p>/ge; |
169 | $msg =~ s/(\$PAR)/<p>/ge; |
| 166 | $msg =~ s/(\$BR)/<br>/ge; |
170 | $msg =~ s/(\$BR)/<br>/ge; |
| 167 | |
171 | |
| 168 | $msg =~ s/\$SID/$SID/ge; |
172 | $msg =~ s/\$SID/$SID/ge; |