Allow random selection for ProxyExercise

This commit is contained in:
Sebastian Serth
2023-01-20 20:56:20 +01:00
parent d05d69756d
commit 2679f5fa56
9 changed files with 45 additions and 10 deletions

View File

@ -6,6 +6,9 @@
.mb-3
= f.label(:description, class: 'form-label')
= f.pagedown :description, input_html: { preview: true, rows: 10 }
.mb-3
= f.label(:algorithm, class: 'form-label')
= f.collection_select(:algorithm, ProxyExercise.algorithms.map { |algorithm, _id| [t("activerecord.attributes.proxy_exercise.algorithm_type.#{algorithm}"), algorithm] }, :second, :first, {}, class: 'form-control form-control-sm')
.form-check.mb-3
label.form-check-label
= f.check_box(:public, class: 'form-check-input')

View File

@ -5,6 +5,7 @@ h1
= row(label: 'exercise.title', value: @proxy_exercise.title)
= row(label: 'exercise.user', value: link_to_if(policy(@proxy_exercise.author).show?, @proxy_exercise.author, @proxy_exercise.author))
= row(label: 'proxy_exercise.files_count', value: @exercises.count)
= row(label: 'proxy_exercise.algorithm', value: t("activerecord.attributes.proxy_exercise.algorithm_type.#{@proxy_exercise.algorithm}"))
= row(label: 'exercise.public', value: @proxy_exercise.public?)
= row(label: 'exercise.description', value: @proxy_exercise.description)
= row(label: 'exercise.embedding_parameters', class: 'mb-4') do