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 assignments_should_match
    return if result.nil? || criterion.nil?
    unless result.submission.grouping.assignment == criterion.assignment
      errors.add(:base, 'result and criterion must all belong to the same assignment')
    end
  end
def assignments_should_match return if result . nil? || criterion . nil? unless result . submission . grouping . assignment == criterion . assignment errors . add ( :base , 'result and criterion must all belong to the same assignment' ) 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