A code autograder for student homework submissions
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

rakefile 1.2 KiB

il y a 8 ans
il y a 8 ans
il y a 8 ans
il y a 8 ans
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. require_relative 'lib/kgrader'
  2. def cli
  3. KGrader::CLI.new Rake.application.original_dir
  4. end
  5. def parse_args(num, keywords = {})
  6. args, options = KGrader::parse_args ARGV.drop(1), num, keywords
  7. args.each { |arg| task arg.to_sym {} }
  8. args + [options]
  9. end
  10. task :default => :help do ; end
  11. task :help do
  12. puts %{usage:
  13. - rake list
  14. - rake roster <course> <semester> <rosterfile>
  15. - rake grade <course> <assignment> [semester=<...>] [students=<...>]
  16. [due=<...>] [fetch=<yes/no>] [regrade=<yes/no>]
  17. - rake commit <course> <assignment> [semester=<...>] [students=<...>]
  18. - rake clean
  19. - rake clobber}
  20. end
  21. task :list do
  22. cli.list
  23. end
  24. task :roster do
  25. course, semester, rosterfile = parse_args 3
  26. cli.roster course, semester, rosterfile
  27. end
  28. task :grade do
  29. course, assignment, options = parse_args 2,
  30. { :semester => :string, :students => :array, :due => :datetime,
  31. :fetch => :bool, :regrade => :bool }
  32. cli.grade course, options[:semester], assignment, options
  33. end
  34. task :commit do
  35. course, assignment, options = parse_args 2,
  36. { :semester => :string, :students => :array }
  37. cli.commit course, options[:semester], assignment, options
  38. end
  39. task :clean do
  40. cli.clean
  41. end
  42. task :clobber do
  43. cli.clobber
  44. end