
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
42 lines
2.5 KiB
Plaintext
42 lines
2.5 KiB
Plaintext
- content_for :head do
|
|
= javascript_include_tag('http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js')
|
|
= stylesheet_link_tag('http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css')
|
|
|
|
h1
|
|
= @exercise
|
|
- if policy(@exercise).edit?
|
|
= render('shared/edit_button', object: @exercise)
|
|
|
|
= row(label: 'exercise.title', value: @exercise.title)
|
|
= row(label: 'exercise.user', value: link_to_if(policy(@exercise.author).show?, @exercise.author, @exercise.author))
|
|
= row(label: 'exercise.description', value: render_markdown(@exercise.description))
|
|
= row(label: 'exercise.execution_environment', value: link_to_if(policy(@exercise.execution_environment).show?, @exercise.execution_environment, @exercise.execution_environment))
|
|
/= row(label: 'exercise.instructions', value: render_markdown(@exercise.instructions))
|
|
= 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.allow_auto_completion', value: @exercise.allow_auto_completion?)
|
|
= 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')
|
|
|
|
ul.list-unstyled.panel-group#files
|
|
- @exercise.files.order('name').each do |file|
|
|
li.panel.panel-default
|
|
.panel-heading role="tab" id="heading"
|
|
a.file-heading data-toggle="collapse" data-parent="#files" href=".collapse#{file.id}"
|
|
div.clearfix role="button"
|
|
span = file.name_with_extension
|
|
// probably set an icon here that shows that the rows can be collapsed
|
|
//span.pull-right.collapse.in class="collapse#{file.id}" ☼
|
|
.panel-collapse.collapse class="collapse#{file.id}" role="tabpanel"
|
|
.panel-body
|
|
- if policy(file).destroy?
|
|
.clearfix = link_to(t('shared.destroy'), file, class:'btn btn-warning btn-sm pull-right', data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
|
= render('shared/file', file: file)
|