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: v30View latest version
Automates attendance tracking and cold-call selection for both T&E and L&C classes.
| File | Type | Purpose |
|---|---|---|
| T&E (Trusts & Estates) | ||
oncall-selection.http.tsx | HTTP | Algorithmically selects 6 students for cold-calling |
oncall-notify.cron.tsx | Cron | Emails on-call list before class (3 PM) |
te-report-prompt.cron.tsx | Cron | Reminds Sarah to submit T&E report (6 PM) |
| L&C (Law & Capitalism) | ||
lc-oncall-selection.http.tsx | HTTP | Looks up preset on-call from syllabus |
lc-oncall-notify.cron.tsx | Cron | Emails on-call list before class (8 AM) |
lc-report-prompt.cron.tsx | Cron | Reminds Sarah to submit L&C report (12 PM) |
| Shared | ||
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 |
|---|---|---|
| T&E | ||
oncall-notify | 3 PM Mon/Wed | 0 20 * * 1,3 |
te-report-prompt | 6 PM Mon/Wed | 0 23 * * 1,3 |
| L&C | ||
lc-oncall-notify | 8 AM Mon/Wed | 0 13 * * 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.
Important: After first push, get the lc-oncall-selection.http.tsx endpoint URL from Val.town UI and update line 10 of lc-oncall-notify.cron.tsx.
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:
Shared:
- Form Responses 1 - Student self-reports (form-owned, read-only)
- Cold Call Log - Audit trail of actual cold calls
T&E:
- T&E Roster - Student list + cumulative tracking (columns: student_name, last_name, pool, cold_call_count, last_called, absences, concerning_events)
- T&E On-Call - Daily on-call selections (for idempotency)
L&C:
- L&C Roster - Student list + cumulative tracking (same columns, minus pool)
- L&C Assignments - Preset syllabus schedule (columns: date, student_name)
- L&C On-Call - Daily on-call cache (for idempotency)
- Create
L&C Rostertab with columns: student_name, last_name, cold_call_count, last_called, absences, concerning_events - Create
L&C Assignmentstab with columns: date, student_name - Populate
L&C Assignmentswith syllabus data (one row per student per date)
Example L&C Assignments:
| date | student_name |
|---|---|
| 2026-01-13 | Alice Adams |
| 2026-01-13 | Bob Baker |
| 2026-01-15 | Carol Chen |