Yimaru-BackEnd/internal/domain/initial_assessment.go

48 lines
946 B
Go

package domain
import "time"
type QuestionType string
const (
QuestionTypeMultipleChoice QuestionType = "multiple_choice"
QuestionTypeTrueFalse QuestionType = "true_false"
QuestionTypeShortAnswer QuestionType = "short_answer"
)
type SubmitAssessmentReq struct {
Answers []UserAnswer `json:"answers" validate:"required,min=1"`
}
type AssessmentQuestion struct {
ID int64
Title string
Description string
QuestionType string
DifficultyLevel string
Options []AssessmentOption
}
type AssessmentOption struct {
ID int64
OptionText string
IsCorrect bool
}
type UserAnswer struct {
QuestionID int64
SelectedOptionID int64
ShortAnswer string
IsCorrect bool
}
type AssessmentAttempt struct {
ID int64
UserID int64
TotalQuestions int
CorrectAnswers int
ScorePercentage float64
KnowledgeLevel string
CompletedAt time.Time
}