Enable exercise forms to manipulate file creation flag
This commit is contained in:
@ -119,7 +119,7 @@ class ExercisesController < ApplicationController
|
||||
private :user_by_code_harbor_token
|
||||
|
||||
def exercise_params
|
||||
params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :hide_file_tree, :team_id, :title, files_attributes: file_attributes).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, :team_id, :title, files_attributes: file_attributes).merge(user_id: current_user.id, user_type: current_user.class.name)
|
||||
end
|
||||
private :exercise_params
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
label
|
||||
= f.check_box(:hide_file_tree)
|
||||
= t('activerecord.attributes.exercise.hide_file_tree')
|
||||
.checkbox
|
||||
label
|
||||
= f.check_box(:allow_file_creation)
|
||||
= t('activerecord.attributes.exercise.allow_file_creation')
|
||||
h2 = t('activerecord.attributes.exercise.files')
|
||||
ul#files.list-unstyled.panel-group
|
||||
= f.fields_for :files do |files_form|
|
||||
|
@ -16,6 +16,7 @@ h1
|
||||
= row(label: 'exercise.maximum_score', value: @exercise.maximum_score)
|
||||
= row(label: 'exercise.public', value: @exercise.public?)
|
||||
= row(label: 'exercise.hide_file_tree', value: @exercise.hide_file_tree?)
|
||||
= row(label: 'exercise.allow_file_creation', value: @exercise.allow_file_creation?)
|
||||
= row(label: 'exercise.embedding_parameters') do
|
||||
= content_tag(:input, nil, class: 'form-control', readonly: true, value: embedding_parameters(@exercise))
|
||||
|
||||
|
@ -38,6 +38,7 @@ de:
|
||||
team_id: Team
|
||||
title: Titel
|
||||
user: Autor
|
||||
allow_file_creation: "Dateierstellung erlauben"
|
||||
external_user:
|
||||
consumer: Konsument
|
||||
email: E-Mail
|
||||
|
@ -38,6 +38,7 @@ en:
|
||||
team_id: Team
|
||||
title: Title
|
||||
user: Author
|
||||
allow_file_creation: "Allow file creation"
|
||||
external_user:
|
||||
consumer: Consumer
|
||||
email: Email
|
||||
|
Reference in New Issue
Block a user