Quiz Titel anzeigen

This commit is contained in:
juhnsa
2025-03-16 11:54:00 +01:00
parent 1f1344522f
commit d1cca38595
2 changed files with 10 additions and 2 deletions

View File

@@ -10,12 +10,20 @@ def lobby(request, join_code):
return redirect('play:create_participant', join_code=join_code)
participant_id = request.COOKIES['participant_id']
quiz_game = get_object_or_404(QuizGame, join_code=join_code)
quiz = get_object_or_404(QivipQuiz, pk=quiz_game.quiz_id.id)
participant = get_object_or_404(QuizGameParticipant, participant_id=participant_id)
if not participant.quiz_game.join_code == join_code:
participant.quiz_game = quiz_game
participant.save()
return render(request, 'play/lobby.html', {'debug': "test", 'participant': participant})
context = {
'debug': "test",
'participant': participant,
'quiz': quiz,
}
return render(request, 'play/lobby.html', context=context)
def create_participant(request, join_code):
if "participant_id" in request.COOKIES: # Umleiten, falls Teilnehmer bereits erstellt