On Jan 20, 2015, at 5:48 PM, Jacob Grishey <
jgri...@gmail.com> wrote:
> Hi, I know this is probably a basic question but I am relatively new to Ruby on Rails.
>
> I have a website in which I have three models: courses, students, and works. The website is supposed to be a grade keeper. A course has many works, like a test. You can add a work to a course, but I want that work to be distributed as single works to each student in that course as well. Does anyone know how I would be able to do this?
>
This feels like it's lacking another model. I did a system where there were quizzes after a medical Continuing Education presentation, and there was the following setup:
User (has_many examinations)
Examination (belongs_to user, belongs_to test) [also stores the individual's answers to each question]
Test (has_many examinations)
I won't get into the questions and answers here, but this should give you a possible direction. The idea is that a Test is a template -- the mimeograph master if you go back that far. There are many examinations derived from that test, and each examination is referencing a single user and a single test (master). How that exam gets filled out is unique to the user, and I think that's the missing model you are looking for.
Walter
> Thank you in advance,
>
> Jacob Grishey
>