Duke University Mathematics Math 105L & 106L Sequence High-Throughput Autonomous Pipeline

Gradescope Interface Technical Manual

Comprehensive architectural manual for the autonomous instructional grading, submission validation, and multi-channel notification infrastructure powering Duke University Laboratory Calculus.

⚙️ Infrastructure & API Architecture

Modular Python tools located at ~/src/gradescopetools/ driving automated synchronization, verification, and email dispatch.

gradescope_tasks.py Core Client

REST API wrapper interfacing with Gradescope endpoints. Extracts session cookies and CSRF tokens, reads rubric outlines, submits batch extensions, and schedules assignment release dates.

duke_mail_merger.py Graph REST

Direct Microsoft Graph API OAuth2 mail engine. Uses cached Duke credentials (~/.duke_token_cache.bin) to send formatted HTML communications and PDF attachments from rb6@duke.edu.

student_status_reporter.py Analytics

Roster-wide mastery tracker calculating total Passed vs. No-Pass assignments, evaluating semester-end extension eligibility, and surfacing critical warning alerts.

quiz_retake_manager.py Retake Core

Automates the Quiz Retake lifecycle: creates retake assignments, enforces the Download Delay Rule (1 wk + 1 hr), and creates duplicate Quiz <N> late retake items one year post-term.

Hourly Scan Verification PDF Auditing

Runs every hour for active assignments. Parses JSON submission objects, tests page count against official PDF templates, and detects inverted pages, triggering instant 12-hour extensions and mobile scanner guidance.

update_grades.py Gradebook Sync

Parses raw Gradescope CSV exports into Canvas-compliant gradebook matrices, recalculates weighted components, and synchronizes finalized scores with official Duke registrar records.

📬

1. Catalog of Student Notifications

11 Distinct Workflows

Automated student communications designed to maintain radical transparency, support mastery learning, and minimize procedural penalties.

Notification Type Trigger / Cadence Target Audience Operational Logic & Autonomous Action
Due-Today Reminder Due date at 8:00 AM Unsubmitted enrolled students Dispatches morning reminder of upcoming 11:59 PM deadline on Gradescope. Strictly limited to current assignments.
Scan Defect & Extension Notice Hourly verification post-upload Student recipient (Grader CC'd) Fired when uploaded PDF has missing pages, inverted order, or camera photography flaws. Automatically grants a 12-hour extension and provides mobile scanning guidance.
Missing Deadline Alert Morning after deadline (8:00 AM) Unsubmitted students Informs students that the current assignment deadline has closed without a recorded submission, providing immediate next steps for resubmissions.
Missed Quiz & Retake Notice Following quiz score release Students with NP or absent Notifies student that the original quiz score is published and that the corresponding Quiz Retake is open with dates and submission criteria.
Retake Score Release 1 week + 1 hour post-retake open Retake participants Reports graded retake score, pass/no-pass outcome, and updated syllabus mastery progress. Guarded by the Download Delay Rule.
Tuesday Resubmission Reminder Tuesdays at 9:00 AM Students with eligible prior work Consolidated weekly digest detailing eligible worksheets and lab reports that qualify for Tuesday resubmission deadlines.
Comprehensive Status Report Mid-semester & term milestones All enrolled students Individualized transcript outlining worksheets passed vs. NP, quiz scores, retake statuses, lab marks, and overall trajectory.
100% Perfect Score Praise Immediate upon grade finalization Qualifying students Encouraging congratulatory recognition dispatched whenever a student achieves a perfect 100% score on a worksheet or lab report.
Official Reschedule Broadcast Calendar modification event All enrolled students Official class announcement when an assignment deadline is universally adjusted (e.g. Worksheet 10-3 extended to Nov 9).
Video Project Group Allocation Project kickoff launch Assigned student teams Distributes team members, project prompt instructions, benchmark deadlines, and video upload specifications.
Solo Lab Report Warning Upon submission of solo report Solo submitter Warns students that laboratory reports are collaborative group investigations and prompts linking lab partners on Gradescope.
📱 Standard Mobile Scanner Instruction

When a submission exhibits illegible photography or missing pages, the automated pipeline provides the following standard recommendation:

“Please submit using a mobile document scanning application rather than loose camera photos or flatbed scans. We strongly recommend the official Gradescope mobile app (iOS/Android), or built-in utilities such as Apple Notes (iOS), Google Drive Scan (Android), Microsoft Lens, Adobe Scan, or Genius Scan. An automated 12-hour extension has been posted to your Gradescope account.”
🧑‍🏫

2. Teaching Assistant (TA) Notifications Catalog

4 Operational Workflows

Autonomous coordination ensuring undergraduate and graduate TAs stay aligned on grading timelines, rubric standards, and shift coverage.

Notification Type Cadence / Trigger Audience Operational Description & Content
Thursday Grading Reminder Thursdays at 4:00 PM All Math 105L/106L TAs (rb6 CC'd) Comprehensive kickoff: assignments closing Thursday night, assigned grading rubrics, grading deadlines (Sunday 11:59 PM), and grading rubrics.
Monday Grading Follow-up Mondays at 9:00 AM TAs with unfinalized queues Identifies lingering unsubmitted rubrics, incomplete student evaluations, or unresolved student regrade requests.
Daily Lab & Shift Schedule Daily at 7:30 AM Active daily TAs & Instructor Summary of active lab shifts, room assignments, problem session schedules, and cumulative years of TA experience for peer mentorship.
Prospective TA Recruitment 1 week post initial announcement Past qualified TAs Follow-up reminder to past high-performing TAs who have not yet submitted their When2meet or Qualtrics availability for the next term.
🛡️

3. Instructor Notifications Catalog (Sent to Rann Bar-On)

9 Audit Streams

Real-time audit telemetry guaranteeing full human oversight over every automated deadline modification, extension grant, and student contact.

Notification Type Cadence / Trigger Destination Content & Autonomous Audit Payload
Assignment Creation / Update Audit Immediate upon API action rb6@duke.edu Dispatched whenever an assignment is created or updated on Gradescope (title, dates, windows, extensions, rubrics) with the explicit reason logged.
Daily Morning Student Digest Daily 8:00 AM – 12:00 PM rb6@duke.edu Batched digest of all student messages dispatched over the prior 24 hours, parsed from grades/.sent_student_notifications.json.
Re-Retake Completion Immediate Alert Immediate upon submission rb6@duke.edu, CC rann@rannbar-on.com Sent when a student requiring re-retakes finishes an individual assignment or fulfills all needed re-retakes, including score and trajectory.
Critical No-Pass Threshold Warning Upon grade calculation rb6@duke.edu Fired whenever a student accumulates their 5th Worksheet NP, 3rd Quiz NP, or 2nd Lab NP.
Excessive No-Pass Block Notification On extension evaluation rb6@duke.edu Fired when a student exceeds 8 Worksheet NPs, 4 Quiz NPs, or 2 Lab NPs. Extensions blocked until human authorization.
Semester-End Extension Audit Report Scheduled evaluation rb6@duke.edu Full roster audit detailing students eligible for semester-end extensions (until Friday, Dec 4, 2026 at 11:59 PM). Students are never emailed; only Rann is notified.
Quiz Late Retake Setup Alert Upon assignment creation rb6@duke.edu Confirms creation of Quiz <N> late retake available Dec 4–5, 2027 (1 year post-term) with old extensions cleared.
Status Report Sample Previews Prior to class-wide broadcast rb6@duke.edu Dispatches representative sample student status emails to Rann for verification prior to full-class batch transmission.
Election & Switchover Alerts Daily EV morning / E-Day rann@rannbar-on.com Civic web platform telemetry: EV turnout shifts, automated transition to Election Day polling places, and API token refreshes.

⚖️ Strict Instructional Governance & Guardrails

Mandatory policy guardrails hardcoded into all scripts, cron workflows, and AI pair-programming agents.

Guardrail 1 STRICT PROHIBITION

Non-Current Assignments Absolute Rule

NEVER send any notifications whatsoever regarding non-current assignments to any students in any section. Deadlines, extensions, submission window modifications, and student notifications MUST ONLY occur for CURRENT assignments unless explicitly instructed by Rann. All extensions on non-current assignments must remain removed.

Guardrail 2 PERMANENT EXCLUSION

Permanently Dropped & Deregistered Students Policy

Students who have formally dropped, withdrawn, or been deregistered from the course roster are permanently excluded from all automated course operations. They must NEVER receive any notifications, extensions, retakes, or academic progress reports under any circumstances across all instructional pipelines.

Guardrail 3 SEMESTER END

Semester-End Extensions Policy

Extensions until undergraduate classes end (Friday, December 4, 2026 at 11:59 PM) are granted ONLY to students who have either >2 quiz NPs or >4 worksheet NPs. In all such cases, NEVER email students; only email Rann (rb6@duke.edu).

Guardrail 4 1-YEAR POST TERM

Quiz Late Retake Architecture

For quizzes, NEVER extend deadlines on original quizzes. Instead, duplicate the original quiz as Quiz <N> late retake, set available Dec 4–5, 2027 (1 year post-term), and clear all prior extensions on the original quiz.

Guardrail 5 1 WK + 1 HR DELAY

Quiz Retake Score Download Delay Rule

Quiz retake scores are not downloaded to rawscores/ or released to students until one week and one hour after the retake assignment first opens. This delay is guarded programmatically in gradescope_tasks.py by is_quiz_retake_eligible_for_download().

📄

Official Publication Reference

The complete publication-quality technical report is compiled in LaTeX and archived as a standalone PDF document.