65 lines
2.3 KiB
Go
65 lines
2.3 KiB
Go
package request
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
|
|
)
|
|
|
|
type ExamSearch struct {
|
|
learning.Exam
|
|
request.PageInfo
|
|
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
|
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
|
}
|
|
|
|
type ExamCreate struct {
|
|
Title string `json:"title" binding:"required"`
|
|
Description string `json:"description"`
|
|
CourseId uint `json:"courseId"`
|
|
Duration int `json:"duration" binding:"required"`
|
|
TotalScore int `json:"totalScore" binding:"required"`
|
|
PassScore int `json:"passScore" binding:"required"`
|
|
QuestionCount int `json:"questionCount" binding:"required"`
|
|
StartTime time.Time `json:"startTime"`
|
|
EndTime time.Time `json:"endTime"`
|
|
Status string `json:"status"`
|
|
AllowRetake bool `json:"allowRetake"`
|
|
MaxAttempts int `json:"maxAttempts"`
|
|
}
|
|
|
|
type ExamUpdate struct {
|
|
ID uint `json:"id" binding:"required"`
|
|
Title string `json:"title" binding:"required"`
|
|
Description string `json:"description"`
|
|
CourseId uint `json:"courseId"`
|
|
Duration int `json:"duration" binding:"required"`
|
|
TotalScore int `json:"totalScore" binding:"required"`
|
|
PassScore int `json:"passScore" binding:"required"`
|
|
QuestionCount int `json:"questionCount" binding:"required"`
|
|
StartTime time.Time `json:"startTime"`
|
|
EndTime time.Time `json:"endTime"`
|
|
Status string `json:"status"`
|
|
AllowRetake bool `json:"allowRetake"`
|
|
MaxAttempts int `json:"maxAttempts"`
|
|
}
|
|
|
|
type ExamStatistics struct {
|
|
TotalExams int `json:"totalExams"` // 总考试数
|
|
ActiveExams int `json:"activeExams"` // 进行中的考试数
|
|
CompletedExams int `json:"completedExams"` // 已结束的考试数
|
|
DraftExams int `json:"draftExams"` // 草稿考试数
|
|
}
|
|
|
|
type PublishExamRequest struct {
|
|
ID uint `json:"id" binding:"required"`
|
|
}
|
|
|
|
type ExamQuestionConfig struct {
|
|
ExamId uint `json:"examId" binding:"required"`
|
|
QuestionId uint `json:"questionId" binding:"required"`
|
|
Score int `json:"score" binding:"required"`
|
|
QuestionOrder int `json:"questionOrder"`
|
|
}
|