I'll be working on a similar feature in my project soon, I'll let you know how I figure it out.
This is my basic plan though:
The Answer model would have a boolean for correct/incorrect. Then, I would use that boolean to create the virtual model correct_answer. I haven't tested this yet, but this is the basic idea I will use. I might also have a finished boolean in lesson to keep track of which lesson has been finished.
As far as keeping the grades, I will have a Grade model:
has_many :lessons, :through => :grades
The grade model will relate students to lessons, though I'm not sure if these are the best associations and so they may change when I actually start on this part of the project. The grade model would have score:integer, lesson_id, student_id at least. If you wanted to add other features, like tracking how many retries a student has, you would need to add more fields.
Here's a good railscast on making questions/answers (focusing on the forms, but the concepts are super useful)
orm-part-1 (and part-2) - This goes through exactly what you need for making questions that have many answers. It doesn't go into grading however since the example app is a survey.
Change is a vector. You can have all the change in the world, but if it doesn't go in the right direction, what good is it? | techonamission.com