From 749329db7693fba37c667d75e01c6df06331b5cd Mon Sep 17 00:00:00 2001 From: David Date: Wed, 28 Jul 2021 19:32:43 +0800 Subject: [PATCH] feat: test paper models definition --- models/marking.go | 111 +++++++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 41 deletions(-) diff --git a/models/marking.go b/models/marking.go index b239dbd..cf6b037 100644 --- a/models/marking.go +++ b/models/marking.go @@ -3,68 +3,97 @@ package models import ( "log" "time" + + "xorm.io/builder" ) // Author: Junlang // struct : Topic(大题) // comment: must capitalize the first letter of the field in Topic type Topic struct { - Question_id int `xorm:"id pk"` + Question_id int64 `xorm:"id pk"` Question_name string `xorm:"varchar(50)"` Subject_name string `xorm:"varchar(50)"` - Standard_error int - Question_score int - Score_type int - Import_number int + Standard_error int64 + Question_score int64 + Score_type int64 + Import_number int64 Import_time time.Time `xorm:updated` } type SubTopic struct { - Question_detail_id int `xorm:"id pk" ` + Question_detail_id int64 `xorm:"id pk" ` Question_detail_name string - Question_id int - Question_detail_score int + Question_id int64 + Question_detail_score int64 } type TestPaper struct { - Test_id int - Question_id int + Test_id int64 + Question_id int64 Candidate string - Correcting_status int - Question_status int - Examiner_first_id int - Examiner_first_score int - Examiner_first_self_score int - Examiner_second_id int - Examiner_second_score int - Examiner_second_self_score int - Examiner_third_id int - Examiner_third_score int - Examiner_third_self_score int - Leader_id int - Leader_score int - Final_score int - Problem_type int - Pratice_error int + Correcting_status int64 + Question_status int64 + Examiner_first_id int64 + Examiner_first_score int64 + Examiner_first_self_score int64 + Examiner_second_id int64 + Examiner_second_score int64 + Examiner_second_self_score int64 + Examiner_third_id int64 + Examiner_third_score int64 + Examiner_third_self_score int64 + Leader_id int64 + Leader_score int64 + Final_score int64 + Problem_type int64 + Pratice_error int64 } type TestPaperInfo struct { - Test_detail_id int - Question_detail_id int - Test_id int + Test_detail_id int64 + Question_detail_id int64 + Test_id int64 Pic_src string - Examiner_first_id int - Examiner_first_score int - Examiner_first_self_score int - Examiner_second_id int - Examiner_second_score int - Examiner_second_self_score int - Examiner_third_id int - Examiner_third_score int - Examiner_third_self_score int - Leader_id int - Leader_score int - Final_score int + Examiner_first_id int64 + Examiner_first_score int64 + Examiner_first_self_score int64 + Examiner_second_id int64 + Examiner_second_score int64 + Examiner_second_self_score int64 + Examiner_third_id int64 + Examiner_third_score int64 + Examiner_third_self_score int64 + Leader_id int64 + Leader_score int64 + Final_score int64 +} + +type UnderCorrectedPaper struct { + User_id int64 + Test_id int64 + Question_id int64 + Test_question_type int64 +} + +type ScoreRecord struct { + Record_id int64 + Test_id int64 + Tser_id int64 + Score_time int64 + Score int64 + Self_score int64 + Test_record_type int64 + Score_type int64 +} + +type PaperDistribution struct { + User_id int64 + Question_id int64 + Test_distribution_number int64 + Test_success_number int64 + Test_remaining_number int64 + PaperType int64 } func initMarkingModels() {