總學生數
-
總作答筆數
-
班級分布
-
學生清單
| ID | 班級 | 座號 | 姓名 | 最後活動 | 建立 |
|---|
作答紀錄
| 時間 | 班級 | 座號 | 姓名 | 頁 | 類型 | 題目 | 答案 | 正確 |
|---|
資料表:
students(id, class, seat_no, name) 與 records(id, student_id, page, item_id, item_type, question, answer, is_correct, score, payload, created_at) 已建立於 D1 elderly-ch01-db (c0947da9-48c4-4898-a912-99a4949eef3a)。可用 wrangler d1 execute 直接 SQL 查詢。SQL 範例(在終端機執行):
wrangler d1 execute elderly-ch01-db --remote --command "SELECT class, name, COUNT(*) as 作答數 FROM records r JOIN students s ON s.id=r.student_id GROUP BY class, name ORDER BY 作答數 DESC;" wrangler d1 execute elderly-ch01-db --remote --command "SELECT * FROM records WHERE page=9 ORDER BY created_at DESC LIMIT 20;"