Combine no_output and exit_status messages
This commit is contained in:
@ -147,10 +147,18 @@ class SubmissionsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
runner_socket.on :exit do |exit_code|
|
runner_socket.on :exit do |exit_code|
|
||||||
if @output.empty?
|
exit_statement =
|
||||||
client_socket.send_data JSON.dump({cmd: :write, stream: :stdout, data: "#{t('exercises.implement.no_output', timestamp: l(Time.zone.now, format: :short))}\n"})
|
if @output.empty? && exit_code.zero?
|
||||||
end
|
t('exercises.implement.no_output_exit_successful', timestamp: l(Time.zone.now, format: :short), exit_code: exit_code)
|
||||||
client_socket.send_data JSON.dump({cmd: :write, stream: :stdout, data: "#{t('exercises.implement.exit', exit_code: exit_code)}\n"})
|
elsif @output.empty?
|
||||||
|
t('exercises.implement.no_output_exit_failure', timestamp: l(Time.zone.now, format: :short), exit_code: exit_code)
|
||||||
|
elsif exit_code.zero?
|
||||||
|
t('exercises.implement.exit_successful', timestamp: l(Time.zone.now, format: :short), exit_code: exit_code)
|
||||||
|
else
|
||||||
|
t('exercises.implement.exit_failure', timestamp: l(Time.zone.now, format: :short), exit_code: exit_code)
|
||||||
|
end
|
||||||
|
client_socket.send_data JSON.dump({cmd: :write, stream: :stdout, data: "#{exit_statement}\n"})
|
||||||
|
|
||||||
close_client_connection(client_socket)
|
close_client_connection(client_socket)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -406,7 +406,10 @@ de:
|
|||||||
hint: Hinweis
|
hint: Hinweis
|
||||||
no_files: Die Aufgabe umfasst noch keine sichtbaren Dateien.
|
no_files: Die Aufgabe umfasst noch keine sichtbaren Dateien.
|
||||||
no_output: Die letzte Code-Ausführung terminierte am %{timestamp} ohne Ausgabe.
|
no_output: Die letzte Code-Ausführung terminierte am %{timestamp} ohne Ausgabe.
|
||||||
exit: Der Exit-Status war %{exit_code}.
|
no_output_exit_successful: Die letzte Code-Ausführung terminierte am %{timestamp} ohne Ausgabe and wurde erfolgreich beendet (Statuscode %{exit_code}).
|
||||||
|
no_output_exit_failure: Die letzte Code-Ausführung terminierte am %{timestamp} ohne Ausgabe und wurde mit einem Fehler beendet (Statuscode %{exit_code}).
|
||||||
|
exit_successful: Die letzte Code-Ausführung wurde erfolgreich beendet (Statuscode %{exit_code}).
|
||||||
|
exit_failure: Die letzte Code-Ausführung wurde mit einem Fehler beendet (Statuscode %{exit_code}).
|
||||||
no_output_yet: Bisher existiert noch keine Ausgabe.
|
no_output_yet: Bisher existiert noch keine Ausgabe.
|
||||||
output: Programm-Ausgabe
|
output: Programm-Ausgabe
|
||||||
passed_tests: Erfolgreiche Tests
|
passed_tests: Erfolgreiche Tests
|
||||||
|
@ -406,7 +406,10 @@ en:
|
|||||||
hint: Hint
|
hint: Hint
|
||||||
no_files: The exercise does not comprise visible files yet.
|
no_files: The exercise does not comprise visible files yet.
|
||||||
no_output: The last code run finished on %{timestamp} without any output.
|
no_output: The last code run finished on %{timestamp} without any output.
|
||||||
exit: The exit status was %{exit_code}.
|
no_output_exit_successful: The last code run finished on %{timestamp} without any output and exited successfully (status code %{exit_code}).
|
||||||
|
no_output_exit_failure: The last code run finished on %{timestamp} without any output and exited with a failure (status code %{exit_code}).
|
||||||
|
exit_successful: The last code run exited successfully (status code %{exit_code}).
|
||||||
|
exit_failure: The last code run exited with a failure (status code %{exit_code}).
|
||||||
no_output_yet: There is no output yet.
|
no_output_yet: There is no output yet.
|
||||||
output: Program Output
|
output: Program Output
|
||||||
passed_tests: Passed Tests
|
passed_tests: Passed Tests
|
||||||
|
Reference in New Issue
Block a user