there is
- questions table
Questions(id,Vopros,DisciplinaId....), - Exams
Exams(id,...,DisciplinaId,CountQuestions), - user table
Users (id,....,GroupId)with an indication of the group to which the student belongs - performance table
Uspevaemost (UserId,EkzamenId,VoprosId, [Otvet] )
The algorithm is as follows:
- adding data to the Exams-100 exam questions table (
CountQuestions) by discipline (DisciplinaId) for a group (GroupId). - Take
idstudents fromGroupId - Get
idquestions fromDisciplinaId - Generate data and add to the table
Uspevaemostorder by rand()indicatinglimit 100 (CountQuestions)i.e. not all questions need to be recorded, but only 100 randomly for each student, which belongs to this group and for the discipline that is indicated.
In general, piled up and can not cope.
Confused how to write a generation request. Tell me please. thank