Update app.py
Browse files
app.py
CHANGED
|
@@ -68,14 +68,11 @@ def load_quiz(data):
|
|
| 68 |
def start_quiz():
|
| 69 |
if participants and selected_questions:
|
| 70 |
current_question['started'] = True
|
| 71 |
-
index = current_question['index']
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
emit('enable_end_quiz', room=request.sid) # Enable "End Quiz" for the host
|
| 77 |
-
else:
|
| 78 |
-
emit('error', {"message": "Starting question exceeds available questions."}, room=request.sid)
|
| 79 |
|
| 80 |
@socketio.on('restart_quiz')
|
| 81 |
def restart_quiz():
|
|
|
|
| 68 |
def start_quiz():
|
| 69 |
if participants and selected_questions:
|
| 70 |
current_question['started'] = True
|
| 71 |
+
index = current_question['index']
|
| 72 |
+
question = selected_questions[index]
|
| 73 |
+
# Send the starting question to all clients
|
| 74 |
+
emit('new_question', {"question": question["question"], "options": question["options"], "index": index + 1}, room='quiz')
|
| 75 |
+
emit('enable_end_quiz', room=request.sid) # Enable "End Quiz" for the host
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
@socketio.on('restart_quiz')
|
| 78 |
def restart_quiz():
|