diff --git a/app/assets/javascripts/editor.js b/app/assets/javascripts/editor.js index cf57c08f..f67d1fb5 100644 --- a/app/assets/javascripts/editor.js +++ b/app/assets/javascripts/editor.js @@ -1127,6 +1127,10 @@ $(function() { var initTurtle = function() { // todo guard clause if turtle is not required for the current exercise + + // clear canvas + // turtlecanvas.getContext("2d").clearRect(0, 0, turtlecanvas.width, turtlecanvas.height); + turtlescreen = new Turtle(websocket, turtlecanvas); if ($('#run').isPresent()) { $('#run').bind('click', hideCanvas); diff --git a/lib/docker_client.rb b/lib/docker_client.rb index 0c34f6e3..4a353394 100644 --- a/lib/docker_client.rb +++ b/lib/docker_client.rb @@ -218,7 +218,7 @@ class DockerClient """ Run commands by attaching a websocket to Docker. """ - command = submission.execution_environment.send(:"run_command") % command_substitutions(filename) + command = submission.execution_environment.run_command % command_substitutions(filename) create_workspace_files = proc { create_workspace_files(container, submission) } execute_websocket_command(command, create_workspace_files, block) end @@ -227,7 +227,7 @@ class DockerClient """ Stick to existing Docker API with exec command. """ - command = submission.execution_environment.send(:"test_command") % command_substitutions(filename) + command = submission.execution_environment.test_command % command_substitutions(filename) create_workspace_files = proc { create_workspace_files(container, submission) } execute_command(command, create_workspace_files, block) end diff --git a/lib/docker_container_pool.rb b/lib/docker_container_pool.rb index 320b9a1d..d027076b 100644 --- a/lib/docker_container_pool.rb +++ b/lib/docker_container_pool.rb @@ -83,10 +83,13 @@ class DockerContainerPool def self.refill_for_execution_environment(execution_environment) refill_count = [execution_environment.pool_size - @all_containers[execution_environment.id].length, config[:refill][:batch_size]].min if refill_count > 0 - Rails.logger.info('adding ' + refill_count.to_s + ' containers for ' + execution_environment.name ) + Rails.logger.info('Adding ' + refill_count.to_s + ' containers for execution_environment ' + execution_environment.name ) c = refill_count.times.map { create_container(execution_environment) } + Rails.logger.debug('Created containers: ' + c.to_s ) @containers[execution_environment.id] += c @all_containers[execution_environment.id] += c + Rails.logger.debug('@containers ' + @containers.object_id.to_s + ' has:'+ @containers[execution_environment.id].to_s) + Rails.logger.debug('@all_containers ' + @containers.object_id.to_s + ' has:'+ @all_containers[execution_environment.id].to_s) #refill_count.times.map { create_container(execution_environment) } end