I am designing a grails app and many many-to-many relations have me stumped. This is what I have so far...
Domain classes
- Students
- Tests
- Questions
Here tests and questions will have m2m relationship. Which might be represented by a mapping class, please correct me if I am wrong.
TestConfig
This class can have many questions
and many tests
.
But I am still confused about how my data model can be designed when a student takes tests and attempts question.
A class that may be called Attempts
which will have answers(possibly wrong) given by the student, should it belong to students or tests or both?
I want to design an "Attempts" class so that when I look at an instance of it I can know what test it belong to as well as which student took it.
My current classes look like following
class Questions {
String question
String questionType
int points
String tags
String option_1
String option_2
String option_3
String option_4
boolean isOption_1_Correct
boolean isOption_2_Correct
boolean isOption_4_Correct
boolean isOption_3_Correct
}
class Students {
String firstName
String lastName
String email
String password
}
class Tests {
String name
String tags
String description
int duration
String instruction
}
------EDIT---------
I think I have found something useful here http://www.databaseanswers.org/data_models/online_exams/index.htm