Save submission alongside structured error

This commit is contained in:
Maximilian Grundke
2018-01-30 11:28:29 +01:00
parent 7768d34275
commit 40fe5c4e69
5 changed files with 24 additions and 14 deletions

View File

@ -202,17 +202,6 @@ class SubmissionsController < ApplicationController
tubesock.close
end
def extract_errors
unless @raw_output.blank?
@submission.exercise.execution_environment.error_templates.each do |template|
pattern = Regexp.new(template.signature).freeze
if pattern.match(@raw_output)
StructuredError.create_from_template(template, @raw_output)
end
end
end
end
def handle_message(message, tubesock, container)
@raw_output ||= ''
@run_output ||= ''
@ -289,6 +278,17 @@ class SubmissionsController < ApplicationController
end
end
def extract_errors
unless @raw_output.blank?
@submission.exercise.execution_environment.error_templates.each do |template|
pattern = Regexp.new(template.signature).freeze
if pattern.match(@raw_output)
StructuredError.create_from_template(template, @raw_output, @submission)
end
end
end
end
def score
hijack do |tubesock|
Thread.new { EventMachine.run } unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?