How tarwaaa/zero-gravity-cs works
Purpose and runtime
This repository is a single-page Streamlit prototype for teacher onboarding into Zero Gravity. It prioritises demonstrating a scripted student tutor experience before class confirmation and optional assignment publication. The executable entry point is app.py; Streamlit presentation defaults are in .streamlit/config.toml. Dependencies and test runtime are defined by requirements.txt.
Application shell and stateful navigation
app.py owns the full UI, workflow routing, local styling, and session-state lifecycle. Streamlit session state acts as the only persistence boundary: it stores current journey stage, selected class, assignment edits, and published/completed status during a browser session. Restart/reset returns the prototype to its initial state; there is no backend, authentication, or durable store.
Tutor-preview stage
The first activation stage in app.py presents a fixed Year 9 Mathematics tutor interaction. Teacher responses are constrained to scripted choices and produce predetermined replies. This is a product-value demonstration boundary: no model, student account, content service, or input interpretation is invoked.
Class-confirmation stage
The next stage exposes a static, mocked MIS-synchronised list of three existing classes within app.py. The selected class is retained in session state and becomes context for later setup and assignment views. No MIS API, school data source, permission check, or student roster is connected.
Next-action decision boundary
After class selection, the flow branches in app.py: teachers can finish setup immediately or continue to a recommended starter-assignment route. This is the central control-flow decision. Finishing setup preserves the truthful empty-product state rather than implying existing student activity; assignment setup remains available as the recommended continuation.
Assignment authoring and publication
The optional route in app.py displays a prefilled starter assignment. Teachers can edit title, question count, and due date; difficulty remains fixed. Duration is derived locally from question count using the prototype’s rounding rule, rather than a service or analytics model. Publishing changes only Streamlit session state and leads to an assignment-success view; it does not create a remote assignment or notify students.
Status, insights, and validation boundaries
Success and activity views in app.py explicitly distinguish zero real student starts from illustrative future insights. The prototype therefore avoids representing simulated information as operational analytics. Behavior is protected through Streamlit AppTest/pytest coverage in tests/test_app.py, including route transitions, retained state, validation, publication, restart, and duration calculation.
Main entry points: app.py Starter assignment setup · test_app.py AppTest coverage · config.toml Streamlit defaults · requirements.txt Dependencies
Components 14
Streamlit prototype
Single-process teacher onboarding experience.
- Streamlit runtime
app.py - App shell and routing · Owns presentation, routing, styling, and lifecycle.
app.py - Session state · Only persistence boundary; resets with the browser session.
app.py - Duration calculation · Derives duration from question count using prototype rounding.
app.py - AppTest coverage · Covers routes, state retention, validation, publication, reset, and duration.
tests/test_app.py - Streamlit defaults
.streamlit/config.toml - Dependencies
requirements.txt
Onboarding flow
State-driven stages rendered by app.py.
- Tutor preview · Fixed Year 9 Maths demonstration with predetermined replies.
app.py - Class confirmation · Shows three static MIS-like classes.
app.py - Next-action decision · Choose finish setup or starter-assignment setup.
app.py - Empty product status · Truthfully shows no student activity after setup.
app.py - Starter assignment setup · Prefilled assignment with editable title, count, and due date.
app.py - Publish assignment · Changes local published status only.
app.py - Success and insights · Separates zero real starts from illustrative future insights.
app.py
Connections 16
- Streamlit runtime → App shell and routing: runs
- Streamlit defaults → Streamlit runtime: configures
- Dependencies → Streamlit runtime: provides runtime
- App shell and routing → Session state: reads and writes
- App shell and routing → Tutor preview: starts at
- Tutor preview → Class confirmation: continues to
- Class confirmation → Session state: stores selected class
- Class confirmation → Next-action decision: confirms class
- Next-action decision → Empty product status: finish setup
- Next-action decision → Starter assignment setup: recommended route
- Starter assignment setup → Duration calculation: uses question count
- Starter assignment setup → Session state: stores edits
- Starter assignment setup → Publish assignment: publishes
- Publish assignment → Session state: sets published status
- Publish assignment → Success and insights: shows success
- AppTest coverage → App shell and routing: validates behavior