Topic: how to capture the test result for student?

any idea on how to capture the a set of answer from quiz's question?

below stuation is how to look like:-

teacher create a quiz that have many question with multiple choice of answer, only 1 answer is true. quiz < 1:M > question < 1:M > choice.... this part have been done...

student take a test of quiz by answer each question with 1 answer only... so any idea on getting this part done?

Re: how to capture the test result for student?

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:
has_many :questions
belongs_to :lesson
has_many :answers
has_one :correct_answer
belongs_to :question

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 :grades
has_and_belongs_to_many :courses
has_many :lessons, :through => :grades
habtm :students
has_many :lessons
belongs_to :student
belongs_to :lesson

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? |