Commit eb846f99 authored by Robert Ricci's avatar Robert Ricci

Add support for grading assignments that weren't turned in

If we try to grade a student who didn't submit anything, create an
orphan branch for grading.

Should probably check to make sure the student username is valid, to
avoid triggering this behavior if you typo a username
parent b830c146
......@@ -15,7 +15,21 @@ system("git show-ref --verify --quiet refs/heads/$localbranch");
if ($?) {
# Nope, create it
system "git checkout -b $hw-graded-$student $student/$hw-submit";
# Check to see if they've actually submitted or not
system("git show-ref --verify --quiet refs/remotes/$student/$hw-submit");
if ($?) {
# No, they didn't submit, we create an orphan branch
warn "WARNING: Student $student didn't submit, creating an orphan branch\n";
system "git checkout --orphan $hw-graded-$student";
# Checking out an orphan branch does some really stupid stuff, fix
# it up
system "git rm -r --cached .";
system "git clean -fdx";
} else {
# Yes, they did submit, base our branch on it
system "git checkout -b $hw-graded-$student $student/$hw-submit";
} else {
# Yep, check out the existing one
system "git checkout $localbranch\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