Spaces:
Runtime error
Runtime error
Commit ·
80e295f
1
Parent(s): 115e048
Deploy files from GitHub repository
Browse filesFiles changed (4)
22 unmodified lines23242526262728293022 unmodified lines
func (r *examEventAssignRepository) Check(ctx context.Context, eventId uuid.UUID, examId uuid.UUID) error {
return r.db.WithContext(ctx).
Where("event_id = ? AND exam_id = ?", eventId, examId).
Where("event_id = ?", eventId).
Where("exam_id = ?", examId).
First(&entity.ExamEventAssign{}).Error
}
func (r *examEventAssignRepository) Create(ctx context.Context, m entity.ExamEventAssign) error {37 unmodified lines3839404142434437 unmodified lines var attempt entity.ExamEventAttempt
err := r.db.WithContext(ctx).
Preload("Questions").
Preload("Answers").
Where("event_id = ?", eventId).
Where("exam_id = ?", examId).9 unmodified lines1011121313141516151617189 unmodified lines auth := middleware.ProvideAuthenticationMiddleware()
routerGroup := router.Group("api/v1/events")
{
routerGroup.GET("/:event_slug/exam/", auth.VerifyAccount, examController.List)
routerGroup.GET("/:event_slug/exam", auth.VerifyAccount, examController.List)
routerGroup.GET("/:event_slug/exam/:exam_slug/attempt", auth.VerifyAccount, examController.Attempt)
routerGroup.POST("/:event_slug/exam/:attempt_id/answer_question/", auth.VerifyAccount, examController.Answer)
routerGroup.POST("/:event_slug/exam/:attempt_id/submit/", auth.VerifyAccount, examController.Submit)
routerGroup.POST("/:event_slug/exam/:attempt_id/answer_question", auth.VerifyAccount, examController.Answer)
routerGroup.POST("/:event_slug/exam/:attempt_id/submit", auth.VerifyAccount, examController.Submit)
}
}36 unmodified lines3738394041424336 unmodified lines jwtService: jwtService, accountRepo: accountRepo, accountDetailRepo: accountDetailRepo, }}
repositories/exam_event_assign_repository.go+2-1
repositories/exam_event_attempt_repository.go+1
router/exam_event_router.go+3-3
services/account_service.go+1