class Mark

Public Instance Methods

get_mark() click to toggle source

return the current mark for this criterion

# File app/models/mark.rb, line 40
def get_mark
  criterion = self.markable
  weight = criterion.get_weight
  mark.to_f * weight
end
valid_mark() click to toggle source
# File app/models/mark.rb, line 29
def valid_mark
  if self.markable_type == 'RubricCriterion' and !self.mark.nil? and (self.mark > 4 or self.mark < 0)
    errors.add(:mark, I18n.t('mark.error.validate_rubric'))
    return false
  end
  if self.markable_type == 'FlexibleCriterion' and !self.mark.nil? and (self.mark > self.markable.max or self.mark < 0)
    errors.add(:mark, I18n.t('mark.error.validate_flexible'))
    false
  end
end