|
|
@@ -27,20 +27,22 @@ module KGrader |
|
|
|
File.join course(name), '_config.yml' |
|
|
|
end |
|
|
|
|
|
|
|
def roster(course_name, semester) |
|
|
|
File.join desk, course_name, semester, '_roster.csv' |
|
|
|
end |
|
|
|
|
|
|
|
def courses |
|
|
|
Dir[File.join spec, '*', ''].map! { |fn| File.basename fn } |
|
|
|
end |
|
|
|
|
|
|
|
def assignments(course) |
|
|
|
Dir[File.join spec, course, '*', '_config.yml'].map! do |fn| |
|
|
|
def assignments(course_name) |
|
|
|
Dir[File.join course(course_name), '*', '_config.yml'].map! do |fn| |
|
|
|
File.basename File.dirname fn |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def semesters(course) |
|
|
|
Dir[File.join desk, course, '*', '_roster.csv'].map! do |fn| |
|
|
|
File.basename File.dirname fn |
|
|
|
end |
|
|
|
def semesters(course_name) |
|
|
|
Dir[roster course_name, '*'].map! { |fn| File.basename File.dirname fn } |
|
|
|
end |
|
|
|
|
|
|
|
def load(path) |
|
|
@@ -48,7 +50,7 @@ module KGrader |
|
|
|
when '.yml', '.yaml' |
|
|
|
YAML.load File.read(path) |
|
|
|
when '.csv' |
|
|
|
# TODO |
|
|
|
File.read(path).split("\n").map! { |line| line.split "," } |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|