diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 94678315..d5937215 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -147,8 +147,7 @@ class ExercisesController < ApplicationController private :user_by_code_harbor_token def exercise_params - params[:exercise][:expected_worktime_seconds] = params[:exercise][:expected_worktime_minutes].to_i * 60 - params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :hide_file_tree, :allow_file_creation, :allow_auto_completion, :title, :expected_difficulty, :expected_worktime_seconds, files_attributes: file_attributes, :tag_ids => []).merge(user_id: current_user.id, user_type: current_user.class.name) + params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :hide_file_tree, :allow_file_creation, :allow_auto_completion, :title, :expected_difficulty, files_attributes: file_attributes, :tag_ids => []).merge(user_id: current_user.id, user_type: current_user.class.name) end private :exercise_params diff --git a/app/views/exercises/_form.html.slim b/app/views/exercises/_form.html.slim index bb4aa851..646c359a 100644 --- a/app/views/exercises/_form.html.slim +++ b/app/views/exercises/_form.html.slim @@ -35,9 +35,6 @@ .form-group = f.label(t('activerecord.attributes.exercise.difficulty')) = f.number_field :expected_difficulty, in: 1..10, step: 1 - .form-group - = f.label(t('activerecord.attributes.exercise.worktime')) - = f.number_field "expected_worktime_minutes", value: @exercise.expected_worktime_seconds / 60, in: 1..1000, step: 1 h2 = t('exercises.form.tags') ul.list-unstyled.panel-group diff --git a/app/views/exercises/index.html.slim b/app/views/exercises/index.html.slim index 18c2cd98..47198fbb 100644 --- a/app/views/exercises/index.html.slim +++ b/app/views/exercises/index.html.slim @@ -18,7 +18,6 @@ h1 = Exercise.model_name.human(count: 2) th = t('activerecord.attributes.exercise.maximum_score') th = t('activerecord.attributes.exercise.tags') th = t('activerecord.attributes.exercise.difficulty') - th = t('activerecord.attributes.exercise.worktime') th = t('activerecord.attributes.exercise.public') - if policy(Exercise).batch_update? @@ -34,7 +33,6 @@ h1 = Exercise.model_name.human(count: 2) td = exercise.maximum_score td = exercise.exercise_tags.count td = exercise.expected_difficulty - td = (exercise.expected_worktime_seconds / 60).ceil td.public data-value=exercise.public? = symbol_for(exercise.public?) td = link_to(t('shared.edit'), edit_exercise_path(exercise)) if policy(exercise).edit? td = link_to(t('.implement'), implement_exercise_path(exercise)) if policy(exercise).implement? diff --git a/app/views/exercises/show.html.slim b/app/views/exercises/show.html.slim index 1efbd612..e3dfc7d5 100644 --- a/app/views/exercises/show.html.slim +++ b/app/views/exercises/show.html.slim @@ -20,7 +20,6 @@ h1 = row(label: 'exercise.embedding_parameters') do = content_tag(:input, nil, class: 'form-control', readonly: true, value: embedding_parameters(@exercise)) = row(label: 'exercise.difficulty', value: @exercise.expected_difficulty) -= row(label: 'exercise.worktime', value: "#{@exercise.expected_worktime_seconds/60} min") = row(label: 'exercise.tags', value: @exercise.exercise_tags.map{|et| "#{et.tag.name} (#{et.factor})"}.sort.join(", ")) h2 = t('activerecord.attributes.exercise.files') diff --git a/config/locales/de.yml b/config/locales/de.yml index 41d1097b..e4322037 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -41,7 +41,6 @@ de: allow_auto_completion: "Autovervollständigung aktivieren" allow_file_creation: "Dateierstellung erlauben" difficulty: Schwierigkeitsgrad - worktime: "vermutete Arbeitszeit in Minuten" token: "Aufgaben-Token" proxy_exercise: title: Title diff --git a/config/locales/en.yml b/config/locales/en.yml index ec6cf155..242ea312 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -41,7 +41,6 @@ en: allow_auto_completion: "Allow auto completion" allow_file_creation: "Allow file creation" difficulty: Difficulty - worktime: "Expected worktime in minutes" token: "Exercise Token" proxy_exercise: title: Title diff --git a/db/migrate/20171002131135_remove_expected_working_time.rb b/db/migrate/20171002131135_remove_expected_working_time.rb new file mode 100644 index 00000000..eb4bbcb4 --- /dev/null +++ b/db/migrate/20171002131135_remove_expected_working_time.rb @@ -0,0 +1,5 @@ +class RemoveExpectedWorkingTime < ActiveRecord::Migration + def change + remove_column :exercises, :expected_worktime_seconds + end +end diff --git a/db/schema.rb b/db/schema.rb index 465ca604..818030b1 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: 20170920145852) do +ActiveRecord::Schema.define(version: 20171002131135) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -133,9 +133,8 @@ ActiveRecord::Schema.define(version: 20170920145852) do t.string "token", limit: 255 t.boolean "hide_file_tree" t.boolean "allow_file_creation" - t.boolean "allow_auto_completion", default: false - t.integer "expected_worktime_seconds", default: 60 - t.integer "expected_difficulty", default: 1 + t.boolean "allow_auto_completion", default: false + t.integer "expected_difficulty", default: 1 end create_table "exercises_proxy_exercises", id: false, force: :cascade do |t|