Merge pull request #129 from ThommyH/removeExpectedWorkingTime
removed expected working time from show/create/index of exercises
This commit is contained in:
@ -147,8 +147,7 @@ class ExercisesController < ApplicationController
|
|||||||
private :user_by_code_harbor_token
|
private :user_by_code_harbor_token
|
||||||
|
|
||||||
def exercise_params
|
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, 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, :expected_worktime_seconds, files_attributes: file_attributes, :tag_ids => []).merge(user_id: current_user.id, user_type: current_user.class.name)
|
|
||||||
end
|
end
|
||||||
private :exercise_params
|
private :exercise_params
|
||||||
|
|
||||||
|
@ -35,9 +35,6 @@
|
|||||||
.form-group
|
.form-group
|
||||||
= f.label(t('activerecord.attributes.exercise.difficulty'))
|
= f.label(t('activerecord.attributes.exercise.difficulty'))
|
||||||
= f.number_field :expected_difficulty, in: 1..10, step: 1
|
= 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')
|
h2 = t('exercises.form.tags')
|
||||||
ul.list-unstyled.panel-group
|
ul.list-unstyled.panel-group
|
||||||
|
@ -18,7 +18,6 @@ h1 = Exercise.model_name.human(count: 2)
|
|||||||
th = t('activerecord.attributes.exercise.maximum_score')
|
th = t('activerecord.attributes.exercise.maximum_score')
|
||||||
th = t('activerecord.attributes.exercise.tags')
|
th = t('activerecord.attributes.exercise.tags')
|
||||||
th = t('activerecord.attributes.exercise.difficulty')
|
th = t('activerecord.attributes.exercise.difficulty')
|
||||||
th = t('activerecord.attributes.exercise.worktime')
|
|
||||||
th
|
th
|
||||||
= t('activerecord.attributes.exercise.public')
|
= t('activerecord.attributes.exercise.public')
|
||||||
- if policy(Exercise).batch_update?
|
- if policy(Exercise).batch_update?
|
||||||
@ -34,7 +33,6 @@ h1 = Exercise.model_name.human(count: 2)
|
|||||||
td = exercise.maximum_score
|
td = exercise.maximum_score
|
||||||
td = exercise.exercise_tags.count
|
td = exercise.exercise_tags.count
|
||||||
td = exercise.expected_difficulty
|
td = exercise.expected_difficulty
|
||||||
td = (exercise.expected_worktime_seconds / 60).ceil
|
|
||||||
td.public data-value=exercise.public? = symbol_for(exercise.public?)
|
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('shared.edit'), edit_exercise_path(exercise)) if policy(exercise).edit?
|
||||||
td = link_to(t('.implement'), implement_exercise_path(exercise)) if policy(exercise).implement?
|
td = link_to(t('.implement'), implement_exercise_path(exercise)) if policy(exercise).implement?
|
||||||
|
@ -20,7 +20,6 @@ h1
|
|||||||
= row(label: 'exercise.embedding_parameters') do
|
= row(label: 'exercise.embedding_parameters') do
|
||||||
= content_tag(:input, nil, class: 'form-control', readonly: true, value: embedding_parameters(@exercise))
|
= content_tag(:input, nil, class: 'form-control', readonly: true, value: embedding_parameters(@exercise))
|
||||||
= row(label: 'exercise.difficulty', value: @exercise.expected_difficulty)
|
= 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(", "))
|
= row(label: 'exercise.tags', value: @exercise.exercise_tags.map{|et| "#{et.tag.name} (#{et.factor})"}.sort.join(", "))
|
||||||
|
|
||||||
h2 = t('activerecord.attributes.exercise.files')
|
h2 = t('activerecord.attributes.exercise.files')
|
||||||
|
@ -41,7 +41,6 @@ de:
|
|||||||
allow_auto_completion: "Autovervollständigung aktivieren"
|
allow_auto_completion: "Autovervollständigung aktivieren"
|
||||||
allow_file_creation: "Dateierstellung erlauben"
|
allow_file_creation: "Dateierstellung erlauben"
|
||||||
difficulty: Schwierigkeitsgrad
|
difficulty: Schwierigkeitsgrad
|
||||||
worktime: "vermutete Arbeitszeit in Minuten"
|
|
||||||
token: "Aufgaben-Token"
|
token: "Aufgaben-Token"
|
||||||
proxy_exercise:
|
proxy_exercise:
|
||||||
title: Title
|
title: Title
|
||||||
|
@ -41,7 +41,6 @@ en:
|
|||||||
allow_auto_completion: "Allow auto completion"
|
allow_auto_completion: "Allow auto completion"
|
||||||
allow_file_creation: "Allow file creation"
|
allow_file_creation: "Allow file creation"
|
||||||
difficulty: Difficulty
|
difficulty: Difficulty
|
||||||
worktime: "Expected worktime in minutes"
|
|
||||||
token: "Exercise Token"
|
token: "Exercise Token"
|
||||||
proxy_exercise:
|
proxy_exercise:
|
||||||
title: Title
|
title: Title
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
class RemoveExpectedWorkingTime < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :exercises, :expected_worktime_seconds
|
||||||
|
end
|
||||||
|
end
|
@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@ -133,9 +133,8 @@ ActiveRecord::Schema.define(version: 20170920145852) do
|
|||||||
t.string "token", limit: 255
|
t.string "token", limit: 255
|
||||||
t.boolean "hide_file_tree"
|
t.boolean "hide_file_tree"
|
||||||
t.boolean "allow_file_creation"
|
t.boolean "allow_file_creation"
|
||||||
t.boolean "allow_auto_completion", default: false
|
t.boolean "allow_auto_completion", default: false
|
||||||
t.integer "expected_worktime_seconds", default: 60
|
t.integer "expected_difficulty", default: 1
|
||||||
t.integer "expected_difficulty", default: 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "exercises_proxy_exercises", id: false, force: :cascade do |t|
|
create_table "exercises_proxy_exercises", id: false, force: :cascade do |t|
|
||||||
|
Reference in New Issue
Block a user