Sha256: 5912ffd9a3dfc00c92815e9262c2da5014bd72efc8c1842e2c6022c99cd29a68

Contents?: true

Size: 908 Bytes

Versions: 10

Compression:

Stored size: 908 Bytes

Contents

module Gaku
  class Courses::ExamsController < GakuController

    respond_to :html
    respond_to :js, only: :index

    def index
      @course = Course.find(params[:course_id])
      respond_with @course
    end

    def grading
      @course = Course.find(params[:course_id])
      @exam = Exam.find(params[:id])
      @students = @course.students
      @grading_methods = @course.grading_methods

      @grading_calculations = Grading::Collection::Calculations.new(@grading_methods, @students, @exam).calculate

      respond_with @exam
    end

    private

    # def init_portion_scores
    #   @students.each do |student|
    #     @exam.exam_portions.each do |portion|
    #       unless portion.exam_portion_scores.pluck(:student_id).include?(student.id)
    #         ExamPortionScore.create!(exam_portion: portion, student: student)
    #       end
    #     end
    #   end
    # end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gaku-0.2.4 frontend/app/controllers/gaku/courses/exams_controller.rb
gaku_frontend-0.2.4 app/controllers/gaku/courses/exams_controller.rb
gaku-0.2.3 frontend/app/controllers/gaku/courses/exams_controller.rb
gaku_frontend-0.2.3 app/controllers/gaku/courses/exams_controller.rb
gaku-0.2.2 frontend/app/controllers/gaku/courses/exams_controller.rb
gaku_frontend-0.2.2 app/controllers/gaku/courses/exams_controller.rb
gaku-0.2.1 frontend/app/controllers/gaku/courses/exams_controller.rb
gaku_frontend-0.2.1 app/controllers/gaku/courses/exams_controller.rb
gaku-0.2.0 frontend/app/controllers/gaku/courses/exams_controller.rb
gaku_frontend-0.2.0 app/controllers/gaku/courses/exams_controller.rb