Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fix incorrect calculation of token penalties when submissions are on time (#7216)
- Ensured submissions that have been released cannot be recollected from the repo browser (#7254)
- Fix bug where renaming a group to an existing group in a different assignment resulted in incorrect repository mapping (#7224)
- Disable editable fields in assignment criterion when criterion is released (#7264)
- Fix Marks Spreadsheet csv bug of showing incorrect marks (#7257)
- Fix incorrect inclusion of course parameter in LtiSyncJob (#7258)

Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/common/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ a[role='button'] > .fa-layers {
color: $primary-one;
}

.sorted-list:not(.sortable) .fa-grip-vertical {
display: none;
}

.sortable .fa-grip-vertical {
color: $disabled-text;
cursor: grab;
Expand Down
8 changes: 5 additions & 3 deletions app/assets/stylesheets/common/_markus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,7 @@ kbd {
}

// Sortable lists

.sortable {
.sorted-list {
header {
border-bottom: 1px solid $primary-two;
border-radius: $radius $radius 0 0;
Expand Down Expand Up @@ -1319,10 +1318,13 @@ nav {

.rubric-criteria-levels {
border-left: 1px solid $line;
border-right: 1px solid $line;
border-top: 1px solid $line;

.level {
border-top: 1px solid $line;
padding: 0.5em;
border-bottom: 0.25px solid $line;
padding-right: 0.75em;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/criteria_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def edit
@criterion = record
@assignment = @criterion.assignment
if @assignment.released_marks.any?
flash_now(:error, t('criteria.errors.released_marks'))
flash_now(:notice, t('criteria.errors.released_marks'))
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='listings sortable'>
<div class='listings sorted-list sortable'>
<header>
<span><%= AnnotationCategory.model_name.human %></span>
</header>
Expand Down
17 changes: 9 additions & 8 deletions app/views/checkbox_criteria/_criterion_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
class: 'delete',
form_class: 'display-inline-block',
title: t('helpers.submit.delete', model: Criterion.model_name.human),
remote: true %>
remote: true,
disabled: marks_released %>
</div>

<h2>
Expand All @@ -25,12 +26,12 @@

<div class='inline-labels'>
<%= f.label :name, Criterion.human_attribute_name(:name) %>
<%= f.text_field :name %>
<%= f.text_field :name, readonly: marks_released %>
<%= f.label :max_mark, Criterion.human_attribute_name(:max_mark) %>
<%= f.number_field :max_mark, step: 0.1 %>
<%= f.number_field :max_mark, step: 0.1, readonly: marks_released %>
<%= f.label :bonus,
Criterion.human_attribute_name(:bonus) %>
<%= f.check_box :bonus %>
<%= f.check_box :bonus, { disabled: marks_released } %>
<% if criterion.assignment.assignment_files.exists? %>
<% selected_files = criterion.criteria_assignment_files_joins.map { |join| join.assignment_file } %>
<%= f.label :assignment_files, AssignmentFile.model_name.human %>
Expand All @@ -40,20 +41,20 @@
<% end %>
<%= f.label :description, Criterion.human_attribute_name(:description) %>
<div>
<%= f.text_area :description, rows: 6, cols: 50 %>
<%= f.text_area :description, rows: 6, cols: 50, readonly: marks_released %>
<p><%= t('criteria.description_hint') %></p>
</div>
</div>
<h4><%= t('criteria.visibility') %></h4>
<div class='inline-labels'>
<%= f.label :ta_visible,
Criterion.human_attribute_name(:ta_visible) %>
<%= f.check_box :ta_visible %>
<%= f.check_box :ta_visible, { disabled: marks_released } %>
<%= f.label :peer_visible,
Criterion.human_attribute_name(:peer_visible) %>
<%= f.check_box :peer_visible %>
<%= f.check_box :peer_visible, { disabled: marks_released } %>
</div>
<p><%= f.submit t(:save), data: { disable_with: t('working') } %></p>
<p><%= f.submit t(:save), data: { disable_with: t('working') }, disabled: marks_released %></p>
<% end %>

<% unless criterion.description.blank? %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/criteria/_criteria_pane.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='listings sortable'>
<div class='listings sorted-list <%= 'sortable' if !marks_released %>'>
<header>
<span class='left'><%= Criterion.model_name.human %></span>
<span class='center'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/criteria/create.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $('#criteria_pane_list').append("<%= escape_javascript(render partial: 'criteria

document.getElementById('editing_pane_menu').innerHTML =
"<%= escape_javascript(render partial: "#{@criterion.class.to_s.tableize}/criterion_editor",
locals: { criterion: @criterion }) %>";
locals: { criterion: @criterion, marks_released: !@criterion.results_unreleased? }) %>";

document.getElementById('criteria_total_max_mark').innerHTML = "<%= @criterion.assignment.max_mark %>";

Expand Down
2 changes: 1 addition & 1 deletion app/views/criteria/destroy.js.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.getElementById('criteria_pane').innerHTML =
"<%= escape_javascript(render partial: 'criteria/criteria_pane') %>";
"<%= escape_javascript(render partial: 'criteria/criteria_pane', locals: { marks_released: !@criterion.results_unreleased? }) %>";

document.getElementById('editing_pane_menu').innerHTML =
"<%= escape_javascript(render partial: 'criteria/manager_help') %>";
2 changes: 1 addition & 1 deletion app/views/criteria/edit.js.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.getElementById('editing_pane_menu').innerHTML =
"<%= escape_javascript(render partial: "#{@criterion.class.to_s.tableize}/criterion_editor",
locals: { criterion: @criterion }) %>";
locals: { criterion: @criterion, marks_released: !@criterion.results_unreleased? }) %>";

<%= render partial: 'event_listeners' %>
8 changes: 5 additions & 3 deletions app/views/criteria/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
@assignment.parent_assignment.short_identifier + ' ' + PeerReview.model_name.human :
@assignment.short_identifier) %>

<% marks_released = @assignment.released_marks.present? %>

<% @heading_buttons = [
{ link_text: t('criteria.new.button'),
link_path: new_course_assignment_criterion_path(@current_course, @assignment),
html_options: { id: 'add-new-criterion', 'data-remote': 'true' } },
html_options: { id: 'add-new-criterion', 'data-remote': 'true', class: (marks_released ? 'inactive' : '') } },
{ link_text: t('download'),
link_path: '#',
html_options: { id: 'downloadModal' } },
{ link_text: t('upload'),
link_path: '#',
html_options: { id: 'uploadModal' } }
html_options: { id: 'uploadModal', class: (marks_released ? 'inactive' : '') } }
] %>

<div class='wrapper'>
Expand All @@ -29,7 +31,7 @@

<div class='pane-wrapper'>
<div id='criteria_pane' class="criteria-pane-wrapper">
<%= render partial: 'criteria_pane' %>
<%= render partial: 'criteria_pane', locals: { marks_released: marks_released } %>
</div>

<div class='pane'>
Expand Down
2 changes: 1 addition & 1 deletion app/views/criteria/update.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ document.getElementById('criteria_total_max_mark').innerHTML = '<%= @criterion.a
<% if @criterion.is_a? RubricCriterion %>
document.getElementById('rubric-criteria-levels').innerHTML =
'<%= escape_javascript(render partial: "rubric_criteria/rubric_criterion_levels",
locals: { criterion: @criterion }) %>';
locals: { criterion: @criterion, marks_released: !@criterion.results_unreleased? }) %>';
<% end %>
2 changes: 1 addition & 1 deletion app/views/exam_templates/_exam_templates_pane.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='listings sortable'>
<div class='listings sorted-list sortable'>
<header>
<span><%= ExamTemplate.model_name.human %></span>
</header>
Expand Down
17 changes: 9 additions & 8 deletions app/views/flexible_criteria/_criterion_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
class: 'delete',
form_class: 'display-inline-block',
title: t('helpers.submit.delete', model: Criterion.model_name.human),
remote: true %>
remote: true,
disabled: marks_released %>
</div>

<h2>
Expand All @@ -20,12 +21,12 @@

<div class='inline-labels'>
<%= f.label :name, Criterion.human_attribute_name(:name) %>
<%= f.text_field :name %>
<%= f.text_field :name, readonly: marks_released %>
<%= f.label :max_mark, Criterion.human_attribute_name(:max_mark) %>
<%= f.number_field :max_mark, step: 0.1 %>
<%= f.number_field :max_mark, step: 0.1, readonly: marks_released %>
<%= f.label :bonus,
Criterion.human_attribute_name(:bonus) %>
<%= f.check_box :bonus %>
<%= f.check_box :bonus, { disabled: marks_released } %>
<% if criterion.assignment.assignment_files.exists? %>
<% selected_files = criterion.criteria_assignment_files_joins.map { |join| join.assignment_file } %>
<%= f.label :assignment_files, AssignmentFile.model_name.human %>
Expand All @@ -35,7 +36,7 @@
<% end %>
<%= f.label :description, Criterion.human_attribute_name(:description) %>
<div>
<%= f.text_area :description, rows: 6, cols: 50 %>
<%= f.text_area :description, rows: 6, cols: 50, readonly: marks_released %>
<p><%= t('criteria.description_hint') %></p>
</div>
</div>
Expand All @@ -44,13 +45,13 @@
<div class='inline-labels'>
<%= f.label :ta_visible,
Criterion.human_attribute_name(:ta_visible) %>
<%= f.check_box :ta_visible %>
<%= f.check_box :ta_visible, { disabled: marks_released } %>
<%= f.label :peer_visible,
Criterion.human_attribute_name(:peer_visible) %>
<%= f.check_box :peer_visible %>
<%= f.check_box :peer_visible, { disabled: marks_released } %>
</div>

<p><%= f.submit t(:save), data: { disable_with: t('working') } %></p>
<p><%= f.submit t(:save), data: { disable_with: t('working') }, disabled: marks_released %></p>
<% end %>

<% unless criterion.description.blank? %>
Expand Down
24 changes: 15 additions & 9 deletions app/views/rubric_criteria/_criterion_editor.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<div class='float-right'>
<%= link_to t('rubric_criteria.level.add'),

<% if marks_released %>
<span class="button disabled"><%= t('rubric_criteria.level.add') %></span>
<% else %>
<%= link_to t('rubric_criteria.level.add'),
'#',
class: 'button',
id: 'add-criterion-level' %>
<% end %>

<%= button_to "#{t(:delete)} #{Criterion.model_name.human}",
course_criterion_path(@current_course, criterion),
Expand All @@ -11,7 +16,8 @@
class: 'delete',
form_class: 'display-inline-block',
title: t('helpers.submit.delete', model: Criterion.model_name.human),
remote: true %>
remote: true,
disabled: marks_released %>
</div>

<h2>
Expand All @@ -27,16 +33,16 @@
<div class='main_rubric_criteria_edit'>
<p id="<%= "criterion_inputs_#{criterion.id}" %>">
<%= f.label :name, Criterion.human_attribute_name(:name) %>
<%= f.text_field :name %>
<%= f.text_field :name, readonly: marks_released %>
</p>
<p>
<%= f.label :max_mark, Criterion.human_attribute_name(:max_mark) %>
<%= f.number_field :max_mark, value: "#{criterion.max_mark}", step: 0.1 %>
<%= f.number_field :max_mark, value: "#{criterion.max_mark}", step: 0.1, readonly: marks_released %>
</p>
<p>
<%= f.label :bonus,
Criterion.human_attribute_name(:bonus) %>
<%= f.check_box :bonus %>
<%= f.check_box :bonus, { disabled: marks_released } %>
</p>
<% if criterion.assignment.assignment_files.exists? %>
<span id="<%= "criterion_inputs_#{criterion.id}" %>">
Expand All @@ -51,17 +57,17 @@
<div class='inline-labels'>
<%= f.label :ta_visible,
Criterion.human_attribute_name(:ta_visible) %>
<%= f.check_box :ta_visible %>
<%= f.check_box :ta_visible, { disabled: marks_released } %>
<%= f.label :peer_visible,
Criterion.human_attribute_name(:peer_visible) %>
<%= f.check_box :peer_visible %>
<%= f.check_box :peer_visible, { disabled: marks_released } %>
</div>
<p><%= f.submit t(:save), data: { disable_with: t('working') } %></p>
<p><%= f.submit t(:save), data: { disable_with: t('working') }, disabled: marks_released %></p>
</div>

<div id='rubric-criteria-levels' class='rubric-criteria-levels'>
<%= render partial: 'rubric_criteria/rubric_criterion_levels',
locals: { criterion: criterion } %>
locals: { criterion: criterion, marks_released: marks_released } %>
</div>

<% end %>
8 changes: 4 additions & 4 deletions app/views/rubric_criteria/_rubric_criterion_level.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<%= I18n.t("rubric_criteria.level.level_index", index: level_form.index.to_s) %>
</span>
<span class="float-right destroy_checkbox">
<%= level_form.check_box :_destroy %>
<%= level_form.check_box :_destroy, { disabled: marks_released } %>
<%= level_form.label :_destroy, I18n.t("rubric_criteria.level.delete.checkbox", index: level_form.index.to_s) %>
</span>
</h4>
<div class="inline-labels">
<%= level_form.label :name, Level.human_attribute_name(:name), class: 'required' %>
<%= level_form.text_field :name, required: true %>
<%= level_form.text_field :name, required: true, readonly: marks_released %>
<%= level_form.label :mark, class: 'required' %>
<%= level_form.number_field :mark, step: 0.01, required: true %>
<%= level_form.number_field :mark, step: 0.01, required: true, readonly: marks_released %>
<%= level_form.label :description, Level.human_attribute_name(:description),
class: 'description' %>
<%= level_form.text_area :description, cols: 50, rows: 5 %>
<%= level_form.text_area :description, cols: 50, rows: 5, readonly: marks_released %>
</div>
</div>
<!--<br>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
method: :patch, remote: true do |criterion_form| %>
<%= criterion_form.fields_for :levels, criterion_form.object.levels.order(:mark) do |level_form| %>
<%= render partial: 'rubric_criteria/rubric_criterion_level',
locals: { level_form: level_form } %>
locals: { level_form: level_form, marks_released: marks_released } %>
<% end %>
<% end %>
</div>