Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A host can start a quiz that has no questions

未关闭 适合新手
#162 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
express, postgresql, react, typescript
领域
backend, frontend

调研方向

从 apps/frontend/src/screens/LiveQuiz.tsx 开始,阅读“Start Game”按钮附近的代码(约第 349 行),该按钮目前只检查 participants.length。找到组织者加入时收到的会话载荷是在哪里构建的,并添加题目数量,以便按钮可以在显示原因的情况下被禁用。另外检查 quiz:start 处理器,以及结束空会话的 quiz:next-question 路径,判断服务端防护应放在哪里。完成标准是:空测验无法开始,并且界面会说明原因。

由索引模型根据 Issue 内容生成。

描述

bug enhancement good first issue help wanted UI & UX

The organizer's Start button in the lobby only guards against having no players:

apps/frontend/src/screens/LiveQuiz.tsx (~line 349):

<button onClick={handleStart} disabled={participants.length === 0} ...>
  Start Game
</button>

Nothing checks that the quiz has any questions.

Starting an empty quiz walks the room through quiz:start → the 3-second "GET
READY!" screen → quiz:next-question with index 0, which finds no question and
immediately ends the session:

if (!sessionId || !questions[questionIndex]) {
    await endQuizSession(sessionId);
    ...
    broadcastToSession(sessionId, 'quiz:ended');
}

Every participant sees "GET READY!" and then, three seconds later, "Quiz
Finished! Congratulations Winners!" with an empty podium. The session is now
COMPLETED in the database, so the host has to create a new one.

The same applies to a quiz whose questions were all deleted, and it fails
identically with 1 participant and 0 questions.

Where to fix it. The lobby does not currently fetch the question list, so
this needs the count available client-side — either included in the session
payload the organizer already receives on join, or fetched separately.

Guarding only in the UI is not quite enough, since the WebSocket message can be
sent directly; a server-side check in quiz:start would be the complete fix.
Frontend-only is still a worthwhile first step — say in your PR which you did.

Definition of done:

  • The Start button is disabled when the quiz has no questions
  • The disabled state explains why, rather than just being greyed out
  • An empty quiz cannot be driven into a COMPLETED state by mistake
主要语言
TypeScript
星标
21
派生
7
平均合并
4 小时 31 分钟
30 天内合并 PR
22

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TheCodeHeist-Coder/Rexial 的其他 Issue

查看 TheCodeHeist-Coder/Rexial 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。