From c2a816968ed7567fb0b1b327f92687493a88b7b6 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 8 Nov 2020 14:53:50 +0100 Subject: [PATCH] Show no run output for Python execenv --- app/controllers/submissions_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index 7035de30..fff49cc3 100644 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -220,7 +220,9 @@ class SubmissionsController < ApplicationController # save the output of this "run" as a "testrun" (scoring runs are saved in submission_scoring.rb) save_run_output - if @run_output.blank? + # For Python containers, the @run_output is '{"cmd":"exit"}' as a string. + # If this is the case, we should consider it as blank + if @run_output.blank? || @run_output&.strip == '{"cmd":"exit"}' @raw_output ||= '' @run_output ||= '' parse_message t('exercises.implement.no_output', timestamp: l(Time.now, format: :short)), 'stdout', tubesock