From 7ec3443adf3b51926d6c18d75c5167c26657ac6a Mon Sep 17 00:00:00 2001
From: Ralf Teusner
Date: Thu, 12 May 2016 16:23:40 +0200
Subject: [PATCH 1/6] Change comments relation to use text data type for
attribute text
---
...9_change_comment_text_attribute_to_text_datatype.rb | 10 ++++++++++
db/schema.rb | 9 ++-------
2 files changed, 12 insertions(+), 7 deletions(-)
create mode 100644 db/migrate/20160512131539_change_comment_text_attribute_to_text_datatype.rb
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
diff --git a/db/schema.rb b/db/schema.rb
index bcf1a675..104a1469 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160510145341) do
+ActiveRecord::Schema.define(version: 20160512131539) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -31,7 +31,7 @@ ActiveRecord::Schema.define(version: 20160510145341) do
t.string "user_type"
t.integer "row"
t.integer "column"
- t.string "text"
+ t.text "text"
t.datetime "created_at"
t.datetime "updated_at"
end
@@ -92,8 +92,6 @@ ActiveRecord::Schema.define(version: 20160510145341) do
t.boolean "allow_file_creation"
end
- add_index "exercises", ["execution_environment_id"], name: "test3", using: :btree
-
create_table "external_users", force: true do |t|
t.integer "consumer_id"
t.string "email"
@@ -204,9 +202,6 @@ ActiveRecord::Schema.define(version: 20160510145341) do
t.string "user_type"
end
- add_index "submissions", ["exercise_id"], name: "test1", where: "((user_type)::text = 'ExternalUser'::text)", using: :btree
- add_index "submissions", ["exercise_id"], name: "test2", using: :btree
-
create_table "teams", force: true do |t|
t.string "name"
t.datetime "created_at"
From 04515a0547a65c8e82284f79976d0ceae23b359c Mon Sep 17 00:00:00 2001
From: Ralf Teusner
Date: Thu, 12 May 2016 16:27:22 +0200
Subject: [PATCH 2/6] Fixed typo in Gemfile
---
Gemfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Gemfile b/Gemfile
index 540b11b2..bf089d6c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -37,7 +37,7 @@ gem 'tubesock'
gem 'faye-websocket'
gem 'nokogiri'
gem 'd3-rails'
-gem 'rest-client’
+gem 'rest-client'
group :development do
gem 'better_errors', platform: :ruby
From 5f721e6a6bd67399641ce08a9b0a7c57a9a78d73 Mon Sep 17 00:00:00 2001
From: tstaubitz
Date: Thu, 12 May 2016 20:44:04 +0200
Subject: [PATCH 3/6] Update README.md
---
README.md | 1 -
1 file changed, 1 deletion(-)
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
From b6cd797772191fc170ee5c224add0829bb3ceda6 Mon Sep 17 00:00:00 2001
From: Ralf Teusner
Date: Tue, 31 May 2016 11:17:11 +0200
Subject: [PATCH 4/6] Show displayname instead of username in
request_for_comment
---
app/views/request_for_comments/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 == '' %>
From 8158d60d307d348095f16933b91ba769938aaa61 Mon Sep 17 00:00:00 2001
From: Ralf Teusner
Date: Wed, 1 Jun 2016 11:30:42 +0200
Subject: [PATCH 5/6] also write "parsable json" to the frontend console if it
does not have a valid command set (solves the issue when just printing an
array in java, it is not shown anywhere).
---
app/controllers/submissions_controller.rb | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
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"))
From a75227c8f7ffcaab447ca5c4b69aaae887a6eafe Mon Sep 17 00:00:00 2001
From: Maximilian Grundke
Date: Wed, 8 Jun 2016 11:49:34 +0200
Subject: [PATCH 6/6] Don't call author policy if author is missing
---
app/views/exercises/index.html.slim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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