I have been developing an examination system for the first two weeks. It mainly helps the human resources of an organization to provide internal training and assessment for their employees. The examination system is the purpose of completing the examination, the main function is to select a question in the question bank and then issue a question. After online Q & A is completed, submit the question, judge the question, and score the question. At present, this examination system should be prototyped, that is, implemented technically, used and fed back to customers as soon as possible, and iterative development should be implemented. One Developer is me. Since nnd is a prototype, I will take it!
This series of articles mainly refers to a memory and a summary of my solutions to this problem.
At the beginning, I felt a little troublesome when receiving this task, mainly because of the relationship between the question type and the paper size. The object tree is a bit complicated. The question information must be a base class, which is called out from the question bank, then combine them into a test paper, which is displayed at the beginning of the test process. At the end of the test, the paper is collected as an answer sheet, and you need to obtain the score in the background.
Considering that not only does the exam generated for each exam need to be persistent, but also the answers need to be persistent, I think it is too troublesome to have so many foreign keys in the database, so use XML directly for persistence. The following class diagram shows how many associated tables should be used for databases. It is very painful to use tables to handle inheritance issues!
The above class design has probably demonstrated the implementation difficulties of this system: it is nested at multiple layers. The relationship is: Exam 1: N question type 1: N question, there are three layers, one to many cases, and the question is divided into different types, including the combination type. So helpless, I want to save so much information at a time. How to program expression and data submission. It can be easily implemented using the "Attention" method, but I want to achieve this elegantly as much as possible. I am pursuing too much in this regard, so boss always criticizes me!
This design has two obvious implementation difficulties.:
1. How to express the multi-layer object structure on the Asp.net page and how to collect data after expression
2. Whether the persistence storage of multi-layer objects can completely restore and generate answers
Advantages of this design:
1. It avoids the persistent expression of multi-layer objects in the database and avoids the most troublesome and complex problems. In particular, it also converts from a "questionnaire" to "Answer"
2. Easy to change. If you want to add or adjust fields, the impact is relatively small. You only need to modify the class, which is more convenient than the database, especially after deployment to the production environment
Test System Development Summary (1)-plan and design
Test System Development Summary (II)-implementation and code
Summary of examination system development (III)-essence and conclusion