Merge remote-tracking branch 'origin/master' into exercise-anomaly-detection

# Conflicts:
#	Gemfile.lock
This commit is contained in:
Maximilian Grundke
2018-03-08 12:12:06 +01:00
7 changed files with 43 additions and 5 deletions

View File

@@ -75,6 +75,11 @@ class SubmissionsController < ApplicationController
zio.write(file.content)
end
# zip exercise description
zio.put_next_entry(t('activerecord.models.exercise.one') + '.txt')
zio.write(@submission.exercise.title + "\r\n======================\r\n")
zio.write(@submission.exercise.description)
# zip .co file
zio.put_next_entry(".co")
zio.write(File.read id_file)
@@ -167,7 +172,7 @@ class SubmissionsController < ApplicationController
# if the command is 'client_kill', send it to docker otherwise.
begin
parsed = JSON.parse(data)
if parsed['cmd'] == 'client_kill'
if parsed.class == Hash && parsed['cmd'] == 'client_kill'
Rails.logger.debug("Client exited container.")
@docker_client.kill_container(result[:container])
else