✨ Added Answer-Count to admin screen
This commit is contained in:
@@ -471,5 +471,5 @@ class PrivateStorageItem(PublicStorageItem):
|
||||
|
||||
|
||||
class UpdateStorageItem(BaseModel):
|
||||
filename: str
|
||||
alt_text: str
|
||||
filename: str | None
|
||||
alt_text: str | None
|
||||
|
||||
@@ -197,6 +197,10 @@ async def update_image_data(
|
||||
file_data = await StorageItem.objects.get_or_none(id=file_id, user=user, deleted_at=None)
|
||||
if file_data is None:
|
||||
raise HTTPException(status_code=404, detail="File not found")
|
||||
if data.alt_text == "":
|
||||
data.alt_text = None
|
||||
if data.filename == "":
|
||||
data.filename = None
|
||||
file_data.filename = data.filename
|
||||
file_data.alt_text = data.alt_text
|
||||
await file_data.update()
|
||||
|
||||
@@ -390,6 +390,7 @@ async def submit_answer(sid: str, data: dict):
|
||||
answers, game_pin=session["game_pin"], data=answer_data, q_index=int(float(data.question_index))
|
||||
)
|
||||
player_count = await redis.scard(f"game_session:{session['game_pin']}:players")
|
||||
await sio.emit("player_answer", {})
|
||||
if len(answers.__root__) == player_count:
|
||||
# await sio.emit(
|
||||
# "question_results",
|
||||
|
||||
Reference in New Issue
Block a user