diff --git a/django/play/views.py b/django/play/views.py
index 279e6fb..f1d8b3e 100644
--- a/django/play/views.py
+++ b/django/play/views.py
@@ -8,10 +8,20 @@ from django.contrib import messages
from django.conf import settings
import json
-
+import qrcode
+import base64
+from io import BytesIO
+from django.shortcuts import render
# Create your views here.
def lobby(request, join_code):
+ relative_url = reverse("play:create_participant", kwargs={"join_code": join_code})
+ full_url = request.build_absolute_uri(relative_url)
+
+ qr = qrcode.make(full_url)
+ buffer = BytesIO()
+ qr.save(buffer, format="PNG")
+ img_base64 = base64.b64encode(buffer.getvalue()).decode("utf-8")
@@ -20,6 +30,7 @@ def lobby(request, join_code):
context = {
'quiz': quiz,
'quiz_game': quiz_game,
+ "qr_code_base64": img_base64,
}
@@ -29,6 +40,7 @@ def lobby(request, join_code):
host_id = request.COOKIES['host_id']
if host_id == quiz_game.host_id:
context['host_id'] = host_id
+ context["qr_code_base64"] = img_base64
return render(request, 'play/lobby.html', context=context)
elif mode=="learn":
return redirect('play:create_participant', join_code=join_code)
@@ -50,6 +62,7 @@ def lobby(request, join_code):
return redirect('play:create_participant', join_code=join_code)
context['participant'] = participant
+ context["qr_code_base64"] = img_base64
return render(request, 'play/lobby.html', context=context)
def select_mode(request,join_code):
@@ -334,5 +347,5 @@ def selected_mode(request, join_code):
return redirect('play:question',join_code)
+ return redirect('play:lobby', join_code=join_code)
- return render(request, 'play/lobby.html', context=context)
diff --git a/django/templates/homepage/home.html b/django/templates/homepage/home.html
index 479088c..71784c1 100644
--- a/django/templates/homepage/home.html
+++ b/django/templates/homepage/home.html
@@ -68,7 +68,7 @@
- alle öffentlichen Quizze können auch ohne Account gespielt werden
- - qivip ist 100% kostenlos
+ - qivip ist zu 100% kostenlos
- es gibt keine Werbung
@@ -133,7 +133,7 @@
Moderator: Der Moderator selbst spielt nicht mit. Gehen Sie entweder auf die Startseite und klicken Sie auf "Moderieren" oder klicken einfach auf "spielen" (eines von Ihnen ausgewählten Quizzes) und dann auf Moderiermodus.
- Der Moderator kann das Spiel, wenn die Teilnehmer da sind starten.
+ Der Moderator kann das Spiel, wenn die Teilnehmer da sind, starten.
Teilnehmer: Gehen Sie auf die Startseite und klicken Sie auf "Teilnehmen" und geben Sie dann den beim Moderator angegebenen Zahlencode ein. Anschließlich können Sie noch einen Anzeigenamen eingeben.
diff --git a/django/templates/play/lobby.html b/django/templates/play/lobby.html
index 76a87d1..9c9b364 100644
--- a/django/templates/play/lobby.html
+++ b/django/templates/play/lobby.html
@@ -8,12 +8,17 @@
Spiel-Code