updated rails from 4.1.13 to 4.2.5. This is required for rails to make use of new features in postgres 9.5
@Ralf TODO: migration /Users/groucho/Documents/HPI/workspace/Xikolo-CodeOcean/codeocean/db/migrate/20160204111716_add_user_to_code_harbor_link.rb is broken. A reference is made to table users which does not exist. Workaround: run rake db:schema:load before running db:migrate. Still this should be fixed.
This commit is contained in:
2
Gemfile
2
Gemfile
@ -21,7 +21,7 @@ gem 'pg', platform: :ruby
|
||||
gem 'pry-byebug'
|
||||
gem 'puma', '~> 2.15.3'
|
||||
gem 'pundit'
|
||||
gem 'rails', '~> 4.1.13'
|
||||
gem 'rails', '4.2.5'
|
||||
gem 'rails-i18n', '~> 4.0.0'
|
||||
gem 'ransack'
|
||||
gem 'rubytree'
|
||||
|
135
Gemfile.lock
135
Gemfile.lock
@ -2,40 +2,49 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
ZenTest (4.11.0)
|
||||
actionmailer (4.1.14.1)
|
||||
actionpack (= 4.1.14.1)
|
||||
actionview (= 4.1.14.1)
|
||||
actionmailer (4.2.5)
|
||||
actionpack (= 4.2.5)
|
||||
actionview (= 4.2.5)
|
||||
activejob (= 4.2.5)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
actionpack (4.1.14.1)
|
||||
actionview (= 4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
rack (~> 1.5.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.5)
|
||||
actionview (= 4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
actionview (4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
activemodel (4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
activejob (4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
globalid (>= 0.3.0)
|
||||
activemodel (4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.1.14.1)
|
||||
activemodel (= 4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
arel (~> 5.0.0)
|
||||
activerecord (4.2.5)
|
||||
activemodel (= 4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
arel (~> 6.0)
|
||||
activerecord-jdbc-adapter (1.3.19)
|
||||
activerecord (>= 2.2)
|
||||
activerecord-jdbcpostgresql-adapter (1.3.19)
|
||||
activerecord-jdbc-adapter (~> 1.3.19)
|
||||
jdbc-postgres (>= 9.1)
|
||||
activesupport (4.1.14.1)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
activesupport (4.2.5)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
arel (5.0.1.20140414130214)
|
||||
ast (2.2.0)
|
||||
arel (6.0.4)
|
||||
ast (2.3.0)
|
||||
autotest-rails (4.2.1)
|
||||
ZenTest (~> 4.5)
|
||||
bcrypt (3.1.10)
|
||||
@ -97,6 +106,7 @@ GEM
|
||||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
concurrent-ruby (1.0.2)
|
||||
concurrent-ruby (1.0.2-java)
|
||||
concurrent-ruby-ext (1.0.2)
|
||||
concurrent-ruby (~> 1.0.2)
|
||||
d3-rails (3.5.11)
|
||||
@ -128,6 +138,8 @@ GEM
|
||||
ffi (1.9.10)
|
||||
ffi (1.9.10-java)
|
||||
forgery (0.6.0)
|
||||
globalid (0.3.7)
|
||||
activesupport (>= 4.1.0)
|
||||
highline (1.7.8)
|
||||
hike (1.2.3)
|
||||
http-cookie (1.0.2)
|
||||
@ -150,13 +162,15 @@ GEM
|
||||
json (1.8.3-java)
|
||||
jwt (1.5.1)
|
||||
kramdown (1.9.0)
|
||||
mail (2.6.3)
|
||||
mime-types (>= 1.16, < 3)
|
||||
loofah (2.0.3)
|
||||
nokogiri (>= 1.5.9)
|
||||
mail (2.6.4)
|
||||
mime-types (>= 1.16, < 4)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.99)
|
||||
mini_portile2 (2.0.0)
|
||||
minitest (5.9.0)
|
||||
multi_json (1.11.2)
|
||||
mime-types (2.99.3)
|
||||
mini_portile2 (2.1.0)
|
||||
minitest (5.10.1)
|
||||
multi_json (1.12.1)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (2.0.0)
|
||||
net-scp (1.2.1)
|
||||
@ -164,9 +178,9 @@ GEM
|
||||
net-ssh (3.0.2)
|
||||
netrc (0.10.3)
|
||||
newrelic_rpm (3.14.3.313)
|
||||
nokogiri (1.6.7.2)
|
||||
mini_portile2 (~> 2.0.0.rc2)
|
||||
nokogiri (1.6.7.2-java)
|
||||
nokogiri (1.7.0)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
nokogiri (1.7.0-java)
|
||||
nyan-cat-formatter (0.11)
|
||||
rspec (>= 2.99, >= 2.14.2, < 4)
|
||||
oauth (0.4.7)
|
||||
@ -178,7 +192,7 @@ GEM
|
||||
rack (>= 1.2, < 3)
|
||||
pagedown-rails (1.1.4)
|
||||
railties (> 3.1)
|
||||
parser (2.3.0.6)
|
||||
parser (2.3.3.1)
|
||||
ast (~> 2.2)
|
||||
pg (0.18.4)
|
||||
polyamorous (1.3.0)
|
||||
@ -200,31 +214,40 @@ GEM
|
||||
puma (2.15.3-java)
|
||||
pundit (1.1.0)
|
||||
activesupport (>= 3.0.0)
|
||||
rack (1.5.5)
|
||||
rack (1.6.5)
|
||||
rack-mini-profiler (0.10.1)
|
||||
rack (>= 1.2.0)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.1.14.1)
|
||||
actionmailer (= 4.1.14.1)
|
||||
actionpack (= 4.1.14.1)
|
||||
actionview (= 4.1.14.1)
|
||||
activemodel (= 4.1.14.1)
|
||||
activerecord (= 4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
rails (4.2.5)
|
||||
actionmailer (= 4.2.5)
|
||||
actionpack (= 4.2.5)
|
||||
actionview (= 4.2.5)
|
||||
activejob (= 4.2.5)
|
||||
activemodel (= 4.2.5)
|
||||
activerecord (= 4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.1.14.1)
|
||||
sprockets-rails (~> 2.0)
|
||||
railties (= 4.2.5)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
rails-dom-testing (1.0.8)
|
||||
activesupport (>= 4.2.0.beta, < 5.0)
|
||||
nokogiri (~> 1.6)
|
||||
rails-deprecated_sanitizer (>= 1.0.1)
|
||||
rails-html-sanitizer (1.0.3)
|
||||
loofah (~> 2.0)
|
||||
rails-i18n (4.0.8)
|
||||
i18n (~> 0.7)
|
||||
railties (~> 4.0)
|
||||
railties (4.1.14.1)
|
||||
actionpack (= 4.1.14.1)
|
||||
activesupport (= 4.1.14.1)
|
||||
railties (4.2.5)
|
||||
actionpack (= 4.2.5)
|
||||
activesupport (= 4.2.5)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rainbow (2.1.0)
|
||||
rake (10.5.0)
|
||||
rainbow (2.2.1)
|
||||
rake (12.0.0)
|
||||
ransack (1.7.0)
|
||||
actionpack (>= 3.0)
|
||||
activerecord (>= 3.0)
|
||||
@ -243,7 +266,7 @@ GEM
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-autotest (1.0.0)
|
||||
rspec-core (>= 2.99.0.beta1, < 4.0.0)
|
||||
rspec-core (3.4.2)
|
||||
rspec-core (3.4.4)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-expectations (3.4.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
@ -260,14 +283,15 @@ GEM
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-support (3.4.1)
|
||||
rubocop (0.37.2)
|
||||
parser (>= 2.3.0.4, < 3.0)
|
||||
rubocop (0.46.0)
|
||||
parser (>= 2.3.1.1, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 1.99.1, < 3.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (~> 0.3)
|
||||
rubocop-rspec (1.4.0)
|
||||
ruby-progressbar (1.7.5)
|
||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||
rubocop-rspec (1.9.0)
|
||||
rubocop (>= 0.42.0)
|
||||
ruby-progressbar (1.8.1)
|
||||
rubytree (0.9.7)
|
||||
json (~> 1.8)
|
||||
structured_warnings (~> 0.2)
|
||||
@ -316,7 +340,7 @@ GEM
|
||||
net-ssh (>= 2.8.0)
|
||||
structured_warnings (0.2.0)
|
||||
temple (0.7.6)
|
||||
thor (0.19.1)
|
||||
thor (0.19.4)
|
||||
thread_safe (0.3.5)
|
||||
thread_safe (0.3.5-java)
|
||||
tilt (1.4.1)
|
||||
@ -334,7 +358,7 @@ GEM
|
||||
unf_ext
|
||||
unf (0.1.4-java)
|
||||
unf_ext (0.0.7.1)
|
||||
unicode-display_width (0.3.1)
|
||||
unicode-display_width (1.1.2)
|
||||
web-console (2.3.0)
|
||||
activemodel (>= 4.0)
|
||||
binding_of_caller (>= 0.7.2)
|
||||
@ -395,7 +419,7 @@ DEPENDENCIES
|
||||
puma (~> 2.15.3)
|
||||
pundit
|
||||
rack-mini-profiler
|
||||
rails (~> 4.1.13)
|
||||
rails (= 4.2.5)
|
||||
rails-i18n (~> 4.0.0)
|
||||
rake
|
||||
ransack
|
||||
@ -419,3 +443,6 @@ DEPENDENCIES
|
||||
uglifier (>= 1.3.0)
|
||||
web-console (~> 2.0)
|
||||
will_paginate (~> 3.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.13.6
|
||||
|
@ -104,10 +104,8 @@ module Lti
|
||||
lti_parameter = LtiParameter.where(consumers_id: session[:consumer_id],
|
||||
external_user_id: session[:external_user_id],
|
||||
exercises_id: exercise_id).first
|
||||
lti_parameters = JSON.parse(lti_parameter.lti_parameters)
|
||||
|
||||
consumer = Consumer.find_by(id: session[:consumer_id])
|
||||
provider = build_tool_provider(consumer: consumer, parameters: lti_parameters)
|
||||
provider = build_tool_provider(consumer: consumer, parameters: lti_parameter.lti_parameters)
|
||||
# provider = build_tool_provider(consumer: Consumer.find_by(id: session[:consumer_id]), parameters: session[:lti_parameters])
|
||||
if provider.nil?
|
||||
{status: 'error'}
|
||||
|
@ -162,12 +162,10 @@ class ExercisesController < ApplicationController
|
||||
external_user_id: session[:external_user_id],
|
||||
exercises_id: @submission.exercise_id).first
|
||||
|
||||
lti_parameters = JSON.parse(lti_parameter.lti_parameters)
|
||||
|
||||
path = lti_return_path(consumer_id: session[:consumer_id],
|
||||
submission_id: @submission.id,
|
||||
url: consumer_return_url(build_tool_provider(consumer: Consumer.find_by(id: session[:consumer_id]),
|
||||
parameters: lti_parameters)))
|
||||
parameters: lti_parameter.lti_parameters)))
|
||||
# parameters: session[:lti_parameters])))
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(path) }
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env ruby
|
||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
|
29
bin/setup
Executable file
29
bin/setup
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'pathname'
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
||||
|
||||
Dir.chdir APP_ROOT do
|
||||
# This script is a starting point to setup your application.
|
||||
# Add necessary setup steps to this file:
|
||||
|
||||
puts "== Installing dependencies =="
|
||||
system "gem install bundler --conservative"
|
||||
system "bundle check || bundle install"
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
# unless File.exist?("config/database.yml")
|
||||
# system "cp config/database.yml.sample config/database.yml"
|
||||
# end
|
||||
|
||||
puts "\n== Preparing database =="
|
||||
system "bin/rake db:setup"
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system "rm -f log/*"
|
||||
system "rm -rf tmp/cache"
|
||||
|
||||
puts "\n== Restarting application server =="
|
||||
system "touch tmp/restart.txt"
|
||||
end
|
@ -1,13 +1,6 @@
|
||||
require File.expand_path('../boot', __FILE__)
|
||||
|
||||
# Pick the frameworks you want:
|
||||
require "active_model/railtie"
|
||||
require "active_record/railtie"
|
||||
require "action_controller/railtie"
|
||||
require "action_mailer/railtie"
|
||||
require "action_view/railtie"
|
||||
require "sprockets/railtie"
|
||||
# require "rails/test_unit/railtie"
|
||||
require 'rails/all'
|
||||
|
||||
# Require the gems listed in Gemfile, including any gems
|
||||
# you've limited to :test, :development, or :production.
|
||||
@ -21,17 +14,22 @@ module CodeOcean
|
||||
|
||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||
config.time_zone = 'Berlin'
|
||||
config.time_zone = 'UTC'
|
||||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
config.i18n.available_locales = [:de, :en]
|
||||
|
||||
# Do not swallow errors in after_commit/after_rollback callbacks.
|
||||
config.active_record.raise_in_transactional_callbacks = true
|
||||
|
||||
config.autoload_paths << Rails.root.join('lib')
|
||||
config.eager_load_paths << Rails.root.join('lib')
|
||||
config.assets.precompile += %w( markdown-buttons.png )
|
||||
|
||||
config.active_record.schema_format = :sql
|
||||
|
||||
case (RUBY_ENGINE)
|
||||
when 'ruby'
|
||||
# ...
|
||||
@ -43,5 +41,3 @@ module CodeOcean
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Rails.application.config.assets.precompile += %w( markdown-buttons.png )
|
@ -1,4 +1,3 @@
|
||||
# Set up gems listed in the Gemfile.
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||
|
||||
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
||||
require 'bundler/setup' # Set up gems listed in the Gemfile.
|
||||
|
@ -1,7 +1,8 @@
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
config.web_console.whitelisted_ips = '192.168.0.0/16'
|
||||
config.web_console.whitelisted_ips = '192.168.0.0/16'
|
||||
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the web server when you make code changes.
|
||||
@ -13,8 +14,8 @@ Rails.application.configure do
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
config.action_mailer.perform_deliveries = true
|
||||
|
||||
config.action_mailer.perform_deliveries = false
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
@ -25,12 +26,21 @@ Rails.application.configure do
|
||||
# Raise an error on page load if there are pending migrations.
|
||||
config.active_record.migration_error = :page_load
|
||||
|
||||
# Debug mode disables concatenation and preprocessing of assets.
|
||||
# This option may cause significant delays in view rendering with a large
|
||||
# number of complex assets.
|
||||
config.assets.debug = true
|
||||
|
||||
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||
# yet still be able to expire them through the digest params.
|
||||
config.assets.digest = true
|
||||
|
||||
# Adds additional error checking when serving assets at runtime.
|
||||
# Checks for improperly declared sprockets dependencies.
|
||||
# Raises helpful error messages.
|
||||
config.assets.raise_runtime_errors = true
|
||||
|
||||
# Raise errors for missing translations.
|
||||
# Raises error for missing translations
|
||||
config.action_view.raise_on_missing_translations = true
|
||||
|
||||
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
|
||||
|
@ -16,11 +16,13 @@ Rails.application.configure do
|
||||
|
||||
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||
# Add `rack-cache` to your Gemfile before enabling this.
|
||||
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
||||
# For large-scale production use, consider using a caching reverse proxy like
|
||||
# NGINX, varnish or squid.
|
||||
# config.action_dispatch.rack_cache = true
|
||||
|
||||
# Disable Rails's static asset server (Apache or nginx will already do this).
|
||||
config.serve_static_assets = false
|
||||
# Disable serving static files from the `/public` folder by default since
|
||||
# Apache or NGINX already handles this.
|
||||
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
||||
|
||||
# Compress JavaScripts and CSS.
|
||||
config.assets.js_compressor = :uglifier
|
||||
@ -29,20 +31,21 @@ Rails.application.configure do
|
||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||
config.assets.compile = false
|
||||
|
||||
# Generate digests for assets URLs.
|
||||
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
||||
# yet still be able to expire them through the digest params.
|
||||
config.assets.digest = true
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
config.assets.version = '1.0'
|
||||
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
||||
|
||||
# Specifies the header that your server uses for sending files.
|
||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
|
||||
# Set to :debug to see everything in the log.
|
||||
# Use the lowest log level to ensure availability of diagnostic information
|
||||
# when problems arise.
|
||||
config.log_level = :error
|
||||
|
||||
# Prepend all log lines with the following tags.
|
||||
@ -55,11 +58,7 @@ Rails.application.configure do
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||
# config.assets.precompile += %w( search.js )
|
||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
@ -72,9 +71,6 @@ Rails.application.configure do
|
||||
# Send deprecation notices to registered listeners.
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
# Disable automatic flushing of the log to improve performance.
|
||||
# config.autoflush_log = false
|
||||
|
||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||
config.log_formatter = ::Logger::Formatter.new
|
||||
|
||||
|
@ -12,8 +12,8 @@ Rails.application.configure do
|
||||
# preloads Rails for running tests, you may have to set it to true.
|
||||
config.eager_load = false
|
||||
|
||||
# Configure static asset server for tests with Cache-Control for performance.
|
||||
config.serve_static_assets = true
|
||||
# Configure static file server for tests with Cache-Control for performance.
|
||||
config.serve_static_files = true
|
||||
config.static_cache_control = 'public, max-age=3600'
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
@ -31,6 +31,9 @@ Rails.application.configure do
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Randomize the order test cases are executed.
|
||||
config.active_support.test_order = :random
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
|
12
config/initializers/assets.rb
Normal file
12
config/initializers/assets.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = '1.0'
|
||||
|
||||
# Add additional assets to the asset load path
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( search.js )
|
||||
Rails.application.config.assets.precompile += %w( markdown-buttons.png )
|
@ -1,3 +1,3 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails.application.config.session_store :cookie_store, key: '_hands-on-programming_session'
|
||||
Rails.application.config.session_store :cookie_store, key: '_code_ocean_session'
|
||||
|
@ -1,3 +1,24 @@
|
||||
# Files in the config/locales directory are used for internationalization
|
||||
# and are automatically loaded by Rails. If you want to use locales other
|
||||
# than English, add the necessary files in this directory.
|
||||
#
|
||||
# To use the locales, use `I18n.t`:
|
||||
#
|
||||
# I18n.t 'hello'
|
||||
#
|
||||
# In views, this is aliased to just `t`:
|
||||
#
|
||||
# <%= t('hello') %>
|
||||
#
|
||||
# To use a different locale, set it with `I18n.locale`:
|
||||
#
|
||||
# I18n.locale = :es
|
||||
#
|
||||
# This would use the information in config/locales/es.yml.
|
||||
#
|
||||
# To learn more, please read the Rails Internationalization guide
|
||||
# available at http://guides.rubyonrails.org/i18n.html.
|
||||
|
||||
en:
|
||||
activerecord:
|
||||
attributes:
|
||||
@ -466,3 +487,4 @@ en:
|
||||
previous_label: '← Previous Page'
|
||||
file_template:
|
||||
no_template_label: "Empty File"
|
||||
|
||||
|
@ -3,7 +3,7 @@ FILENAME_REGEXP = /[\w\.]+/ unless Kernel.const_defined?(:FILENAME_REGEXP)
|
||||
Rails.application.routes.draw do
|
||||
resources :file_templates do
|
||||
collection do
|
||||
get 'by_file_type/:file_type_id', as: :by_file_type, to: :by_file_type
|
||||
get 'by_file_type/:file_type_id', as: :by_file_type, action: :by_file_type
|
||||
end
|
||||
end
|
||||
resources :code_harbor_links
|
||||
@ -42,7 +42,7 @@ Rails.application.routes.draw do
|
||||
resources :execution_environments do
|
||||
member do
|
||||
get :shell
|
||||
post 'shell', as: :execute_command, to: :execute_command
|
||||
post 'shell', as: :execute_command, action: :execute_command
|
||||
get :statistics
|
||||
end
|
||||
|
||||
@ -94,14 +94,14 @@ Rails.application.routes.draw do
|
||||
|
||||
resources :submissions, only: [:create, :index, :show] do
|
||||
member do
|
||||
get 'download', as: :download, to: :download
|
||||
get 'download/:filename', as: :download_file, constraints: {filename: FILENAME_REGEXP}, to: :download_file
|
||||
get 'render/:filename', as: :render, constraints: {filename: FILENAME_REGEXP}, to: :render_file
|
||||
get 'run/:filename', as: :run, constraints: {filename: FILENAME_REGEXP}, to: :run
|
||||
get 'download', as: :download, action: :download
|
||||
get 'download/:filename', as: :download_file, constraints: {filename: FILENAME_REGEXP}, action: :download_file
|
||||
get 'render/:filename', as: :render, constraints: {filename: FILENAME_REGEXP}, action: :render_file
|
||||
get 'run/:filename', as: :run, constraints: {filename: FILENAME_REGEXP}, action: :run
|
||||
get :score
|
||||
get :statistics
|
||||
post :stop
|
||||
get 'test/:filename', as: :test, constraints: {filename: FILENAME_REGEXP}, to: :test
|
||||
get 'test/:filename', as: :test, constraints: {filename: FILENAME_REGEXP}, action: :test
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -4,9 +4,9 @@ class CreateLtiParameters < ActiveRecord::Migration
|
||||
t.string :external_user_id
|
||||
t.belongs_to :consumers
|
||||
t.belongs_to :exercises
|
||||
t.column :lti_parameters, :jsonb
|
||||
t.jsonb :lti_parameters, null: false, default: '{}'
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
143
db/schema.rb
143
db/schema.rb
@ -11,13 +11,13 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20161216131239) do
|
||||
ActiveRecord::Schema.define(version: 20161214144837) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "code_harbor_links", force: true do |t|
|
||||
t.string "oauth2token"
|
||||
create_table "code_harbor_links", force: :cascade do |t|
|
||||
t.string "oauth2token", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "user_id"
|
||||
@ -25,10 +25,10 @@ ActiveRecord::Schema.define(version: 20161216131239) do
|
||||
|
||||
add_index "code_harbor_links", ["user_id"], name: "index_code_harbor_links_on_user_id", using: :btree
|
||||
|
||||
create_table "comments", force: true do |t|
|
||||
create_table "comments", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "file_id"
|
||||
t.string "user_type"
|
||||
t.string "user_type", limit: 255
|
||||
t.integer "row"
|
||||
t.integer "column"
|
||||
t.text "text"
|
||||
@ -39,15 +39,15 @@ ActiveRecord::Schema.define(version: 20161216131239) do
|
||||
add_index "comments", ["file_id"], name: "index_comments_on_file_id", using: :btree
|
||||
add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree
|
||||
|
||||
create_table "consumers", force: true do |t|
|
||||
t.string "name"
|
||||
create_table "consumers", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "oauth_key"
|
||||
t.string "oauth_secret"
|
||||
t.string "oauth_key", limit: 255
|
||||
t.string "oauth_secret", limit: 255
|
||||
end
|
||||
|
||||
create_table "errors", force: true do |t|
|
||||
create_table "errors", force: :cascade do |t|
|
||||
t.integer "execution_environment_id"
|
||||
t.text "message"
|
||||
t.datetime "created_at"
|
||||
@ -57,123 +57,123 @@ ActiveRecord::Schema.define(version: 20161216131239) do
|
||||
|
||||
add_index "errors", ["submission_id"], name: "index_errors_on_submission_id", using: :btree
|
||||
|
||||
create_table "execution_environments", force: true do |t|
|
||||
t.string "docker_image"
|
||||
t.string "name"
|
||||
create_table "execution_environments", force: :cascade do |t|
|
||||
t.string "docker_image", limit: 255
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "run_command"
|
||||
t.string "test_command"
|
||||
t.string "testing_framework"
|
||||
t.string "run_command", limit: 255
|
||||
t.string "test_command", limit: 255
|
||||
t.string "testing_framework", limit: 255
|
||||
t.text "help"
|
||||
t.string "exposed_ports"
|
||||
t.string "exposed_ports", limit: 255
|
||||
t.integer "permitted_execution_time"
|
||||
t.integer "user_id"
|
||||
t.string "user_type"
|
||||
t.string "user_type", limit: 255
|
||||
t.integer "pool_size"
|
||||
t.integer "file_type_id"
|
||||
t.integer "memory_limit"
|
||||
t.boolean "network_enabled"
|
||||
end
|
||||
|
||||
create_table "exercises", force: true do |t|
|
||||
create_table "exercises", force: :cascade do |t|
|
||||
t.text "description"
|
||||
t.integer "execution_environment_id"
|
||||
t.string "title"
|
||||
t.string "title", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "user_id"
|
||||
t.text "instructions"
|
||||
t.boolean "public"
|
||||
t.string "user_type"
|
||||
t.string "token"
|
||||
t.string "user_type", limit: 255
|
||||
t.string "token", limit: 255
|
||||
t.boolean "hide_file_tree"
|
||||
t.boolean "allow_file_creation"
|
||||
t.boolean "allow_auto_completion", default: false
|
||||
t.boolean "allow_auto_completion", default: false
|
||||
end
|
||||
|
||||
create_table "external_users", force: true do |t|
|
||||
create_table "external_users", force: :cascade do |t|
|
||||
t.integer "consumer_id"
|
||||
t.string "email"
|
||||
t.string "external_id"
|
||||
t.string "name"
|
||||
t.string "email", limit: 255
|
||||
t.string "external_id", limit: 255
|
||||
t.string "name", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "file_templates", force: true do |t|
|
||||
t.string "name"
|
||||
create_table "file_templates", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.text "content"
|
||||
t.integer "file_type_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "file_types", force: true do |t|
|
||||
t.string "editor_mode"
|
||||
t.string "file_extension"
|
||||
create_table "file_types", force: :cascade do |t|
|
||||
t.string "editor_mode", limit: 255
|
||||
t.string "file_extension", limit: 255
|
||||
t.integer "indent_size"
|
||||
t.string "name"
|
||||
t.string "name", limit: 255
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "executable"
|
||||
t.boolean "renderable"
|
||||
t.string "user_type"
|
||||
t.string "user_type", limit: 255
|
||||
t.boolean "binary"
|
||||
end
|
||||
|
||||
create_table "files", force: true do |t|
|
||||
create_table "files", force: :cascade do |t|
|
||||
t.text "content"
|
||||
t.integer "context_id"
|
||||
t.string "context_type"
|
||||
t.string "context_type", limit: 255
|
||||
t.integer "file_id"
|
||||
t.integer "file_type_id"
|
||||
t.boolean "hidden"
|
||||
t.string "name"
|
||||
t.string "name", limit: 255
|
||||
t.boolean "read_only"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "native_file"
|
||||
t.string "role"
|
||||
t.string "hashed_content"
|
||||
t.string "feedback_message"
|
||||
t.string "native_file", limit: 255
|
||||
t.string "role", limit: 255
|
||||
t.string "hashed_content", limit: 255
|
||||
t.string "feedback_message", limit: 255
|
||||
t.float "weight"
|
||||
t.string "path"
|
||||
t.string "path", limit: 255
|
||||
t.integer "file_template_id"
|
||||
end
|
||||
|
||||
add_index "files", ["context_id", "context_type"], name: "index_files_on_context_id_and_context_type", using: :btree
|
||||
|
||||
create_table "hints", force: true do |t|
|
||||
create_table "hints", force: :cascade do |t|
|
||||
t.integer "execution_environment_id"
|
||||
t.string "locale"
|
||||
t.string "locale", limit: 255
|
||||
t.text "message"
|
||||
t.string "name"
|
||||
t.string "regular_expression"
|
||||
t.string "name", limit: 255
|
||||
t.string "regular_expression", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
end
|
||||
|
||||
create_table "internal_users", force: true do |t|
|
||||
create_table "internal_users", force: :cascade do |t|
|
||||
t.integer "consumer_id"
|
||||
t.string "email"
|
||||
t.string "name"
|
||||
t.string "role"
|
||||
t.string "email", limit: 255
|
||||
t.string "name", limit: 255
|
||||
t.string "role", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "crypted_password"
|
||||
t.string "salt"
|
||||
t.integer "failed_logins_count", default: 0
|
||||
t.string "crypted_password", limit: 255
|
||||
t.string "salt", limit: 255
|
||||
t.integer "failed_logins_count", default: 0
|
||||
t.datetime "lock_expires_at"
|
||||
t.string "unlock_token"
|
||||
t.string "remember_me_token"
|
||||
t.string "unlock_token", limit: 255
|
||||
t.string "remember_me_token", limit: 255
|
||||
t.datetime "remember_me_token_expires_at"
|
||||
t.string "reset_password_token"
|
||||
t.string "reset_password_token", limit: 255
|
||||
t.datetime "reset_password_token_expires_at"
|
||||
t.datetime "reset_password_email_sent_at"
|
||||
t.string "activation_state"
|
||||
t.string "activation_token"
|
||||
t.string "activation_state", limit: 255
|
||||
t.string "activation_token", limit: 255
|
||||
t.datetime "activation_token_expires_at"
|
||||
end
|
||||
|
||||
@ -182,29 +182,38 @@ ActiveRecord::Schema.define(version: 20161216131239) do
|
||||
add_index "internal_users", ["remember_me_token"], name: "index_internal_users_on_remember_me_token", using: :btree
|
||||
add_index "internal_users", ["reset_password_token"], name: "index_internal_users_on_reset_password_token", using: :btree
|
||||
|
||||
create_table "request_for_comments", force: true do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.integer "exercise_id", null: false
|
||||
t.integer "file_id", null: false
|
||||
create_table "lti_parameters", force: :cascade do |t|
|
||||
t.string "external_user_id"
|
||||
t.integer "consumers_id"
|
||||
t.integer "exercises_id"
|
||||
t.jsonb "lti_parameters", default: {}, null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "user_type"
|
||||
end
|
||||
|
||||
create_table "request_for_comments", force: :cascade do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.integer "exercise_id", null: false
|
||||
t.integer "file_id", null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "user_type", limit: 255
|
||||
t.text "question"
|
||||
t.boolean "solved"
|
||||
t.integer "submission_id"
|
||||
end
|
||||
|
||||
create_table "submissions", force: true do |t|
|
||||
create_table "submissions", force: :cascade do |t|
|
||||
t.integer "exercise_id"
|
||||
t.float "score"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "cause"
|
||||
t.string "user_type"
|
||||
t.string "cause", limit: 255
|
||||
t.string "user_type", limit: 255
|
||||
end
|
||||
|
||||
create_table "testruns", force: true do |t|
|
||||
create_table "testruns", force: :cascade do |t|
|
||||
t.boolean "passed"
|
||||
t.text "output"
|
||||
t.integer "file_id"
|
||||
|
1227
db/structure.sql
Normal file
1227
db/structure.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -77,8 +77,8 @@ debian_installer/setup_debian_7_create_tables.sh
|
||||
|
||||
# Protocol TCP Host port 3030, guest port 3000, name CodeOcean, other left blank.
|
||||
# That's all!
|
||||
# Start Puma server on VM
|
||||
# rails s -p 8080
|
||||
# Start Puma server on VM (since we upgraded to rails 4.2.5, it is necessary to specify the address here as well. Otherwise, we can't connect from the host machine)
|
||||
# rails s -b 0.0.0.0 -p 8080
|
||||
|
||||
# To connect to Ruby app use
|
||||
#http://127.0.0.1:3030
|
||||
|
Reference in New Issue
Block a user