Assignment Solver — FastAPI Automation
What was built inside the solver service and why the repository stays private.

Pipeline & core implementation
async def insert_solution_to_playground(course, assign, q):
ai_res = await solve_question_with_ai(
course, assign, q["hash"]
)
code = strip_code_comments(ai_res["solution_code"])
clean = sanitize_extracted_code(code)
if clean.startswith("{") and '"solution_code"' in clean:
clean = sanitize_extracted_code(
generate_solution_with_groq(q)
)
payload = {
"source_code": clean,
"autoSave": True,
"isAttempt": False,
}
pg = ai_res["playground_hash"]
return await SubmitClient().patch(
f"/playground/coding/h/{pg}/", payload
)What we built in Assignment Solver
Built as an asynchronous FastAPI service in Python (main_.py) to automate coding portal API workflows end-to-end across desktop and Termux on Android. It wraps Chrome124 TLS fingerprinting with curl_cffi and automatic httpx failover, orchestrates multi-key Gemini model waterfalls with per-key cooldown tracking, falls back to Groq when responses degrade, parses starter files from both standalone coding playgrounds and multi-file GitLab project repositories (Python, JavaScript, Node/Express, React, SQL, and MongoDB), strips comments cleanly by language, and polls timed exam windows cleanly in background tasks.
Self-healing extraction & draft-only staging
Model outputs frequently leak markdown fences or nested JSON payloads, so every response passes through sanitize_extracted_code and strip_code_comments before anything leaves the worker. If the sanitizer catches malformed JSON, the pipeline immediately invokes Groq to regenerate a clean solution and refreshes stale playground hashes automatically. Generated answers only patch autoSave drafts with isAttempt and run_hidden_test set to false so final execution remains manual.
Why the source repository is private
The full implementation is pushed to a private GitHub repository under divyanshuprakas-h/assignment-solver, so public source access is not provided here. Keeping it private protects academic integrity and prevents straightforward abuse against live course portals, while leaving the architectural lessons open to discuss: TLS session hardening, LLM circuit breakers, async task state machines, and portable Termux deployment.
Measured benchmarks
Project status & checklist
● Completed- FastAPI backend with classic assignment, URL auto-router & timed mash-up pollers
- Multi-key Gemini circuit-breaker pipeline with Groq failover and JSON/AST healing
- Full coding + GitLab project playground support across Python, JS, React, SQL & MongoDB
- Android Termux setup scripts (setup_phone.sh, run.sh) and private GitHub repo archive
All planned milestones complete.