model

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AverageFinishScore

func AverageFinishScore(userId int64) (float64, error)

func CountArbitramentFinishNumberByQuestionId

func CountArbitramentFinishNumberByQuestionId(questionId int64) (count int64, err error)

func CountArbitramentUnFinishNumberByQuestionId

func CountArbitramentUnFinishNumberByQuestionId(questionId int64) (count int64, err error)

func CountFailTestNumberByUserId

func CountFailTestNumberByUserId(userId int64, questionId int64) (count int64, err error)

func CountFinishScoreNumberByQuestionId

func CountFinishScoreNumberByQuestionId(questionId int64) (count int64, err error)

func CountFirstScoreNumberByQuestionId

func CountFirstScoreNumberByQuestionId(questionId int64) (int64, error)

func CountProblemFinishNumberByQuestionId

func CountProblemFinishNumberByQuestionId(questionId int64) (count int64, err error)

func CountProblemNumberByQuestionId

func CountProblemNumberByQuestionId(questionId int64) (count int64)

func CountProblemUnFinishNumberByQuestionId

func CountProblemUnFinishNumberByQuestionId(questionId int64) (count int64, err error)

func CountRemainingTestNumberByUserId

func CountRemainingTestNumberByUserId(questionId int64, userId int64) (count int64, err error)

func CountSecondScoreNumberByQuestionId

func CountSecondScoreNumberByQuestionId(questionId int64) (count int64, err error)

func CountSelfScore

func CountSelfScore(userId int64, questionId int64) (count int64, err error)

func CountTestByScore

func CountTestByScore(question int64, score int64) (count int64, err1 error)

func CountTestScoreNumberByUserId

func CountTestScoreNumberByUserId(userId int64, questionId int64) (count int64, err1 error)

func CountThirdScoreNumberByQuestionId

func CountThirdScoreNumberByQuestionId(questionId int64) (count int64, err error)

func CountUnScoreTestNumberByQuestionId

func CountUnScoreTestNumberByQuestionId(questionId int64) (count int64, err error)

func CreatePaperGroup

func CreatePaperGroup(group *PaperGroup) error

func CreateUserPaperGroup

func CreateUserPaperGroup(userId int64, groupId int64) error

func DeleteAllTest

func DeleteAllTest(questionId int64) error

func DeleteUnderCorrectedPaperByUserId

func DeleteUnderCorrectedPaperByUserId(userId int64) error

func FindAllArbitramentUnderCorrectedPaper

func FindAllArbitramentUnderCorrectedPaper(arbitramentUnderCorrectedPaper *[]UnderCorrectedPaper, questionId int64) error

func FindArbitramentUnderCorrectedPaperByQuestionId

func FindArbitramentUnderCorrectedPaperByQuestionId(arbitramentUnderCorrectedPaper *[]UnderCorrectedPaper, questionId int64) error

func FindFinishScoreByQuestionId

func FindFinishScoreByQuestionId(finishScores *[]ScoreRecord, questionId int64) error

func FindFinishScoreRecordListByQuestionId

func FindFinishScoreRecordListByQuestionId(scoreRecordList *[]ScoreRecord, questionId int64) error

func FindFinishTestByUserId

func FindFinishTestByUserId(scoreRecord *[]ScoreRecord, userId int64, questionId int64) error

func FindNewUserId

func FindNewUserId(id1 int64, id2 int64, questionId int64) (newId int64)

func FindProblemUnderCorrectedList

func FindProblemUnderCorrectedList(problemUnderCorrectedPaper *[]UnderCorrectedPaper) error

func FindProblemUnderCorrectedPaperByQuestionId

func FindProblemUnderCorrectedPaperByQuestionId(problemUnderCorrectedPaper *[]UnderCorrectedPaper, questionId int64) error

func FindSelfMarkPaperByQuestionId

func FindSelfMarkPaperByQuestionId(selfMarkUnderCorrectedPaper *[]UnderCorrectedPaper, questionId int64) error

func FindSelfScoreRecordByUserId

func FindSelfScoreRecordByUserId(selfScoreRecord *[]ScoreRecord, examinerId int64) error

func FindSelfUnderCorrectedPaperByQuestionId

func FindSelfUnderCorrectedPaperByQuestionId(selfUnderCorrectedPaper *[]UnderCorrectedPaper, questionId int64) error

func FindSubTopicsByQuestionId

func FindSubTopicsByQuestionId(id int64, st *[]SubTopic) error

func FindSubjectList

func FindSubjectList(subjects *[]Subject) error

func FindTestPaperByQuestionId

func FindTestPaperByQuestionId(questionId int64, t *[]TestPaper) error

func FindTestPaperInfoByQuestionDetailId

func FindTestPaperInfoByQuestionDetailId(questionDetailId int64, t *[]*TestPaperInfo) error

func FindTestPapersByTestId

func FindTestPapersByTestId(testId, t *[]TestPaper) error

func FindTopicBySubNameList

func FindTopicBySubNameList(topics *[]Topic, subjectName string) error

func FindTopicList

func FindTopicList(topics *[]Topic) error

func FindUserNumberByQuestionId

func FindUserNumberByQuestionId(users *[]User, questionId int64) error

func GetDistributedPaperByUserId

func GetDistributedPaperByUserId(id string, up *[]UnderCorrectedPaper) error

func GetDistributedTestIdPaperByUserId

func GetDistributedTestIdPaperByUserId(id int64, up *[]int64) error

func GetLatestRecords

func GetLatestRecords(userId int64, records *[]ScoreRecord) error

func GetSelfScorePaperByTestQuestionTypeAndTestId

func GetSelfScorePaperByTestQuestionTypeAndTestId(underCorrectedPaper *UnderCorrectedPaper, testId int64, userId int64) error

func GetSubTopicsByTestId

func GetSubTopicsByTestId(id int64, st *[]SubTopic) error

func GetSubjectById

func GetSubjectById(id int64) (string, error)

func GetSubjectBySubjectName

func GetSubjectBySubjectName(subject *Subject, subjectName string) (bool, error)

func GetTestInfoListByTestId

func GetTestInfoListByTestId(id int64, as *[]TestPaperInfo) error

func GetTestInfoPicListByTestId

func GetTestInfoPicListByTestId(id int64, as *[]string) error

func GetTestPaperListByQuestionIdAndQuestionStatus

func GetTestPaperListByQuestionIdAndQuestionStatus(questionId int64, questionStatue int64, tl *[]TestPaper) error

func GetTestPaperTeachingScoreById

func GetTestPaperTeachingScoreById(id int64) (int64, error)

func GetTestScoreRecordByTestIdAndUserId

func GetTestScoreRecordByTestIdAndUserId(testScoreRecord *ScoreRecord, testId int64, examinerId string) error

func GetTopicList

func GetTopicList(topics *[]Topic) error

func GetUnMarkSelfTestIdPaperByUserId

func GetUnMarkSelfTestIdPaperByUserId(id int64, up *[]int64) error

func GetUnderCorrectedPaperByUserIdAndTestId

func GetUnderCorrectedPaperByUserIdAndTestId(underCorrectedPaper *UnderCorrectedPaper, userId int64, testId int64) error

func GetUnderCorrectedSupervisorPaperByTestQuestionTypeAndTestId

func GetUnderCorrectedSupervisorPaperByTestQuestionTypeAndTestId(underCorrectedPaper *UnderCorrectedPaper, testId int64) error

func InitAdapter

func InitAdapter()

func InitConfig

func InitConfig()

func InsertSubTopic

func InsertSubTopic(subTopic *SubTopic) error

func InsertSubject

func InsertSubject(subject *Subject) (error, int64)

func InsertTopic

func InsertTopic(topic *Topic) (err1 error, questionId int64)

func ListSchools

func ListSchools() ([]string, error)

func ListTeacherScoreByTestIds

func ListTeacherScoreByTestIds(userId int64, testIds []int64) ([]int64, error)

func SumFinishScore

func SumFinishScore(userId int64, questionId int64) (sum float64, err1 error)

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter represents the MySQL x for policy storage.

func NewAdapter

func NewAdapter(driverName string, dataSourceName string) *Adapter

NewAdapter is the constructor for Adapter.

type PaperGroup

type PaperGroup struct {
	Id         int64   `json:"id" xorm:"pk autoincr"`
	GroupName  string  `json:"group_name"`
	TestIds    []int64 `json:"test_ids"`
	QuestionId int64   `json:"question_id"`
}

func GetGroupByGroupId

func GetGroupByGroupId(id int64) (*PaperGroup, error)

func GetGroupThanLastId

func GetGroupThanLastId(id int64, questionId int64) (*PaperGroup, bool, error)

func ListPaperGroup

func ListPaperGroup() ([]*PaperGroup, error)

func (*PaperGroup) Update

func (p *PaperGroup) Update() error

type ScoreRecord

type ScoreRecord struct {
	RecordId       int64     `json:"record_id" xorm:"pk autoincr"`
	QuestionId     int64     `json:"question_id"`
	TestId         int64     `json:"test_id"`
	UserId         int64     `json:"user_id"`
	ScoreTime      time.Time `json:"score_time"`
	Score          int64     `json:"score"`
	TestRecordType int64     `json:"test_record_type"`
	ProblemType    int64     `json:"problem_type" xorm:"default(-1)"`
	TestFinish     int64     `json:"test_finish"`
}

func GetRecordByTestId

func GetRecordByTestId(testId int64) (*ScoreRecord, error)

func ListScoreRecordByUserId

func ListScoreRecordByUserId(userId int64) ([]ScoreRecord, error)

func ListUserScoreRecord

func ListUserScoreRecord(userId int64) ([]ScoreRecord, error)

func (*ScoreRecord) GetRecordByTestId

func (s *ScoreRecord) GetRecordByTestId(testId int64, userId int64) error

func (*ScoreRecord) GetTopic

func (s *ScoreRecord) GetTopic(id int64) error

func (*ScoreRecord) Save

func (s *ScoreRecord) Save() error

func (*ScoreRecord) Update

func (s *ScoreRecord) Update() error

type SubTopic

type SubTopic struct {
	QuestionDetailId    int64  `json:"question_detail_id" xorm:"pk autoincr"`
	QuestionDetailName  string `json:"question_detail_name"`
	QuestionId          int64  `json:"question_id"`
	QuestionDetailScore int64  `json:"question_detail_score"`
	ScoreType           string `json:"score_type"`
	IsSecondScore       bool   `json:"is_second_score"`
}

func (*SubTopic) Delete

func (s *SubTopic) Delete() error

func (*SubTopic) GetSubTopic

func (s *SubTopic) GetSubTopic(id int64) error

func (*SubTopic) Update

func (s *SubTopic) Update() error

type Subject

type Subject struct {
	SubjectId   int64  `json:"subject_id" xorm:"pk autoincr"`
	SubjectName string `json:"subject_name"`
}

type TestPaper

type TestPaper struct {
	TestId                  int64  `json:"test_id" xorm:"pk autoincr"`
	QuestionId              int64  `json:"question_id"`
	Candidate               string `json:"candidate"`
	QuestionStatus          int64  `json:"question_status"`
	ExaminerFirstId         int64  `json:"examiner_first_id" xorm:"default(-1)"`
	ExaminerFirstScore      int64  `json:"examiner_first_score" xorm:"default(-1)"`
	ExaminerFirstSelfScore  int64  `json:"examiner_first_self_score" xorm:"default(-1)"`
	ExaminerSecondId        int64  `json:"examiner_second_id" xorm:"default(-1)"`
	ExaminerSecondScore     int64  `json:"examiner_second_score" xorm:"default(-1)"`
	ExaminerSecondSelfScore int64  `json:"examiner_second_self_score" xorm:"default(-1)"`
	ExaminerThirdId         int64  `json:"examiner_third_id" xorm:"default(-1)"`
	ExaminerThirdScore      int64  `json:"examiner_third_score" xorm:"default(-1)"`
	ExaminerThirdSelfScore  int64  `json:"examiner_third_self_score" xorm:"default(-1)"`
	LeaderId                int64  `json:"leader_id" xorm:"default(-1)"`
	LeaderScore             int64  `json:"leader_score" xorm:"default(-1)"`
	FinalScore              int64  `json:"final_score" xorm:"default(-1)" `
	FinalScoreId            int64  `json:"finale_score_id"`
	PracticeError           int64  `json:"practice_error"`
	CorrectingNumber        int64  `json:"correcting_number"`
	Mobile                  string `json:"mobile"`
	IsParent                int64  `json:"is_parent"`
	ClientIp                string `json:"client_ip"`
	Tag                     string `json:"tag"`
	School                  string `json:"school"`
	TicketId                string `json:"ticket_id"`
	TeachingScore           int64  `json:"teaching_score"`
}

func FindUnDistributeTestLimit1

func FindUnDistributeTestLimit1(id int64) ([]TestPaper, error)

func FindUnDistributeTestLimit2

func FindUnDistributeTestLimit2(id int64) ([]TestPaper, error)

func (*TestPaper) GetTestPaper

func (t *TestPaper) GetTestPaper(id int64) (bool, error)

func (*TestPaper) GetTestPaperByQuestionIdAndQuestionStatus

func (t *TestPaper) GetTestPaperByQuestionIdAndQuestionStatus(questionId int64, questionStatue int64) error

func (*TestPaper) GetTestPaperByTestId

func (t *TestPaper) GetTestPaperByTestId(testId int64) error

func (*TestPaper) Insert

func (t *TestPaper) Insert() (int64, error)

func (*TestPaper) Update

func (t *TestPaper) Update() error

func (*TestPaper) UpdateCols

func (t *TestPaper) UpdateCols(columns ...string) error

type TestPaperInfo

type TestPaperInfo struct {
	TestDetailId            int64  `json:"test_detail_id" xorm:"pk autoincr"`
	QuestionDetailId        int64  `json:"question_detail_id"`
	TestId                  int64  `json:"test_id"`
	PicSrc                  string `json:"pic_src"`
	ExaminerFirstId         int64  `json:"examiner_first_id" xorm:"default(-1)"`
	ExaminerFirstScore      int64  `json:"examiner_first_score" xorm:"default(-1)"`
	ExaminerFirstSelfScore  int64  `json:"examiner_first_self_score" xorm:"default(-1)"`
	ExaminerSecondId        int64  `json:"examiner_second_id" xorm:"default(-1)"`
	ExaminerSecondScore     int64  `json:"examiner_second_score" xorm:"default(-1)"`
	ExaminerSecondSelfScore int64  `json:"examiner_second_self_score" xorm:"default(-1)"`
	ExaminerThirdId         int64  `json:"examiner_third_id" xorm:"default(-1)"`
	ExaminerThirdScore      int64  `json:"examiner_third_score" xorm:"default(-1)"`
	ExaminerThirdSelfScore  int64  `json:"examiner_third_self_score" xorm:"default(-1)"`
	LeaderId                int64  `json:"leader_id" xorm:"default(-1)"`
	LeaderScore             int64  `json:"leader_score" xorm:"default(-1)"`
	FinalScore              int64  `json:"finale_score" xorm:"default(-1)"`
	FinalScoreId            int64  `json:"final_score_id" xorm:"default(-1)"`
	TicketId                string `json:"ticket_id"`
}

func FindTestPaperInfoByTicketId

func FindTestPaperInfoByTicketId(ticketId string) ([]*TestPaperInfo, error)

func (*TestPaperInfo) Delete

func (t *TestPaperInfo) Delete() error

func (*TestPaperInfo) GetTestPaperInfo

func (t *TestPaperInfo) GetTestPaperInfo(id int64) error

func (*TestPaperInfo) GetTestPaperInfoByTestIdAndQuestionDetailId

func (t *TestPaperInfo) GetTestPaperInfoByTestIdAndQuestionDetailId(testId int64, questionDetailId int64) error

func (*TestPaperInfo) Insert

func (t *TestPaperInfo) Insert() error

func (*TestPaperInfo) Update

func (t *TestPaperInfo) Update() error

type Topic

type Topic struct {
	QuestionId    int64  `json:"question_id" xorm:"pk autoincr"`
	QuestionName  string `json:"question_name" xorm:"varchar(50)"`
	SubjectName   string `json:"subject_name" xorm:"varchar(50)"`
	StandardError int64  `json:"standard_error"`
	QuestionScore int64  `json:"question_score"`
	ScoreType     int64  `json:"score_type"`
	ImportNumber  int64  `json:"import_number"`
	ImportTime    string `json:"import_time"`
	SubjectId     int64  `json:"subject_id"`
	SelfScoreRate int64  `json:"self_score_rate"`
}

Author: Junlang struct : Topic(大题) comment: must capitalize the first letter of the field in Topic

func (*Topic) Delete

func (t *Topic) Delete() error

func (*Topic) GetTopic

func (t *Topic) GetTopic(id int64) error

func (*Topic) Update

func (t *Topic) Update() error
func Update ( topic *Topic,questionId int64)error {
	_,err:= adapter.engine.Where("question_id=?",questionId).Update(&topic)
	if err!=nil {
		log.Println("Update topic err ")
	}

	return  err
}

type UnderCorrectedPaper

type UnderCorrectedPaper struct {
	UnderCorrectedId int64  `json:"under_corrected_id" xorm:"pk autoincr"`
	UserId           int64  `json:"user_id"`
	TestId           int64  `json:"test_id"`
	QuestionId       int64  `json:"question_id"`
	TestQuestionType int64  `json:"test_question_type"`
	ProblemType      int64  `json:"problem_type" xorm:"default(-1)"`
	ProblemMessage   string `json:"test_message"`
	SelfScoreId      int64  `json:"self_score_id"`
}

func (*UnderCorrectedPaper) Delete

func (u *UnderCorrectedPaper) Delete() error

func (*UnderCorrectedPaper) GetUnderCorrectedPaper

func (u *UnderCorrectedPaper) GetUnderCorrectedPaper(userId int64, testId int64) error

func (*UnderCorrectedPaper) IsDuplicate

func (u *UnderCorrectedPaper) IsDuplicate() (bool, error)

func (*UnderCorrectedPaper) Save

func (u *UnderCorrectedPaper) Save() error

func (*UnderCorrectedPaper) SelfMarkDelete

func (u *UnderCorrectedPaper) SelfMarkDelete() error

func (*UnderCorrectedPaper) SupervisorDelete

func (u *UnderCorrectedPaper) SupervisorDelete() error

type User

type User struct {
	UserId         int64  `json:"user_id" xorm:"pk autoincr"`
	Account        string `json:"account"`
	UserName       string `json:"user_name"`
	Password       string `json:"password"`
	LoginTime      string `json:"login_time"`
	ExistTime      string `json:"exist_time"`
	OnlineTime     int64  `json:"online_time"`
	SubjectName    string `json:"subject_name"`
	IsOnlineStatus bool   `json:"is_online_status"`
	QuestionId     int64  `json:"question_id"`
	UserType       string `json:"user_type"`
	IsQualified    bool   `json:"is_qualified"`
	IsAttempt      bool   `json:"is_attempt"`
}

func GetLastUserBySubject

func GetLastUserBySubject(subject string) *User

func GetUserByAccount

func GetUserByAccount(account string) (*User, error)

func ListNormalUserByQuestionId

func ListNormalUserByQuestionId(questionId int64) ([]User, error)

func ListUsers

func ListUsers() ([]*User, error)

func (*User) Delete

func (u *User) Delete() error

func (*User) GetUser

func (u *User) GetUser(id int64) error

func (*User) Insert

func (u *User) Insert() error

func (*User) Update

func (u *User) Update() error

func (*User) UpdateCols

func (u *User) UpdateCols(columns ...string) error

type UserPaperGroup

type UserPaperGroup struct {
	Id      int64 `json:"id" xorm:"pk autoincr"`
	GroupId int64 `json:"group_id"`
	UserId  int64 `json:"user_id"`
}

func GetUserPaperGroupByUserId

func GetUserPaperGroupByUserId(id int64) (*UserPaperGroup, bool, error)

func ListUserPaperGroupByGroupId

func ListUserPaperGroupByGroupId(id int64) ([]*UserPaperGroup, error)

func (*UserPaperGroup) Update

func (u *UserPaperGroup) Update() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL