app/models/submission.rb
# Bump any old Submissions down the line and ensure no submission has
# submission_version_used == true
Bump any old Submissions down the line and ensure no submission has
submission_version_used == true
Bump any old Submissions down the line and ensure no submission has submission_version_used == true
def bump_old_submissions
    while grouping.reload.has_submission?
      old_submission = grouping.current_submission_used
      if self.submission_version.nil? || (self.submission_version <= old_submission.submission_version)
        self.submission_version = old_submission.submission_version + 1
      end
      old_submission.submission_version_used = false
      old_submission.save
      old_result = old_submission.get_original_result
      old_result.released_to_students = false
      old_result.save
    end
  end
def bump_old_submissions while grouping . reload . has_submission? old_submission = grouping . current_submission_used if self . submission_version . nil? || ( self . submission_version <= old_submission . submission_version ) self . submission_version = old_submission . submission_version + 1 end old_submission . submission_version_used = false old_submission . save old_result = old_submission . get_original_result old_result . released_to_students = false old_result . save end end
Bump any old Submissions down the line and ensure no submission has
submission_version_used == true
Bump any old Submissions down the line and ensure no submission has submission_version_used == true