diff --git a/app/controllers/concerns/submission_scoring.rb b/app/controllers/concerns/submission_scoring.rb index 6f4373e0..c8dfb0b3 100644 --- a/app/controllers/concerns/submission_scoring.rb +++ b/app/controllers/concerns/submission_scoring.rb @@ -7,7 +7,9 @@ module SubmissionScoring assessor = Assessor.new(execution_environment: submission.execution_environment) output = execute_test_file(file, submission) assessment = assessor.assess(output) - Testrun.new(submission: submission, file: file, passed: assessment[:passed] == assessment[:count], output: output[:stderr]).save + passed = ((assessment[:passed] == assessment[:count]) and (assessment[:score] > 0)) + testrun_output = passed ? nil : output[:stderr] + Testrun.new(submission: submission, file: file, passed: passed, output: testrun_output).save output.merge!(assessment) output.merge!(filename: file.name_with_extension, message: feedback_message(file, output[:score]), weight: file.weight) end