app/models/mark.rb
# When a mark is saved, we need to make sure that that
# Result has not been released to students
When a mark is saved, we need to make sure that that
Result has not been released to students
When a mark is saved we need to make sure that that Result has not been released to students
def update_result
    if !mark.nil? || mark_changed?
      result.update_total_mark
    end
    if mark.nil?
      result.update(marking_state: Result::MARKING_STATES[:incomplete])
    end
  end
def update_result if ! mark . nil? || mark_changed? result . update_total_mark end if mark . nil? result . update ( marking_state : Result :: MARKING_STATES [ :incomplete ] ) end end
When a mark is saved, we need to make sure that that
Result has not been released to students
When a mark is saved we need to make sure that that Result has not been released to students