Commit c37fe014 authored by Robert Ricci's avatar Robert Ricci

Script for making CSV from grades

Convenient for importing into spreadsheets
parent 3084f7a7
#!/usr/bin/perl -w
use strict;
# Hard coding these because students have submitted all kinds of things under
# erroneous names
my @hw = qw(hw1 hw2 hw3 hw4 hw5 hw6);
my @papers = qw(papers1 papers2 papers3 papers4);
my @labs = qw(lab1 lab2);
my @weeklies = qw(weekly1 weekly2 weekly3 weekly4);
my @projects = qw(final);
my @participation = qw(participation);
my @allhw = (@hw, @papers, @labs, @weeklies, @projects,
@participation);
# Thankfully, no erroneous students
my @students = `list-students`;
chomp @students;
# Header line
print ",", join(",",@allhw), "\n";
foreach my $student (@students) {
my @scores;
foreach my $hw (@allhw) {
my $branch = "$hw-graded-$student";
if (`git rev-parse -q --verify $branch` &&
`git show -s --format=%s $branch` =~ /^\s*Total score: (\d+(\.\d+)?)\s*\/\s*(\d+)/){
my ($score, $possible) = ($1,$3);
push @scores, $score;
} else {
push @scores, "X";
}
}
print "$student,", join(",",@scores), "\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment