Feature: Improve teacher feedback for fetch failures and empty classrooms
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
PR #603 fixed a crash that occurred when the student data server was offline. The fix returns [] on any fetch failure, which prevents the crash — but leaves the teacher with a blank dashboard and no explanation. This issue tracks two follow-on UX improvements that build on that fix.
Problem 1 — The teacher can't tell if the fetch failed
fetchStudentData() currently returns [] for three distinct situations:
| Case | Cause | Relevant long-term? |
|---|---|---|
| Missing env var | MOCK_USER_DATA_URL not set |
No — dev/config only |
| Bad HTTP response | Server returned 4xx/5xx | Yes |
| Network error | Server unreachable | Yes |
The calling code in pages/dashboard/[id].js receives [] in all cases and passes it straight to DashTabs as data. There's no way to distinguish a failed fetch from an empty class.
Proposed fix:
Return a structured result from fetchStudentData() instead of a bare array:
// Success
return { error: null, data: await response.json() };
// Runtime failures (surface to teacher)
return { error: 'FETCH_FAILED', status: response.status, data: null };
return { error: 'NETWORK_ERROR', data: null };
// Config issue (dev only — keep silent, log only)
console.warn('MOCK_USER_DATA_URL is not defined.');
return { error: 'MISSING_URL', data: null };
[id].js would pass the error code as a prop. For runtime failures, the dashboard UI would render an error message: "We couldn't load your students. Please try refreshing, or contact support at [email protected] if the problem persists." The MISSING_URL case should remain a silent console log, as it's dev-facing.
Problem 2 — Empty classrooms show nothing
When a class has no students yet, DashTabs renders a blank page:
Proposed fix:
In getServerSideProps in [id].js, include fccUserIds in the classroom query. If it's empty, the dashboard should not render an empty table. Instead, it should:
- Tell the teacher there are no students in the class yet
- Display the classroom's join link with a copy button
- Instruct the teacher to share the link with their students
Files likely affected
util/student/fetchStudentData.jspages/dashboard/[id].js- The component(s) rendered by
DashTabsthat display student data prismaquery inpages/dashboard/[id].js(addfccUserIdsto the select)
- Ngôn ngữ chính
- TypeScript
- Star
- 156
- Fork
- 141
- Merge trung bình
- 15 giờ 56 phút
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của freeCodeCamp/classroom
-
Bug: Classrooms can be created with no certificationsCó thể đã có người làm @TsaH0 đã nhận 85 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
freeCodeCamp/classroom#551 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Follow-ups from toolchain and local dx workCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 Hơn một tuần Mức phù hợp với người mới 15/100
freeCodeCamp/classroom#640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(UI): Enhancement to the admin dashboard page issue - search barCó thể làm lại được @gauravi-2007 đã nhận 20 ngày trước và không có pull request nào đang mở. Đang mở
freeCodeCamp/classroom#550 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature Request: Enable Exporting Student Progress Data (CSV/PDF)Có thể làm lại được @gauravi-2007 đã nhận 20 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
freeCodeCamp/classroom#547 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ToS + privacyCó thể làm lại được @raisedadead đã nhận 558 ngày trước và không có pull request nào đang mở. Đang mở
freeCodeCamp/classroom#544 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của freeCodeCamp/classroom
Issue tương tự
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 61/100
lingdojo/kana-dojo#33465 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
opensheetmusicdisplay/opensheetmusicdisplay#1885 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Time zone picker still shows America/Winnipeg as -06:00 after Manitoba’s move to permanent UTC-5Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
home-assistant/frontend#55537 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
What's New sheet: inline rows join title and summary with no space in copied/accessibility textĐang mởneeds-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
manaflow-ai/cmux#31347 ·
Maintainer thường phản hồi trong vòng 1 ngày