Class: Searching::GuideProgress::SolvedAssignmentsPercentage
- Inherits:
-
NumericFilter
- Object
- BaseFilter
- NumericFilter
- Searching::GuideProgress::SolvedAssignmentsPercentage
- Includes:
- QueryOperands
- Defined in:
- lib/mumuki/classroom/models/searching/guide_progress.rb
Instance Method Summary collapse
Methods included from QueryOperands
#close_to, #default_query_operand, #less_than, #more_than
Methods included from QueryOperands
#current_query_operand, #current_query_operand_method
Methods inherited from NumericFilter
Methods inherited from BaseFilter
Instance Method Details
#pipeline ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/mumuki/classroom/models/searching/guide_progress.rb', line 66 def pipeline [ { '$addFields': { 'stats.solved_percentage': { '$multiply': [ { '$divide': [ {'$sum': %w($stats.passed $stats.passed_with_warnings)}, {'$sum': %w($stats.passed $stats.passed_with_warnings $stats.failed)} ] }, 100 ] } } }, { '$match': {'stats.solved_percentage': current_query_operand } } ] end |