while (<GRADING>) {
s/#.*//;
next if /^\s*$/;
- my ($max_pct, $rubric_suffix) = /^\s*(\d+)%\t(.*)/ or die;
+ my ($max_pct, $rubric_suffix) = /^\s*(\d+(?:\.\d+)?)%\t(.*)/ or die;
my ($dir) = $rubric_suffix =~ /^(.*)\//;
my ($rubric_file) = "$src_dir/$rubric_suffix";
open (RUBRIC, '<', $rubric_file) or die "$rubric_file: open: $!\n";
push (@rubrics, '');
my ($pct) = ($score / $possible) * $max_pct;
- push (@summary, sprintf ("%-40s %3d/%3d %5.1f%%/%5.1f%%",
+ push (@summary, sprintf ("%-45s %3d/%3d %5.1f%%/%5.1f%%",
$rubric_suffix,
$score, $possible,
$pct, $max_pct));
close GRADING;
my ($sum_line)
- = "---------------------------------------- --- --- ------ ------";
+ = "--------------------------------------------- --- --- ------ ------";
unshift (@summary,
"SUMMARY BY TEST SET",
'',
- sprintf ("%-40s %3s %3s %6s %6s",
+ sprintf ("%-45s %3s %3s %6s %6s",
"Test Set", "Pts", "Max", "% Ttl", "% Max"),
$sum_line);
push (@summary,
$sum_line,
- sprintf ("%-40s %3s %3s %5.1f%%/%5.1f%%",
+ sprintf ("%-45s %3s %3s %5.1f%%/%5.1f%%",
'Total', '', '', $pct_actual, $pct_possible));
unshift (@rubrics,
}
}
push (@overall, sprintf ("TOTAL TESTING SCORE: %.1f%%", $pct_actual));
+if (sprintf ("%.1f", $pct_actual) eq sprintf ("%.1f", $pct_possible)) {
+ push (@overall, "ALL TESTED PASSED -- PERFECT SCORE");
+}
my (@divider) = ('', '- ' x 38, '');
if (open (OUTPUT, '<', "$test.output")) {
print "\nOUTPUT FROM $test:\n\n";
- my ($panics) = 0;
+ my ($panics, $boots) = (0, 0);
while (<OUTPUT>) {
if (/PANIC/ && ++$panics > 2) {
print "[...details of additional panic(s) omitted...]\n";
last;
}
print;
+ if (/Pintos booting/ && ++$boots > 1) {
+ print "[...details of reboot(s) omitted...]\n";
+ last;
+ }
}
close (OUTPUT);
}