| 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.11 2004/12/18 20:41:26 gage Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Grades.pm,v 1.12 2005/02/05 01:32:56 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. |
| … | |
… | |
| 210 | die "record for user $studentName not found" unless $studentRecord; |
210 | die "record for user $studentName not found" unless $studentRecord; |
| 211 | my $root = $ce->{webworkURLs}->{root}; |
211 | my $root = $ce->{webworkURLs}->{root}; |
| 212 | |
212 | |
| 213 | my @setIDs = sort $db->listUserSets($studentName); |
213 | my @setIDs = sort $db->listUserSets($studentName); |
| 214 | my $fullName = join("", $studentRecord->first_name," ", $studentRecord->last_name); |
214 | my $fullName = join("", $studentRecord->first_name," ", $studentRecord->last_name); |
|
|
215 | my $effectiveUser = $studentRecord->user_id(); |
| 215 | my $act_as_student_url = "$root/$courseName/?user=".$r->param("user"). |
216 | my $act_as_student_url = "$root/$courseName/?user=".$r->param("user"). |
| 216 | "&effectiveUser=".$studentRecord->user_id()."&key=".$r->param("key"); |
217 | "&effectiveUser=$effectiveUser&key=".$r->param("key"); |
| 217 | |
218 | |
| 218 | print CGI::h3($fullName ), |
219 | print CGI::h3($fullName ), |
| 219 | |
220 | |
| 220 | |
221 | |
| 221 | ############################################################### |
222 | ############################################################### |
| … | |
… | |
| 228 | my @rows; |
229 | my @rows; |
| 229 | my $max_problems=0; |
230 | my $max_problems=0; |
| 230 | |
231 | |
| 231 | foreach my $setName (@setIDs) { |
232 | foreach my $setName (@setIDs) { |
| 232 | my $act_as_student_set_url = "$root/$courseName/$setName/?user=".$r->param("user"). |
233 | my $act_as_student_set_url = "$root/$courseName/$setName/?user=".$r->param("user"). |
| 233 | "&effectiveUser=".$studentRecord->user_id()."&key=".$r->param("key"); |
234 | "&effectiveUser=$effectiveUser&key=".$r->param("key"); |
|
|
235 | |
|
|
236 | # get the set from the database so that we know if it's a gateway |
|
|
237 | # and if it's versioned, which determines how we display it. |
|
|
238 | my $set; |
|
|
239 | if ( $setName =~ /,v\d+$/ ) { # then it's versioned |
|
|
240 | $set = $db->getMergedVersionedSet( $effectiveUser, $setName ); |
|
|
241 | } else { |
|
|
242 | $set = $db->getMergedSet( $effectiveUser, $setName ); |
|
|
243 | } |
|
|
244 | |
|
|
245 | if ( defined( $set->assignment_type() ) && |
|
|
246 | $set->assignment_type() =~ /gateway/ ) { |
|
|
247 | # skip template sets |
|
|
248 | next if ( $setName !~ /,v\d+$/ ); |
|
|
249 | # reset the URL for gateways |
|
|
250 | if ( $set->assignment_type() eq 'proctored_gateway' ) { |
|
|
251 | $act_as_student_set_url =~ |
|
|
252 | s/($courseName)\//$1\/proctored_quiz_mode\//; |
|
|
253 | } else { |
|
|
254 | $act_as_student_set_url =~ |
|
|
255 | s/($courseName)\//$1\/quiz_mode\//; |
|
|
256 | } |
|
|
257 | } |
|
|
258 | |
| 234 | my $status = 0; |
259 | my $status = 0; |
| 235 | my $attempted = 0; |
260 | my $attempted = 0; |
| 236 | my $longStatus = ''; |
261 | my $longStatus = ''; |
| 237 | my $string = ''; |
262 | my $string = ''; |
| 238 | my $twoString = ''; |
263 | my $twoString = ''; |