diff --git a/README.md b/README.md index 0da65662..65d36819 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ In order to execute code submissions using Docker, source code files are written - create production configuration files (*database.production.yml*, …) - customize *config/deploy/production.rb* if you want to deploy using [Capistrano](http://capistranorb.com/) -The application is compatible with MRI and JRuby. Due to superior parallelism, we recommend using JRuby. ## Useful service maintenance commands diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index 1fec0b1b..4f9d6a5b 100644 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -174,8 +174,14 @@ class SubmissionsController < ApplicationController def parse_message(message, output_stream, socket, recursive = true) begin parsed = JSON.parse(message) - socket.send_data message - Rails.logger.info('parse_message sent: ' + message) + if(parsed.class == Hash && parsed.key?('cmd')) + socket.send_data message + Rails.logger.info('parse_message sent: ' + message) + else + parsed = {'cmd'=>'write','stream'=>output_stream,'data'=>message} + socket.send_data JSON.dump(parsed) + Rails.logger.info('parse_message sent: ' + JSON.dump(parsed)) + end rescue JSON::ParserError => e # Check wether the message contains multiple lines, if true try to parse each line if ((recursive == true) && (message.include? "\n")) diff --git a/app/views/exercises/index.html.slim b/app/views/exercises/index.html.slim index 97847f1f..ae018e82 100644 --- a/app/views/exercises/index.html.slim +++ b/app/views/exercises/index.html.slim @@ -27,7 +27,7 @@ h1 = Exercise.model_name.human(count: 2) - @exercises.each do |exercise| tr data-id=exercise.id td = exercise.title - td = link_to_if(policy(exercise.author).show?, exercise.author, exercise.author) + td = link_to_if(exercise.author && policy(exercise.author).show?, exercise.author, exercise.author) td = link_to_if(exercise.execution_environment && policy(exercise.execution_environment).show?, exercise.execution_environment, exercise.execution_environment) td = exercise.files.teacher_defined_tests.count td = exercise.maximum_score diff --git a/app/views/request_for_comments/show.html.erb b/app/views/request_for_comments/show.html.erb index ab53ebd0..e4dc7f06 100644 --- a/app/views/request_for_comments/show.html.erb +++ b/app/views/request_for_comments/show.html.erb @@ -12,7 +12,7 @@ limit 1").first['id'].to_i submission = Submission.find(submission_id) %> - <%= user %> | <%= @request_for_comment.requested_at %> + <%= user.displayname %> | <%= @request_for_comment.requested_at %>

<% if @request_for_comment.question and not @request_for_comment.question == '' %> diff --git a/db/migrate/20160512131539_change_comment_text_attribute_to_text_datatype.rb b/db/migrate/20160512131539_change_comment_text_attribute_to_text_datatype.rb new file mode 100644 index 00000000..cc039c6a --- /dev/null +++ b/db/migrate/20160512131539_change_comment_text_attribute_to_text_datatype.rb @@ -0,0 +1,10 @@ +class ChangeCommentTextAttributeToTextDatatype < ActiveRecord::Migration + def up + change_column :comments, :text, :text + end + def down + # This might cause trouble if you have strings longer + # than 255 characters. + change_column :comments, :text, :string + end +end