Browse Source

Clean desk

master
Ben Kurtovic 8 years ago
parent
commit
5c07360a57
2 changed files with 12 additions and 5 deletions
  1. +8
    -1
      lib/kgrader/cli.rb
  2. +4
    -4
      lib/kgrader/submission.rb

+ 8
- 1
lib/kgrader/cli.rb View File

@@ -38,7 +38,7 @@ module KGrader

def clean
clear_jail
# TODO: also purge uncommitted grades: set all graded to ungraded and delete all pending files
clean_desk
end

def clobber
@@ -73,5 +73,12 @@ module KGrader
def clear_desk
FileUtils.rm_rf Dir[File.join @fs.desk, '*', '']
end

def clean_desk
Dir[File.join @fs.desk, '*', '*', '*', '*', 'status.txt'].each do |fn|
File.write fn, "ungraded" if File.read(fn) == "graded"
end
FileUtils.rm_rf Dir[File.join @fs.desk, '*', '*', '*', '*', 'pending']
end
end
end

+ 4
- 4
lib/kgrader/submission.rb View File

@@ -73,19 +73,19 @@ module KGrader

private
def repo
File.join @root, "repo"
File.join @root, 'repo'
end

def statusfile
File.join @root, "status.txt"
File.join @root, 'status.txt'
end

def gradefile
File.join @root, "grade.txt"
File.join @root, 'grade.txt'
end

def pendingfile
File.join @root, "pending"
File.join @root, 'pending'
end

def revision


Loading…
Cancel
Save