| … | |
… | |
| 14 | |
14 | |
| 15 | use strict; |
15 | use strict; |
| 16 | use warnings; |
16 | use warnings; |
| 17 | use CGI qw(); |
17 | use CGI qw(); |
| 18 | use WeBWorK::Utils qw(readFile formatDateTime); |
18 | use WeBWorK::Utils qw(readFile formatDateTime); |
|
|
19 | use WeBWorK::Timing; |
| 19 | |
20 | |
| 20 | sub initialize { |
21 | sub initialize { |
| 21 | my ($self) = @_; |
22 | my ($self) = @_; |
| 22 | my $r = $self->{r}; |
23 | my $r = $self->{r}; |
| 23 | my $ce = $self->{ce}; |
24 | my $ce = $self->{ce}; |
| … | |
… | |
| 29 | my @scoringData = $self->scoreSet($setID); |
30 | my @scoringData = $self->scoreSet($setID); |
| 30 | $self->writeCSV("$scoringDir/s${setID}scr.csv", @scoringData); |
31 | $self->writeCSV("$scoringDir/s${setID}scr.csv", @scoringData); |
| 31 | } |
32 | } |
| 32 | } |
33 | } |
| 33 | } |
34 | } |
| 34 | |
|
|
| 35 | |
35 | |
| 36 | # If, some day, it becomes possible to assign a different number of problems to each student, this code |
36 | # If, some day, it becomes possible to assign a different number of problems to each student, this code |
| 37 | # will have to be rewritten some. |
37 | # will have to be rewritten some. |
| 38 | # $format can be any of "normal", "full", "info", or "totals". An undefined value defaults to "normal" |
38 | # $format can be any of "normal", "full", "info", or "totals". An undefined value defaults to "normal" |
| 39 | # normal: student info, the status of each problem in the set, and a "totals" column |
39 | # normal: student info, the status of each problem in the set, and a "totals" column |
| … | |
… | |
| 59 | |
59 | |
| 60 | # Initialize a two-dimensional array of the proper size |
60 | # Initialize a two-dimensional array of the proper size |
| 61 | for (my $i = 0; $i < keys(%users) + 7; $i++) { # 7 is how many descriptive fields there are in each column |
61 | for (my $i = 0; $i < keys(%users) + 7; $i++) { # 7 is how many descriptive fields there are in each column |
| 62 | push @scoringData, []; |
62 | push @scoringData, []; |
| 63 | } |
63 | } |
| 64 | |
|
|
| 65 | |
64 | |
| 66 | unless ($format eq "totals") { |
65 | unless ($format eq "totals") { |
| 67 | $scoringData[0][0] = "NO OF FIELDS"; |
66 | $scoringData[0][0] = "NO OF FIELDS"; |
| 68 | $scoringData[1][0] = "SET NAME"; |
67 | $scoringData[1][0] = "SET NAME"; |
| 69 | $scoringData[2][0] = "PROB NUMBER"; |
68 | $scoringData[2][0] = "PROB NUMBER"; |