Class: ExamRegistration::AuthorizationCriterion::PassedExercises
Instance Attribute Summary
#value
Instance Method Summary
collapse
#as_json, #authorization_criteria_matcher, #authorization_status_for, #ensure_valid!, #initialize, #meets_authorization_criteria?, parse, parse_criterion_type, #process_request!, #type
Instance Method Details
#criterion_matcher ⇒ Object
74
75
76
|
# File 'app/models/exam_registration/authorization_criterion.rb', line 74
def criterion_matcher
{ 'stats.passed': { '$gte': value.to_f } }
end
|
#meets_criterion?(user, organization) ⇒ Boolean
70
71
72
|
# File 'app/models/exam_registration/authorization_criterion.rb', line 70
def meets_criterion?(user, organization)
user.passed_submissions_count_in(organization) >= value
end
|
#valid? ⇒ Boolean
66
67
68
|
# File 'app/models/exam_registration/authorization_criterion.rb', line 66
def valid?
value.positive?
end
|