Due date fix
MODIFY
app/controllers/assessments_controller.rb
app/controllers/assessments_controller.rb
@@ -535,9 +535,16 @@ class AssessmentsController < ApplicationController
@assessment.save!
end
+
+ begin
flash[:success] = "Saved!" if @assessment.update!(edit_assessment_params)
redirect_to(tab_index) && return
+ rescue ActiveRecord::RecordInvalid => invalid
+ flash[:error] = invalid.message.sub! "Validation failed: ", ""
+
+ redirect_to(tab_index) && return
+ end
end
action_auth_level :releaseAllGrades, :instructor

MODIFY
app/models/assessment.rb
app/models/assessment.rb
@@ -435,8 +435,9 @@ private
end
def verify_dates_order
- errors.add :start_at, "must be before time assessment is due at" if start_at > due_at
- errors.add :due_at, "must be before time assessment ends at" if due_at > end_at
+ errors.add :due_at, "must be after the start date" if start_at > due_at
+ errors.add :end_at, "must be after the due date" if due_at > end_at
+ errors.add :grading_deadline, "must be after the end date" if end_at > grading_deadline
end
def handin_directory_and_filename_or_disable_handins

Due date fix (#871)