A code autograder for student homework submissions
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

  1. module KGrader
  2. class Task
  3. def initialize(filesystem, course, semester, assignment)
  4. @fs = filesystem
  5. @course = course
  6. @semester = semester
  7. @assignment = assignment
  8. @students = @course.roster(@semester).students
  9. end
  10. def grade(options = {})
  11. students = @students
  12. students &= options[:students] unless options[:students].nil?
  13. due = options.fetch(:due, Time.now)
  14. fetch = options.fetch(:fetch, true)
  15. regrade = options.fetch(:regrade, false)
  16. # TODO
  17. puts "Grading #{@course.name}:#{@semester} assignment #{@assignment}..."
  18. puts "- students: #{students.inspect}"
  19. puts "- due: #{due}"
  20. puts "- fetch: #{fetch}"
  21. puts "- regrade: #{regrade}"
  22. end
  23. def commit(options = {})
  24. students = @students
  25. students &= options[:students] unless options[:students].nil?
  26. # TODO
  27. puts "Committing #{@course.name}:#{@semester} assignment #{@assignment}..."
  28. puts "- students: #{students.inspect}"
  29. end
  30. end
  31. end