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 deductive_annotations_absent?
    self.result
        .annotations
        .joins(annotation_text: [{ annotation_category: :flexible_criterion }])
        .where('criteria.id': self.criterion_id)
        .where.not('annotation_texts.deduction': 0).empty?
  end
def deductive_annotations_absent? self . result . annotations . joins ( annotation_text : [ { annotation_category : :flexible_criterion } ] ) . where ( 'criteria.id' : self . criterion_id ) . where . not ( 'annotation_texts.deduction' : 0 ) . empty? 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