A code autograder for student homework submissions
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

rakefile 1.2 KiB

8 yıl önce
8 yıl önce
8 yıl önce
8 yıl önce
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