Yimaru-BackEnd/internal/domain/initial_assessment.go

85 lines
1.7 KiB
Go

package domain
import (
"time"
)
type QuestionType string
const (
MultipleChoice QuestionType = "MULTIPLE_CHOICE"
TrueFalse QuestionType = "TRUE_FALSE"
ShortAnswer QuestionType = "SHORT_ANSWER"
)
type AssessmentQuestion struct {
ID int64 `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
QuestionType string `json:"question_type"`
DifficultyLevel string `json:"difficulty_level"`
Points int32 `json:"points"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type QuestionWithDetails struct {
Question AssessmentQuestion
Options []QuestionOption
}
type QuestionOption struct {
QuestionID int64 `json:"question_id"`
OptionText string `json:"option_text"`
}
type CreateAssessmentQuestionInput struct {
Title string
Description *string
QuestionType QuestionType
DifficultyLevel string
Points int32
IsActive bool
// Multiple Choice only
Options []CreateQuestionOptionInput
// Short Answer only
CorrectAnswer *string
}
type CreateQuestionOptionInput struct {
Text string
Order int32
IsCorrect bool
}
// type AssessmentQuestion struct {
// ID int64
// QuestionText string
// Type QuestionType
// Options []string
// CorrectAnswer string
// }
// type AssessmentOption struct {
// ID int64
// OptionText string
// IsCorrect bool
// }
// type AttemptAnswer struct {
// QuestionID int64
// Answer string
// IsCorrect *bool
// }
// type AssessmentAttempt struct {
// ID int64
// UserID int64
// Answers []AttemptAnswer
// Score int
// Completed bool
// }