diff --git a/app/views/flexible_criteria/_criterion_editor.html.erb b/app/views/flexible_criteria/_criterion_editor.html.erb
index 1cb2e122ae..3189689c3d 100644
--- a/app/views/flexible_criteria/_criterion_editor.html.erb
+++ b/app/views/flexible_criteria/_criterion_editor.html.erb
@@ -1,3 +1,5 @@
+<% marks_released = flash[:notice].present? %>
+
<%= button_to t(:delete),
course_criterion_path(@current_course, criterion),
@@ -6,7 +8,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 %>
@@ -20,12 +23,12 @@
<%= 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 %>
@@ -35,7 +38,7 @@
<% end %>
<%= f.label :description, Criterion.human_attribute_name(:description) %>
- <%= f.text_area :description, rows: 6, cols: 50 %>
+ <%= f.text_area :description, rows: 6, cols: 50, readonly: marks_released %>
<%= t('criteria.description_hint') %>
@@ -44,13 +47,13 @@
<%= 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 } %>
- <%= f.submit t(:save), data: { disable_with: t('working') } %>
+
<%= f.submit t(:save), data: { disable_with: t('working') }, disabled: marks_released %>
<% end %>
<% unless criterion.description.blank? %>
diff --git a/app/views/rubric_criteria/_criterion_editor.html.erb b/app/views/rubric_criteria/_criterion_editor.html.erb
index 7eb1112c7a..7936ad9e22 100644
--- a/app/views/rubric_criteria/_criterion_editor.html.erb
+++ b/app/views/rubric_criteria/_criterion_editor.html.erb
@@ -1,8 +1,8 @@
- <% released = !criterion.results_unreleased? %>
+ <% marks_released = flash[:notice].present? %>
- <% if released %>
+ <% if marks_released %>
<%= t('rubric_criteria.level.add') %>
<% else %>
<%= link_to t('rubric_criteria.level.add'),
@@ -19,7 +19,7 @@
form_class: 'display-inline-block',
title: t('helpers.submit.delete', model: Criterion.model_name.human),
remote: true,
- disabled: released
+ disabled: marks_released
%>
@@ -36,16 +36,16 @@
">
<%= f.label :name, Criterion.human_attribute_name(:name) %>
- <%= f.text_field :name, readonly: released %>
+ <%= f.text_field :name, readonly: marks_released %>
<%= f.label :max_mark, Criterion.human_attribute_name(:max_mark) %>
- <%= f.number_field :max_mark, value: "#{criterion.max_mark}", step: 0.1, readonly: released %>
+ <%= f.number_field :max_mark, value: "#{criterion.max_mark}", step: 0.1, readonly: marks_released %>
<%= f.label :bonus,
Criterion.human_attribute_name(:bonus) %>
- <%= f.check_box :bonus, { disabled: released } %>
+ <%= f.check_box :bonus, { disabled: marks_released } %>
<% if criterion.assignment.assignment_files.exists? %>
">
@@ -60,17 +60,17 @@
<%= f.label :ta_visible,
Criterion.human_attribute_name(:ta_visible) %>
- <%= f.check_box :ta_visible, { disabled: released } %>
+ <%= f.check_box :ta_visible, { disabled: marks_released } %>
<%= f.label :peer_visible,
Criterion.human_attribute_name(:peer_visible) %>
- <%= f.check_box :peer_visible, { disabled: released } %>
+ <%= f.check_box :peer_visible, { disabled: marks_released } %>
- <%= f.submit t(:save), data: { disable_with: t('working') }, disabled: released %>
+ <%= f.submit t(:save), data: { disable_with: t('working') }, disabled: marks_released %>
<%= render partial: 'rubric_criteria/rubric_criterion_levels',
- locals: { criterion: criterion } %>
+ locals: { criterion: criterion, marks_released: marks_released } %>
<% end %>
diff --git a/app/views/rubric_criteria/_rubric_criterion_level.html.erb b/app/views/rubric_criteria/_rubric_criterion_level.html.erb
index ba811fd17d..49d151aa7e 100644
--- a/app/views/rubric_criteria/_rubric_criterion_level.html.erb
+++ b/app/views/rubric_criteria/_rubric_criterion_level.html.erb
@@ -3,25 +3,23 @@
%>
- <% released = !criterion.results_unreleased? %>
-
<%= level_form.label :name, Level.human_attribute_name(:name), class: 'required' %>
- <%= level_form.text_field :name, required: true, readonly: released %>
+ <%= 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, readonly: released %>
+ <%= 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, readonly: released %>
+ <%= level_form.text_area :description, cols: 50, rows: 5, readonly: marks_released %>
diff --git a/app/views/rubric_criteria/_rubric_criterion_levels.html.erb b/app/views/rubric_criteria/_rubric_criterion_levels.html.erb
index e0fa526aae..30496b9e43 100644
--- a/app/views/rubric_criteria/_rubric_criterion_levels.html.erb
+++ b/app/views/rubric_criteria/_rubric_criterion_levels.html.erb
@@ -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, criterion: criterion } %>
+ locals: { level_form: level_form, marks_released: marks_released } %>
<% end %>
<% end %>