
Tags can be added to exercises in the edit view. Tags can monitored under /tags. Added the concept of ProxyExercises which are a collection of Exercises. They can be found under /proxy_exercises Added Interventions as prework to show interventions later to the user. Added exercise/[:id]/working_time to return the working time of the user in this exercise and the average working time of all users in this exercise
63 lines
2.6 KiB
Plaintext
63 lines
2.6 KiB
Plaintext
- execution_environments = ExecutionEnvironment.where('file_type_id IS NOT NULL').select(:file_type_id, :id)
|
|
- file_types = FileType.where('file_extension IS NOT NULL').select(:file_extension, :id)
|
|
|
|
= form_for(@exercise, data: {execution_environments: execution_environments, file_types: file_types}, multipart: true) do |f|
|
|
= render('shared/form_errors', object: @exercise)
|
|
.form-group
|
|
= f.label(:title)
|
|
= f.text_field(:title, class: 'form-control', required: true)
|
|
.form-group
|
|
= f.label(:description)
|
|
= f.pagedown_editor :description
|
|
.form-group
|
|
= f.label(:execution_environment_id)
|
|
= f.collection_select(:execution_environment_id, @execution_environments, :id, :name, {}, class: 'form-control')
|
|
/.form-group
|
|
= f.label(:instructions)
|
|
= f.hidden_field(:instructions)
|
|
.form-control.markdown
|
|
.checkbox
|
|
label
|
|
= f.check_box(:public)
|
|
= t('activerecord.attributes.exercise.public')
|
|
.checkbox
|
|
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')
|
|
.checkbox
|
|
label
|
|
= f.check_box(:allow_auto_completion)
|
|
= t('activerecord.attributes.exercise.allow_auto_completion')
|
|
.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 Tags
|
|
.table-responsive
|
|
table.table
|
|
thead
|
|
tr
|
|
th = t('activerecord.attributes.exercise.selection')
|
|
th = sort_link(@search, :title, t('activerecord.attributes.tag.name'))
|
|
th = t('activerecord.attributes.tag.difficulty')
|
|
= collection_check_boxes :exercise, :tag_ids, @exercise_tags, :tag_id, :id do |b|
|
|
tr
|
|
td = b.check_box
|
|
td = b.object.tag.name
|
|
td = number_field "tag_factors[#{b.object.tag.id}]", :factor, :value => b.object.factor, in: 1..10, step: 1
|
|
h2 = t('activerecord.attributes.exercise.files')
|
|
ul#files.list-unstyled.panel-group
|
|
= f.fields_for :files do |files_form|
|
|
= render('file_form', f: files_form)
|
|
|
|
a#add-file.btn.btn-default.btn-sm.pull-right href='#' = t('.add_file')
|
|
ul#dummies.hidden = f.fields_for(:files, CodeOcean::File.new, child_index: 'index') do |files_form|
|
|
= render('file_form', f: files_form)
|
|
|
|
.actions = render('shared/submit_button', f: f, object: @exercise) |