Merge pull request #129 from ThommyH/removeExpectedWorkingTime

removed expected working time from show/create/index of exercises
This commit is contained in:
rteusner
2017-11-15 14:26:12 +01:00
committed by GitHub
8 changed files with 9 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
class RemoveExpectedWorkingTime < ActiveRecord::Migration
def change
remove_column :exercises, :expected_worktime_seconds
end
end

View File

@ -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|