When I directed you to Database Design section of the forum I was hopping some "DB monkey" will take care of the business. However it does look like we will have to trade ideas...
OK, I have here few questions and suggestions that I need to get answered:
- Does the user table gone hold only students details or also administrator details?
- If it will hold both, how will you distinguish between student and admin?
- If you planning to have separated table for each of them, do you have any specific idea about login implementation?
- In the user table you have groupid. Can the user be only member of one group or many groups?
- I feel like Questionid table and QuestionBank (described in 4th point) should be more flexible. I would prefer to call Questionid table Questioners or Surveys and have it following structure
- surveyid - primary key, created from groupid+school year+additional number of test/survey (not required if only one per year)
- groupid
- description (survey/test title)
- type - questioner(not marking) in class test(require marking)
- As mentioned before I would like to make it more flexible therefore I would drop idea of single question bank and create multiple tables with the surveyid as actual table name. This way
- Query doesn't have to search whole question bank in order to locate questions related to selected survey
- If somebody from admin/teachers mess up survey table they will not damage rest of the surveys
- It will make easier to remove old surveys from the system
The structure will be- questionNo - it is not necessary as you can do rows count
- question
- optionA
- optionB
- optionC
- optionD
- other
- correctAnswer - if one or many of the A-D
- In same manner I would drop Final table and replace with surveyid+result with structure where number of "q+number" is dependent on number of questions in surveyid
- userid
- taken - boolean true/false as for survey taken or not
- q1 - submitted answer
- q2 - submitted answer
- score - final mark if it is test for marking or not to create this field when the table is created
The whole concept can be extended further, but I do not want to over-kill and just trying to provide suggestions for possible improvements. Ask questions, I will do my best answer them and shape this design if we will agree upon it.