Show More
Commit Description:
add option -A <opt> to box. This options allow more argument to be explicitly passed to the program...
Commit Description:
add option -A <opt> to box. This options allow more argument to be explicitly passed to the program We have to use this because if the argument we wish to pass to the program is option (in -? format), box will intepret it as its option and failed accordingly. be noted that, by the definition of getopt, these options will be put after original argument (check the code for more info)
References:
File last commit:
Show/Diff file:
Action:
lib/runner.rb | 67 lines | 1.8 KiB | text/x-ruby | RubyLexer |
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 #
# A runner drives the engine into various tasks.
#
module Grader
class Runner
def initialize(engine, grader_process=nil)
@engine = engine
@grader_process = grader_process
end
def grade_oldest_task
task = Task.get_inqueue_and_change_status(Task::STATUS_GRADING)
if task!=nil
@grader_process.report_active(task) if @grader_process!=nil
submission = Submission.find(task.submission_id)
@engine.grade(submission)
task.status_complete!
jittat
[grader] better status report...
r59 @grader_process.report_inactive(task) if @grader_process!=nil
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 end
return task
end
Jittat Fakcharoenphol
added contest mode
r93 def grade_problem(problem, options={})
add options for grading all submissions of a specific problem
r163 User.find_each do |u|
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 puts "user: #{u.login}"
Jittat Fakcharoenphol
added contest mode
r93 if options[:user_conditions]!=nil
con_proc = options[:user_conditions]
next if not con_proc.call(u)
end
add options for grading all submissions of a specific problem
r163 if options[:all_sub]
Submission.where(user_id: u.id,problem_id: problem.id).find_each do |sub|
@engine.grade(sub)
end
else
last_sub = Submission.find_last_by_user_and_problem(u.id,problem.id)
if last_sub!=nil
@engine.grade(last_sub)
end
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 end
end
end
jittat
[grader] +grade submission...
r61 def grade_submission(submission)
add more logging
r174 puts "Submission: #{submission.id} by #{submission.try(:user).try(:full_name)}"
jittat
[grader] +grade submission...
r61 @engine.grade(submission)
end
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 def grade_oldest_test_request
test_request = TestRequest.get_inqueue_and_change_status(Task::STATUS_GRADING)
if test_request!=nil
@grader_process.report_active(test_request) if @grader_process!=nil
@engine.grade(test_request)
test_request.status_complete!
jittat
[grader] better status report...
r59 @grader_process.report_inactive(test_request) if @grader_process!=nil
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 end
return test_request
end
end
end