Module: Gaku::ExamHelper

Included in:
FrontendHelper
Defined in:
app/helpers/gaku/exam_helper.rb

Instance Method Summary collapse

Instance Method Details

#exam_completion_info(exam) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/gaku/exam_helper.rb', line 3

def exam_completion_info(exam)
  @course_students ||= @course.students
  ungraded = exam.ungraded(@course_students)
  total = exam.total_records(@course_students)

  percentage = number_to_percentage exam.completion(@course_students), precision: 2

  "#{t(:'exam.completion')}:#{percentage} #{t(:'exam.graded')}:#{total - ungraded} #{t(:'exam.ungraded')}:#{ungraded} #{t(:'exam.total')}:#{total}"
end