transferred Code Ocean from original repository to GitHub

This commit is contained in:
Hauke Klement
2015-01-22 09:51:49 +01:00
commit 4cbf9970b1
683 changed files with 11979 additions and 0 deletions

View File

@ -0,0 +1,21 @@
default: &default
default_options:
from: codeocean@hpi.de
delivery_method: :smtp
development:
<<: *default
default_url_options:
host: localhost
production:
<<: *default
default_url_options:
host: CHANGE_ME
test:
<<: *default
default_url_options:
host: localhost
port: 3000
delivery_method: :test

34
config/application.rb Normal file
View File

@ -0,0 +1,34 @@
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 the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module CodeOcean
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# 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'
# 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]
config.autoload_paths << Rails.root.join('lib')
config.eager_load_paths << Rails.root.join('lib')
end
end

4
config/boot.rb Normal file
View File

@ -0,0 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

View File

@ -0,0 +1,18 @@
default: &default
adapter: postgresql
encoding: unicode
password: CHANGE_ME
pool: 16
username: postgres
development:
<<: *default
database: code_ocean_development
production:
<<: *default
database: code_ocean_production
test:
<<: *default
database: code_ocean_test

17
config/docker.yml.erb Normal file
View File

@ -0,0 +1,17 @@
default: &default
connection_timeout: 3
ports: !ruby/range 4500..4600
development:
<<: *default
host: tcp://192.168.23.75:2375
workspace_root: <%= File.join('/', 'shared', Rails.env) %>
production:
<<: *default
workspace_root: <%= Rails.root.join('tmp', 'files', Rails.env) %>
test:
<<: *default
host: tcp://192.168.23.75:2375
workspace_root: <%= File.join('/', 'shared', Rails.env) %>

5
config/environment.rb Normal file
View File

@ -0,0 +1,5 @@
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!

View File

@ -0,0 +1,37 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# 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.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# 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
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# 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.
config.action_view.raise_on_missing_translations = true
# Delete middleware in order to allow concurrent requests.
config.middleware.delete(Rack::Lock)
end

View File

@ -0,0 +1,83 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# 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.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# 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
# 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.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# 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 )
# 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.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# 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
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end

View File

@ -0,0 +1,39 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Do not eager load code on boot. This avoids loading your whole application
# just for the purpose of running a single test. If you are using a tool that
# 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
config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
end

View File

@ -0,0 +1,3 @@
YAML.load_file(Rails.root.join('config', 'action_mailer.yml'))[Rails.env].each do |key, value|
CodeOcean::Application.config.action_mailer.send(:"#{key}=", value.respond_to?(:symbolize_keys) ? value.symbolize_keys : value)
end

View File

@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

View File

@ -0,0 +1,3 @@
# Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :json

View File

@ -0,0 +1,4 @@
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]

View File

@ -0,0 +1,16 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# These inflection rules are supported but not enabled by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.acronym 'RESTful'
# end

View File

@ -0,0 +1,4 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf

View File

@ -0,0 +1,7 @@
unless Array.respond_to?(:to_h)
class Array
def to_h
Hash[self]
end
end
end

View File

@ -0,0 +1,3 @@
if CodeOcean::Application.config.action_mailer.delivery_method == :sendmail
CodeOcean::Application.config.action_mailer.sendmail_settings = CodeOcean::Config.new('sendmail').read
end

View File

@ -0,0 +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'

View File

@ -0,0 +1,3 @@
if CodeOcean::Application.config.action_mailer.delivery_method == :smtp
CodeOcean::Application.config.action_mailer.sendmail_settings = CodeOcean::Config.new('smtp').read
end

View File

@ -0,0 +1,437 @@
# The first thing you need to configure is which modules you need in your app.
# The default is nothing which will include only core features (password encryption, login/logout).
# Available submodules are: :user_activation, :http_basic_auth, :remember_me,
# :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external
Rails.application.config.sorcery.submodules = [:brute_force_protection, :remember_me, :reset_password, :user_activation]
# Here you can configure each submodule's features.
Rails.application.config.sorcery.configure do |config|
# -- core --
# What controller action to call for non-authenticated users. You can also
# override the 'not_authenticated' method of course.
# Default: `:not_authenticated`
#
# config.not_authenticated_action =
# When a non logged in user tries to enter a page that requires login, save
# the URL he wanted to reach, and send him there after login, using 'redirect_back_or_to'.
# Default: `true`
#
# config.save_return_to_url =
# Set domain option for cookies; Useful for remember_me submodule.
# Default: `nil`
#
# config.cookie_domain =
# -- session timeout --
# How long in seconds to keep the session alive.
# Default: `3600`
#
# config.session_timeout =
# Use the last action as the beginning of session timeout.
# Default: `false`
#
# config.session_timeout_from_last_action =
# -- http_basic_auth --
# What realm to display for which controller name. For example {"My App" => "Application"}
# Default: `{"application" => "Application"}`
#
# config.controller_to_realm_map =
# -- activity logging --
# will register the time of last user login, every login.
# Default: `true`
#
# config.register_login_time =
# will register the time of last user logout, every logout.
# Default: `true`
#
# config.register_logout_time =
# will register the time of last user action, every action.
# Default: `true`
#
# config.register_last_activity_time =
# -- external --
# What providers are supported by this app, i.e. [:twitter, :facebook, :github, :linkedin, :xing, :google, :liveid] .
# Default: `[]`
#
# config.external_providers =
# You can change it by your local ca_file. i.e. '/etc/pki/tls/certs/ca-bundle.crt'
# Path to ca_file. By default use a internal ca-bundle.crt.
# Default: `'path/to/ca_file'`
#
# config.ca_file =
# For information about LinkedIn API:
# - user info fields go to https://developer.linkedin.com/documents/profile-fields
# - access permissions go to https://developer.linkedin.com/documents/authentication#granting
#
# config.linkedin.key = ""
# config.linkedin.secret = ""
# config.linkedin.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=linkedin"
# config.linkedin.user_info_fields = ['first-name', 'last-name']
# config.linkedin.user_info_mapping = {first_name: "firstName", last_name: "lastName"}
# config.linkedin.access_permissions = ['r_basicprofile']
#
#
# For information about XING API:
# - user info fields go to https://dev.xing.com/docs/get/users/me
#
# config.xing.key = ""
# config.xing.secret = ""
# config.xing.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=xing"
# config.xing.user_info_mapping = {first_name: "first_name", last_name: "last_name"}
#
#
# Twitter wil not accept any requests nor redirect uri containing localhost,
# make sure you use 0.0.0.0:3000 to access your app in development
#
# config.twitter.key = ""
# config.twitter.secret = ""
# config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
# config.twitter.user_info_mapping = {:email => "screen_name"}
#
# config.facebook.key = ""
# config.facebook.secret = ""
# config.facebook.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=facebook"
# config.facebook.user_info_mapping = {:email => "name"}
# config.facebook.access_permissions = ["email", "publish_stream"]
#
# config.github.key = ""
# config.github.secret = ""
# config.github.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=github"
# config.github.user_info_mapping = {:email => "name"}
#
# config.google.key = ""
# config.google.secret = ""
# config.google.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=google"
# config.google.user_info_mapping = {:email => "email", :username => "name"}
#
# config.vk.key = ""
# config.vk.secret = ""
# config.vk.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=vk"
# config.vk.user_info_mapping = {:login => "domain", :name => "full_name"}
#
# To use liveid in development mode you have to replace mydomain.com with
# a valid domain even in development. To use a valid domain in development
# simply add your domain in your /etc/hosts file in front of 127.0.0.1
#
# config.liveid.key = ""
# config.liveid.secret = ""
# config.liveid.callback_url = "http://mydomain.com:3000/oauth/callback?provider=liveid"
# config.liveid.user_info_mapping = {:username => "name"}
# --- user config ---
config.user_config do |user|
# -- core --
# specify username attributes, for example: [:username, :email].
# Default: `[:email]`
#
# user.username_attribute_names =
# change *virtual* password attribute, the one which is used until an encrypted one is generated.
# Default: `:password`
#
# user.password_attribute_name =
# downcase the username before trying to authenticate, default is false
# Default: `false`
#
# user.downcase_username_before_authenticating =
# change default email attribute.
# Default: `:email`
#
# user.email_attribute_name =
# change default crypted_password attribute.
# Default: `:crypted_password`
#
# user.crypted_password_attribute_name =
# what pattern to use to join the password with the salt
# Default: `""`
#
# user.salt_join_token =
# change default salt attribute.
# Default: `:salt`
#
# user.salt_attribute_name =
# how many times to apply encryption to the password.
# Default: `nil`
#
# user.stretches =
# encryption key used to encrypt reversible encryptions such as AES256.
# WARNING: If used for users' passwords, changing this key will leave passwords undecryptable!
# Default: `nil`
#
# user.encryption_key =
# use an external encryption class.
# Default: `nil`
#
# user.custom_encryption_provider =
# encryption algorithm name. See 'encryption_algorithm=' for available options.
# Default: `:bcrypt`
#
# user.encryption_algorithm =
# make this configuration inheritable for subclasses. Useful for ActiveRecord's STI.
# Default: `false`
#
# user.subclasses_inherit_config =
# -- remember_me --
# allow the remember_me cookie to settable through AJAX
# Default: `true`
#
# user.remember_me_httponly =
# How long in seconds the session length will be
# Default: `604800`
#
# user.remember_me_for =
# -- user_activation --
# the attribute name to hold activation state (active/pending).
# Default: `:activation_state`
#
# user.activation_state_attribute_name =
# the attribute name to hold activation code (sent by email).
# Default: `:activation_token`
#
# user.activation_token_attribute_name =
# the attribute name to hold activation code expiration date.
# Default: `:activation_token_expires_at`
#
# user.activation_token_expires_at_attribute_name =
# how many seconds before the activation code expires. nil for never expires.
# Default: `nil`
#
# user.activation_token_expiration_period =
# your mailer class. Required.
# Default: `nil`
#
user.user_activation_mailer = UserMailer
# when true sorcery will not automatically
# email activation details and allow you to
# manually handle how and when email is sent.
# Default: `false`
#
# user.activation_mailer_disabled =
# activation needed email method on your mailer class.
# Default: `:activation_needed_email`
#
# user.activation_needed_email_method_name =
# activation success email method on your mailer class.
# Default: `:activation_success_email`
#
# user.activation_success_email_method_name =
# do you want to prevent or allow users that did not activate by email to login?
# Default: `true`
#
# user.prevent_non_active_users_to_login =
# -- reset_password --
# reset password code attribute name.
# Default: `:reset_password_token`
#
# user.reset_password_token_attribute_name =
# expires at attribute name.
# Default: `:reset_password_token_expires_at`
#
# user.reset_password_token_expires_at_attribute_name =
# when was email sent, used for hammering protection.
# Default: `:reset_password_email_sent_at`
#
# user.reset_password_email_sent_at_attribute_name =
# mailer class. Needed.
# Default: `nil`
#
user.reset_password_mailer = UserMailer
# reset password email method on your mailer class.
# Default: `:reset_password_email`
#
# user.reset_password_email_method_name =
# when true sorcery will not automatically
# email password reset details and allow you to
# manually handle how and when email is sent
# Default: `false`
#
# user.reset_password_mailer_disabled =
# how many seconds before the reset request expires. nil for never expires.
# Default: `nil`
#
# user.reset_password_expiration_period =
# hammering protection, how long to wait before allowing another email to be sent.
# Default: `5 * 60`
#
user.reset_password_time_between_emails = 1.minute
# -- brute_force_protection --
# Failed logins attribute name.
# Default: `:failed_logins_count`
#
# user.failed_logins_count_attribute_name =
# This field indicates whether user is banned and when it will be active again.
# Default: `:lock_expires_at`
#
# user.lock_expires_at_attribute_name =
# How many failed logins allowed.
# Default: `50`
#
# user.consecutive_login_retries_amount_limit =
# How long the user should be banned. in seconds. 0 for permanent.
# Default: `60 * 60`
#
# user.login_lock_time_period =
# Unlock token attribute name
# Default: `:unlock_token`
#
# user.unlock_token_attribute_name =
# Unlock token mailer method
# Default: `:send_unlock_token_email`
#
# user.unlock_token_email_method_name =
# when true sorcery will not automatically
# send email with unlock token
# Default: `false`
#
# user.unlock_token_mailer_disabled = true
# Unlock token mailer class
# Default: `nil`
#
# user.unlock_token_mailer = UserMailer
# -- activity logging --
# Last login attribute name.
# Default: `:last_login_at`
#
# user.last_login_at_attribute_name =
# Last logout attribute name.
# Default: `:last_logout_at`
#
# user.last_logout_at_attribute_name =
# Last activity attribute name.
# Default: `:last_activity_at`
#
# user.last_activity_at_attribute_name =
# How long since last activity is he user defined logged out?
# Default: `10 * 60`
#
# user.activity_timeout =
# -- external --
# Class which holds the various external provider data for this user.
# Default: `nil`
#
# user.authentications_class =
# User's identifier in authentications class.
# Default: `:user_id`
#
# user.authentications_user_id_attribute_name =
# Provider's identifier in authentications class.
# Default: `:provider`
#
# user.provider_attribute_name =
# User's external unique identifier in authentications class.
# Default: `:uid`
#
# user.provider_uid_attribute_name =
end
# This line must come after the 'user config' block.
# Define which model authenticates with sorcery.
config.user_class = 'InternalUser'
end

View File

@ -0,0 +1 @@
WillPaginate.per_page = 20

View File

@ -0,0 +1,14 @@
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = true
# end

321
config/locales/de.yml Normal file
View File

@ -0,0 +1,321 @@
de:
activerecord:
attributes:
consumer:
name: Name
oauth_key: OAuth Key
oauth_secret: OAuth Secret
error:
message: Nachricht
execution_environment:
docker_image: Docker-Image
exposed_ports: Zugängliche Ports
help: Hilfetext
name: Name
permitted_execution_time: Erlaubte Ausführungszeit (in Sekunden)
run_command: Ausführungsbefehl
test_command: Testbefehl
testing_framework: Testing-Framework
user: Autor
exercise:
description: Beschreibung
embedding_parameters: Parameter für LTI-Einbettung
execution_environment: Ausführungsumgebung
execution_environment_id: Ausführungsumgebung
files: Dateien
instructions: Anweisungen
maximum_score: Erreichbare Punktzahl
public: Öffentlich
reference_implementation: Reference Implementation
template_code: Template Code
template_test_code: Template Test Code
test_code: Test Code
title: Titel
user: Autor
external_user:
consumer: Konsument
email: E-Mail
name: Name
file:
content: Inhalt
feedback_message: Feedback-Nachricht
file_type: Dateityp
file_type_id: Dateityp
hidden: Versteckt
name: Name
path: Pfad
read_only: Schreibgeschützt
role: Rolle
weight: Punktzahl
file_type:
binary: Binär
editor_mode: Editor-Modus
executable: Ausführbar
file_extension: Dateiendung
indent_size: Einrückung
name: Name
renderable: Anzeigbar
user: Autor
hint:
locale: Sprache
message: Nachricht
name: Name
regular_expression: Regulärer Ausdruck
internal_user:
activated: Aktiviert
consumer: Konsument
consumer_id: Konsument
email: E-Mail
name: Name
password: Passwort
password_confirmation: Passwort-Bestätigung
role: Rolle
submission:
cause: Anlass
code: Code
exercise: Aufgabe
files: Dateien
score: Punktzahl
user: Autor
models:
consumer:
one: Konsument
other: Konsumenten
error:
one: Fehler
other: Fehler
execution_environment:
one: Ausführungsumgebung
other: Ausführungsumgebungen
exercise:
one: Aufgabe
other: Aufgaben
external_user:
one: Externer Nutzer
other: Externe Nutzer
file:
one: Datei
other: Dateien
file_type:
one: Dateityp
other: Dateitypen
hint:
one: Tipp
other: Tipps
internal_user:
one: Interner Nutzer
other: Interne Nutzer
submission:
one: Abgabe
other: Abgaben
errors:
messages:
together: 'muss zusammen mit %{attribute} definiert werden'
models:
exercise:
at_most_one_main_file: dürfen höchstens eine Hauptdatei enthalten
application:
not_authorized: Sie Sind nicht berechtigt, diese Aktion auszuführen.
breadcrumbs:
destroy_through_lti: Code-Abgabe
welcome: Startseite
consumers:
show:
link: Konsument
errors:
index:
count: Anzahl
execution_environments:
form:
hints:
command: <em>filename</em> wird automatisch durch den richtigen Dateinamen ersetzt.
docker_image: 'Wählen Sie ein Docker-Image aus der Liste oder fügen Sie ein neues hinzu, welches über <a href="https://hub.docker.com/" target="_blank">DockerHub</a> verfügbar ist.'
exposed_ports: Während der Ausführung sind diese Ports für den Nutzer zugänglich.
index:
shell: Shell
shell:
command: Befehl
headline: Shell
exercises:
editor:
confirm_start_over: Wollen Sie wirklich von vorne anfangen?
confirm_submit: Wollen Sie Ihren Code wirklich zur Bewertung abgeben?
create_file: Neue Datei
destroy_file: Datei löschen
download: Herunterladen
render: Anzeigen
run: Ausführen
run_failure: Bei der Ausführung Ihres Codes sind Fehler aufgetreten.
run_success: Ihr Code wurde fehlerfrei ausgeführt.
save: Speichern
score: Bewerten
start_over: Von vorne anfangen
stop: Stoppen
submit: Code zur Bewertung abgeben
test: Testen
timeout: 'Ihr Code benötigte länger als die erlaubten %{permitted_execution_time} Sekunden, um zu terminieren.'
tooltips:
save: Ihr Code wird automatisch gespeichert, wann immer Sie eine Datei herunterladen, ausführen oder testen. Explizites Speichern ist also selten notwendig.
editor_file_tree:
file_root: Deteien
file_form:
hints:
feedback_message: Diese Nachricht wird als Tipp zu fehlschlagenden Tests angezeigt.
path: 'Pfad der Datei im Projektverzeichnis. Kann auch leer gelassen werden.'
form:
add_file: Datei hinzufügen
implement:
default_feedback: Sehr gut. Alle Tests waren erfolgreich.
feedback: Feedback
file: 'Test-Datei <span class="number">%{number}</span>'
hint: Tipp
no_output: Die letzte Code-Ausführung hat keine Ausgabe erzeugt.
no_output_yet: Bisher existiert noch keine Ausgabe.
output: Programm-Ausgabe
passed_tests: Erfolgreiche Tests
progress: Fortschritt
results: Ergebnisse
start: Mit dem Programmieren beginnen
test_count: '<span class="number">%{count}</span> Test-Dateien wurden ausgeführt.'
workspace: Arbeitsbereich
index:
clone: Duplizieren
implement: Implementieren
statistics:
average_score: Durchschnittliche Punktzahl
final_submissions: Finale Abgaben
intermediate_submissions: Intermediäre Abgaben
participants: Bearbeitende Nutzer
users: '%{count} verschiedene Nutzer'
submit:
failure: Beim Übermitteln Ihrer Punktzahl ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.
files:
roles:
main_file: Hauptdatei
reference_implementation: Referenzimplementierung
regular_file: Normale Datei
teacher_defined_test: Test als Bewertungsgrundlage
user_defined_file: Benutzerdefinierte Datei
user_defined_test: Benutzerdefinierter Test
hints:
form:
hints:
message: Diese Nachricht wird als Erklärung des aufgetretenen Fehlers angezeigt. Platzhalter werden automatisch durch Funde des regulären Ausdrucks ersetzt.
regular_expression: Dieser reguläre Ausdruck wird auf die Fehlermeldung angewendet, um relevante Bezeicher zu extrahieren.
internal_users:
activate:
headline: Registrierung abschließen
submit: Passwort speichern
success: Sie haben Ihre Registrierung erfolgreich abgeschlossen.
forgot_password:
headline: Passwort zurücksetzen
submit: Anweisungen zum Zurücksetzen senden
success: Anweisungen zum Zurücksetzen Ihres Passworts wurden an Ihre E-Mail-Adresse gesendet.
reset_password:
headline: Passwort zurücksetzen
submit: Passwort speichern
success: Sie haben Ihr Passwort erfolgreich geändert.
show:
link: Profil
locales:
de: Deutsch
en: Englisch
mailers:
user_mailer:
activation_needed:
body: 'Bitte besuchen Sie %{link} und wählen Sie ein Passwort, um Ihre Registrierung abzuschließen.'
subject: Bitte schließen Sie Ihre Registrierung ab.
reset_password:
body: 'Bitte besuchen Sie %{link}, sofern Sie Ihr Passwort zurücksetzen wollen.'
subject: Anweisungen zum Zurücksetzen Ihres Passworts
sessions:
create:
failure: Fehlerhafte E-Mail oder Passwort.
success: Sie haben sich erfolgreich angemeldet.
create_through_lti:
session_with_outcome: 'Nachdem Sie die Aufgabe bearbeitet haben, wird ihre Bewertung an %{consumer} übermittelt.'
session_without_outcome: 'Dies ist eine Übungs-Session. Ihre Bewertung wird nicht an %{consumer} übermittelt.'
destroy:
link: Abmelden
success: Sie haben sich erfolgreich abgemeldet.
destroy_through_lti:
average_score: Durchschnittliche Punktzahl
final_submissions: Abgaben anderer Nutzer
finished_with_consumer: 'Sie können dieses Fenster nun schließen oder <a href="%{url}">zu %{consumer} zurückkehren</a>.'
finished_without_consumer: Sie können dieses Fenster nun schließen.
headline: Gut gemacht!
score: Ihre Punktzahl
success_with_outcome: 'Ihr Code wurde erfolgreich bewertet. Ihre Bewertung wurde an %{consumer} übermittelt.'
success_without_outcome: Ihr Code wurde erfolgreich bewertet.
new:
forgot_password: Passwort vergessen?
headline: Anmelden
link: Anmelden
remember_me: Angemeldet bleiben
oauth:
failure: Leider ist ein Fehler aufgetreten.
invalid_consumer: Ungültiger OAuth-Key.
invalid_exercise_token: Ungültiges Aufgaben-Token.
invalid_signature: Ungültige OAuth-Signatur.
missing_parameters: OAuth-Parameter fehlen.
used_nonce: Die Nonce wurde bereits verwendet.
shared:
actions: Aktionen
administration: Administration
already_signed_in: Sie sind bereits angemeldet.
apply_filters: Filter anwenden
confirm_destroy: Sind Sie sicher?
create: '%{model} erstellen'
created_at: Erstellt
destroy: Löschen
edit: Bearbeiten
errors_one: 'Beim Speichern ist ein Fehler aufgetreten'
errors_other: 'Beim Speichern sind %{count} Fehler aufgetreten'
help:
execution_environment_specific_help: 'Hilfe zu %{execution_environment}'
general_help: Allgemeine Hilfe
headline: Hilfe
link: Hilfe
index: Index
message_failure: Leider ist ein Fehler aufgetreten.
new: Hinzufügen
new_model: '%{model} hinzufügen'
number: Nummer
object_cloned: '%{model} wurde erfolgreich dupliziert.'
object_created: '%{model} wurde erfolgreich erstellt.'
object_destroyed: '%{model} wurde erfolgreich gelöscht.'
object_updated: '%{model} wurde erfolgreich bearbeitet.'
out_of: '<span class="number">%{value}</span> von <span class="number">%{maximum_value}</span>'
reset_filters: Filter zurücksetzen
resources: Ressourcen
show: Anzeigen
statistics: Statistiken
tooltips:
shortcut: 'Tastaturkürzel: %{shortcut}'
update: '%{model} aktualisieren'
upload_file: Datei hochladen
submissions:
causes:
assess: Bewertung
download: Download
file: Benutzerdefinierte Datei
render: Anzeige
run: Ausführung
save: Speichern
submit: Abgabe
test: Test
create:
success: Ihr Code wurde gespeichert.
statistics:
history: Punkteverlauf
percentage: Prozentzahl
siblings: Dazugehörige Abgaben
users:
roles:
admin: Administrator
learner: Lernender
teacher: Lehrer
will_paginate:
next_label: 'Nächste Seite &#8594;'
page_gap: '&hellip;'
previous_label: '&#8592; Vorherige Seite'

321
config/locales/en.yml Normal file
View File

@ -0,0 +1,321 @@
en:
activerecord:
attributes:
consumer:
name: Name
oauth_key: OAuth Key
oauth_secret: OAuth Secret
error:
message: Message
execution_environment:
docker_image: Docker Image
exposed_ports: Exposed Ports
help: Help Text
name: Name
permitted_execution_time: Permitted Execution Time (in Seconds)
run_command: Run Command
test_command: Test Command
testing_framework: Testing Framework
user: Author
exercise:
description: Description
embedding_parameters: LTI Embedding Parameters
execution_environment: Execution Environment
execution_environment_id: Execution Environment
files: Files
instructions: Instructions
maximum_score: Maximum Score
public: Public
reference_implementation: Reference Implementation
template_code: Template Code
template_test_code: Template Test Code
test_code: Test Code
title: Title
user: Author
external_user:
consumer: Consumer
email: Email
name: Name
file:
content: Content
feedback_message: Feedback Message
file_type: File Type
file_type_id: File Type
hidden: Hidden
name: Name
path: Path
read_only: Read-only
role: Role
weight: Score
file_type:
binary: Binary
editor_mode: Editor Mode
executable: Executable
file_extension: File Extension
indent_size: Indent Size
name: Name
renderable: Renderable
user: Author
hint:
locale: Locale
message: Message
name: Name
regular_expression: Regular Expression
internal_user:
activated: Activated
consumer: Consumer
consumer_id: Consumer
email: Email
name: Name
password: Password
password_confirmation: Passwort Confirmation
role: Role
submission:
cause: Cause
code: Code
exercise: Exercise
files: Files
score: Score
user: Author
models:
consumer:
one: Consumer
other: Consumers
error:
one: Error
other: Errors
execution_environment:
one: Execution Environment
other: Execution Environments
exercise:
one: Exercise
other: Exercises
external_user:
one: External User
other: External Users
file:
one: File
other: Files
file_type:
one: File Type
other: File Types
hint:
one: Hint
other: Hints
internal_user:
one: Internal User
other: Internal Users
submission:
one: Submission
other: Submissions
errors:
messages:
together: 'has to be set along with %{attribute}'
models:
exercise:
at_most_one_main_file: must include at most one main file
application:
not_authorized: You are not authorized to perform this action.
breadcrumbs:
destroy_through_lti: Code Submission
welcome: Cover Page
consumers:
show:
link: Consumer
errors:
index:
count: Count
execution_environments:
form:
hints:
command: <em>filename</em> is automatically replaced with the correct filename.
docker_image: Pick a Docker image listed above or add a new one which is available via <a href="https://hub.docker.com/" target="_blank">DockerHub</a>.
exposed_ports: During code execution these ports are accessible for the user.
index:
shell: Shell
shell:
command: Command
headline: Shell
exercises:
editor:
confirm_start_over: Do you really want to start over?
confirm_submit: Do you really want to submit your code for grading?
create_file: New File
destroy_file: Delete File
download: Download
render: Render
run: Run
run_failure: Your code ran with errors.
run_success: Your code ran without errors.
save: Save
score: Score
start_over: Start over
stop: Stop
submit: Submit Code For Assessment
test: Test
timeout: 'Your code took longer than the permitted %{permitted_execution_time} seconds to run.'
tooltips:
save: Your code is automatically saved whenever you download, run, or test it. Therefore, explicitly saving is rarely necessary.
editor_file_tree:
file_root: Files
file_form:
hints:
feedback_message: This message is used as a hint for failing tests.
path: "The file's path in the project tree. Can be left blank."
form:
add_file: Add file
implement:
default_feedback: Well done. All tests have been passed.
feedback: Feedback
file: 'Test File <span class="number">%{number}</span>'
hint: Hint
no_output: The last code run has not generated any output.
no_output_yet: There is no output yet.
output: Program Output
passed_tests: Passed Tests
progress: Progress
results: Results
start: Start Coding
test_count: '<span class="number">%{count}</span> test files have been executed.'
workspace: Workspace
index:
clone: Duplicate
implement: Implement
statistics:
average_score: Average Score
final_submissions: Final Submissions
intermediate_submissions: Intermediate Submissions
participants: Participating Users
users: '%{count} distinct users'
submit:
failure: An error occured while transmitting your score. Please try again later.
files:
roles:
main_file: Main File
reference_implementation: Reference Implementation
regular_file: Regular File
teacher_defined_test: Test for Assessment
user_defined_file: User-defined File
user_defined_test: User-defined Test
hints:
form:
hints:
message: This message is used as an error explanation. Placeholders are automatically replaced by regular expression matches.
regular_expression: This regular expression is used to extract relevant identifiers from the error message.
internal_users:
activate:
headline: Complete Registration
submit: Set Password
success: You successfully completed your registration.
forgot_password:
headline: Reset Password
submit: Send Password Reset Instructions
success: Instructions to reset your password have been sent to your email address.
reset_password:
headline: Reset Password
submit: Set Password
success: You successfully changed your password.
show:
link: Profile
locales:
de: German
en: English
mailers:
user_mailer:
activation_needed:
body: 'Please visit %{link} and set up a password in order to complete your registration.'
subject: Please complete your registration.
reset_password:
body: 'Please visit %{link} if you want to reset your password.'
subject: Password reset instructions
sessions:
create:
failure: Invalid email or password.
success: Successfully signed in.
create_through_lti:
session_with_outcome: 'After you have finished the exercise, your grade will be transmitted to %{consumer}.'
session_without_outcome: 'This is a practice session. Your grade will not be transmitted to %{consumer}.'
destroy:
link: Sign out
success: Successfully signed out.
destroy_through_lti:
average_score: Average Score
final_submissions: Other Users' Submissions
finished_with_consumer: 'You may close this window now or <a href="%{url}">return to %{consumer}</a>.'
finished_without_consumer: You may close this window now.
headline: Well done!
score: Your Score
success_with_outcome: 'Your code has been successfully assessed. Your grade has been transmitted to %{consumer}.'
success_without_outcome: Your code has been successfully assessed.
new:
forgot_password: Forgot password?
headline: Sign In
link: Sign In
remember_me: Remember me
oauth:
failure: 'Sorry, something went wrong.'
invalid_consumer: Invalid OAuth key.
invalid_exercise_token: Invalid exercise token.
invalid_signature: Invalid OAuth signature.
missing_parameters: Missing OAuth parameters.
used_nonce: Nonce has already been used.
shared:
actions: Actions
administration: Administration
already_signed_in: You are already signed in.
apply_filters: Apply filters
confirm_destroy: Are you sure?
create: 'Create %{model}'
created_at: Created At
destroy: Delete
edit: Edit
errors_one: 'An error prohibited this %{model} from being saved'
errors_other: '%{count} errors prohibited this %{model} from being saved'
help:
execution_environment_specific_help: 'Help for %{execution_environment}'
general_help: General Help
headline: Help
link: Help
index: Index
message_failure: 'Sorry, something went wrong.'
new: Add
new_model: 'Add %{model}'
number: Number
object_cloned: '%{model} has successfully been duplicated.'
object_created: '%{model} has successfully been created.'
object_destroyed: '%{model} has successfully been deleted.'
object_updated: '%{model} has successfully been updated.'
out_of: '<span class="number">%{value}</span> out of <span class="number">%{maximum_value}</span>'
reset_filters: Reset filters
resources: Resources
show: Show
statistics: Statistics
tooltips:
shortcut: 'Keyboard shortcut: %{shortcut}'
update: 'Update %{model}'
upload_file: Upload file
submissions:
causes:
assess: Scoring
download: Download
file: User-defined file
render: Rendering
run: Execution
save: Save
submit: Submission
test: Test
create:
success: Your code has been saved.
statistics:
history: Score History
percentage: Percentage
siblings: Associated Submissions
users:
roles:
admin: Administrator
learner: Learner
teacher: Teacher
will_paginate:
next_label: 'Next Page &#8594;'
page_gap: '&hellip;'
previous_label: '&#8592; Previous Page'

30
config/nginx.conf Normal file
View File

@ -0,0 +1,30 @@
upstream puma {
server unix:///var/www/app/shared/tmp/sockets/puma.sock;
}
server {
client_max_body_size 4G;
error_page 500 502 503 504 /500.html;
keepalive_timeout 10;
listen 80;
root /var/www/app/current/public;
server_name 172.16.23.112;
try_files $uri/index.html $uri @app;
location / {
access_log /var/www/app/current/log/nginx.access.log;
error_log /var/www/app/current/log/nginx.error.log;
proxy_http_version 1.1;
proxy_pass http://puma;
proxy_redirect off;
proxy_set_header Connection '';
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ^~ /assets/ {
add_header Cache-Control public;
expires max;
gzip_static on;
}
}

64
config/routes.rb Normal file
View File

@ -0,0 +1,64 @@
FILENAME_REGEXP = /[\w\.]+/ unless Kernel.const_defined?(:FILENAME_REGEXP)
Rails.application.routes.draw do
root to: 'application#welcome'
get '/help', to: 'application#help'
resources :consumers
resources :execution_environments do
member do
get :shell
post 'shell', as: :execute_command, to: :execute_command
end
resources :errors, only: [:create, :index, :show]
resources :hints
end
resources :exercises do
member do
post :clone
get :implement
get :statistics
post :submit
end
end
resources :external_users, only: [:index, :show]
namespace :code_ocean do
resources :files, only: [:create, :destroy]
end
resources :file_types
resources :internal_users do
member do
match 'activate', to: 'internal_users#activate', via: [:get, :patch, :put]
match 'reset_password', to: 'internal_users#reset_password', via: [:get, :patch, :put]
end
end
match '/forgot_password', as: 'forgot_password', to: 'internal_users#forgot_password', via: [:get, :post]
resources :sessions, only: [:create, :destroy, :new]
post '/lti/launch', as: 'lti_launch', to: 'sessions#create_through_lti'
get '/lti/return', as: 'lti_return', to: 'sessions#destroy_through_lti'
get '/sign_in', as: 'sign_in', to: 'sessions#new'
delete '/sign_out', as: 'sign_out', to: 'sessions#destroy'
resources :submissions, only: [:create, :index, :show] do
member do
get 'download/:filename', as: :download, 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 :score
get :statistics
post :stop
get 'test/:filename', as: :test, constraints: {filename: FILENAME_REGEXP}, to: :test
end
end
end

View File

@ -0,0 +1,22 @@
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
development:
secret_key_base: CHANGE_ME
test:
secret_key_base: CHANGE_ME
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: CHANGE_ME

View File

@ -0,0 +1,11 @@
default: &default
arguments: CHANGE_ME
development:
<<: *default
production:
<<: *default
test:
<<: *default

14
config/smtp.yml.example Normal file
View File

@ -0,0 +1,14 @@
default: &default
address: CHANGE_ME
password: CHANGE_ME
port: CHANGE_ME
user_name: CHANGE_ME
development:
<<: *default
production:
<<: *default
test:
<<: *default