Class: ExamRegistration::AuthorizationCriterion::PassedExercises

Inherits:
ExamRegistration::AuthorizationCriterion show all
Defined in:
app/models/exam_registration/authorization_criterion.rb

Instance Attribute Summary

Attributes inherited from ExamRegistration::AuthorizationCriterion

#value

Instance Method Summary collapse

Methods inherited from ExamRegistration::AuthorizationCriterion

#as_json, #authorization_status_for, #ensure_valid!, #initialize, parse, parse_criterion_type, #process_request!, #type

Constructor Details

This class inherits a constructor from ExamRegistration::AuthorizationCriterion

Instance Method Details

#meets_authorization_criteria?(authorization_request) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
# File 'app/models/exam_registration/authorization_criterion.rb', line 58

def meets_authorization_criteria?(authorization_request)
  authorization_request.user.passed_submissions_count_in(authorization_request.organization) >= value
end

#valid?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'app/models/exam_registration/authorization_criterion.rb', line 54

def valid?
  value.positive?
end