Ensure output is shown even if no test command is given

This commit is contained in:
Sebastian Serth
2019-12-16 14:52:58 +01:00
parent ba4ea54e4f
commit fa229a581e
2 changed files with 6 additions and 1 deletions

View File

@ -150,6 +150,7 @@ CodeOceanEditorEvaluation = {
}
var element = this.findOrCreateOutputElement(index);
// Switch all four lines below to enable the output of images and render <IMG/> tags
if (!colorize) {
if (output.stdout !== undefined && output.stdout !== '') {
//element.append(output.stdout)

View File

@ -235,7 +235,11 @@ class SubmissionsController < ApplicationController
# Filter out information about run_command, test_command, user or working directory
run_command = @submission.execution_environment.run_command % command_substitutions(sanitize_filename)
test_command = @submission.execution_environment.test_command % command_substitutions(sanitize_filename)
unless /root|workspace|#{run_command}|#{test_command}/.match(message)
if test_command.blank?
# If no test command is set, use the run_command for the RegEx below. Otherwise, no output will be displayed!
test_command = run_command
end
unless /root|workspace|#{run_command.gsub('.', '\.')}|#{test_command}/.match(message)
parse_message(message, 'stdout', tubesock)
end
end