45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package course_management
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/domain"
|
|
"context"
|
|
)
|
|
|
|
func (s *Service) CreatePracticeQuestion(
|
|
ctx context.Context,
|
|
practiceID int64,
|
|
question string,
|
|
questionVoicePrompt *string,
|
|
sampleAnswerVoicePrompt *string,
|
|
sampleAnswer *string,
|
|
tips *string,
|
|
qType string,
|
|
) (domain.PracticeQuestion, error) {
|
|
return s.courseStore.CreatePracticeQuestion(ctx, practiceID, question, questionVoicePrompt, sampleAnswerVoicePrompt, sampleAnswer, tips, qType)
|
|
}
|
|
|
|
func (s *Service) GetQuestionsByPractice(
|
|
ctx context.Context,
|
|
practiceID int64,
|
|
) ([]domain.PracticeQuestion, error) {
|
|
return s.courseStore.GetQuestionsByPractice(ctx, practiceID)
|
|
}
|
|
|
|
func (s *Service) UpdatePracticeQuestion(
|
|
ctx context.Context,
|
|
id int64,
|
|
question *string,
|
|
sampleAnswer *string,
|
|
tips *string,
|
|
qType *string,
|
|
) error {
|
|
return s.courseStore.UpdatePracticeQuestion(ctx, id, question, sampleAnswer, tips, qType)
|
|
}
|
|
|
|
func (s *Service) DeletePracticeQuestion(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error {
|
|
return s.courseStore.DeletePracticeQuestion(ctx, id)
|
|
}
|