law-student-tracker
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v26View latest version
Automates T&E attendance tracking and cold-call selection.
| File | Type | Purpose |
|---|---|---|
oncall-selection.http.tsx | HTTP | Selects 6 students for cold-calling |
oncall-notify.cron.tsx | Cron | Emails on-call list before class |
te-report-prompt.cron.tsx | Cron | Reminds Sarah to submit T&E report |
lc-report-prompt.cron.tsx | Cron | Reminds Sarah to submit L&C report |
post-class-report.http.tsx | HTTP | Receives reports, updates tracking, triggers alerts |
main.http.tsx | HTTP | Sheets connection test |
setup-test-data.http.tsx | HTTP | Creates test roster (dev only) |
Set these in Val.town UI (Settings → Environment Variables):
| Variable | Purpose |
|---|---|
GOOGLE_APPLICATION_CREDENTIALS | Service account JSON (full string) |
NOTIFICATION_EMAIL | Email for notifications (Sarah or test) |
REPORT_API_KEY | Secret key for report submissions |
Set in Val.town UI for each cron val. Times are UTC:
| Val | EST Time | UTC Cron |
|---|---|---|
oncall-notify | 3 PM Mon/Wed | 0 20 * * 1,3 |
te-report-prompt | 6 PM Mon/Wed | 0 23 * * 1,3 |
lc-report-prompt | 12 PM Mon/Wed | 0 17 * * 1,3 |
Note: Adjust for DST. These are EST (UTC-5). EDT (summer) is UTC-4.
POST to post-class-report.http.tsx endpoint with:
curl -X POST "https://sahar--{hash}.web.val.run" \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_REPORT_API_KEY" \ -d '{ "date": "2026-01-12", "class_type": "te", "cold_calls": [ {"student_name": "Alice Adams", "result": "completed", "performance": "great"}, {"student_name": "Bob Baker", "result": "absent"}, {"student_name": "Carol Chen", "result": "refused"} ], "absences": ["David Davis"] }'
Fields:
date: Class date (YYYY-MM-DD)class_type: "te" or "lc"cold_calls: Array of students called onresult: "completed" | "absent" | "refused"performance: "great" | "normal" | "bad" (only for completed)
absences: Other absent students (not on on-call list)
Response:
{ "success": true, "date": "2026-01-12", "cold_calls_logged": 3, "absences_logged": 1, "unprepared_processed": 0, "alerts_sent": [] }
Automatic email alerts at thresholds:
- 3 absences → Contact dean + student
- 5 concerning events → Contact student
Concerning events = absent + unprepared + refused + bad performance.
Uses Google Sheet with tabs:
- Form Responses 1 - Student self-reports (form-owned, read-only)
- T&E Roster - Student list + cumulative tracking
- T&E On-Call - Daily on-call selections (for idempotency)
- Cold Call Log - Audit trail of actual cold calls