Skip to content

Commit

Permalink
Autolab Release v2.0.8
Browse files Browse the repository at this point in the history
Autolab Release v2.0.8
  • Loading branch information
Aatish Nayak authored May 4, 2017
2 parents 2159d9b + 79678fe commit e21a418
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions app/controllers/assessments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,16 @@ def update
@assessment.save!
end

flash[:success] = "Saved!" if @assessment.update!(edit_assessment_params)

redirect_to(tab_index) && return
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
Expand Down
5 changes: 3 additions & 2 deletions app/models/assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,9 @@ def is_file?(name)
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
Expand Down

0 comments on commit e21a418

Please sign in to comment.