quiz resetc
This commit is contained in:
@@ -269,6 +269,16 @@ func (s *QuizService) ParticipantResult(ctx context.Context, quizID, userID stri
|
||||
return s.quizzes.Result(ctx, quizID, userID, true)
|
||||
}
|
||||
|
||||
// ResetParticipant wipes one participant's attempt; the quiz becomes pending
|
||||
// for them. Works on unpublished quizzes too — staff may tidy results up
|
||||
// while a quiz is offline.
|
||||
func (s *QuizService) ResetParticipant(ctx context.Context, quizID, userID string) error {
|
||||
if _, err := s.quizzes.Get(ctx, quizID, false); err != nil {
|
||||
return err
|
||||
}
|
||||
return s.quizzes.ResetAttempt(ctx, quizID, userID)
|
||||
}
|
||||
|
||||
// ── Taking ────────────────────────────────────────────────────────────────
|
||||
|
||||
// published loads a quiz that users may see.
|
||||
|
||||
Reference in New Issue
Block a user