[system] / trunk / webwork2 / lib / WeBWorK / ContentGenerator / Instructor / Scoring.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/ContentGenerator/Instructor/Scoring.pm

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

Revision 1388 Revision 1389
28 push @result, [split m/\s*,\s*/, $column]; 28 push @result, [split m/\s*,\s*/, $column];
29 } 29 }
30 return @result; 30 return @result;
31} 31}
32 32
33# Write a CSV file from an array in the same format that readCSV produces
33sub writeCSV { 34sub writeCSV {
34 my ($self, $filename, @csv) = @_; 35 my ($self, $filename, @csv) = @_;
35 open my $fh, ">", $filename; 36 open my $fh, ">", $filename;
36 foreach my $column (@csv) { 37 foreach my $column (@csv) {
37 my $maxLength = $self->maxLength($column); 38 my $maxLength = $self->maxLength($column);
39 print "\n"; 40 print "\n";
40 } 41 }
41 close $fh; 42 close $fh;
42} 43}
43 44
45# As soon as backwards compatability is no longer a concern and we don't expect to have
46# to use old ww1.x code to read the output anymore, I recommend switching to using
47# these routines, which are more versatile and compatable with other programs which
48# deal with CSV files.
44sub readStandardCSV { 49sub readStandardCSV {
45 my ($self, $filename) = @_; 50 my ($self, $filename) = @_;
46 my @result = (); 51 my @result = ();
47 my @colunms = split m/\n/, readFile($fileName); 52 my @colunms = split m/\n/, readFile($fileName);
48 foreach my $column (@columns) { 53 foreach my $column (@columns) {

Legend:
Removed from v.1388  
changed lines
  Added in v.1389

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9