Open gorrillamcd opened 12 years ago
Working on this now. I will be changing my approach from what I initially planned:
There will be an Exam model that lessons will reference. Lessons will be either a normal lesson, or cumulative exam (i.e. midterms), probably defined with a boolean for easy checking. So, Lesson has_many :exams. Exam has_many :questions; belongs_to :lesson. Question has_many :answers; belongs_to :exam. And Answer belongs_to :question.
Grades will be stored in the Exam model. I won't keep information on what questions were right or wrong, just the grade, though I'll probably use javascript/AJAX to display to the student what was right/wrong, but after that, the info won't be persisted. I'm not sure about how I should store the average grade for a course. Should it be in the Exam as a special row or on the course with checks to keep the data fresh? Or maybe there should be a Grade model that stores the grades with a state column that tracks whether a row is a lesson-grade, midterm-grade, or average.
Exams and grading are kind of integral to the whole "taking classes" thing! This needs to be added. Hmmm, I'm apparently 5 days past due on this too.