feat: guest access, pricing modal, UI polish, LaTeX prompt fix
- Remove login gate, allow guest browsing with Sign in link - Add favicon (book logo) - Add pricing modal (Free/Standard/Exam) with hover animations - Dynamic course list from DB instead of hardcoded - Enforce LaTeX in AI trio generation prompt - UI improvements: homepage animations, analytics donut chart, error book cards - Fix error book locked state for guests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,7 @@ Solution requirements:
|
||||
- Mark common mistakes with <div class="common-error">...</div>
|
||||
|
||||
KaTeX formula rules:
|
||||
- CRITICAL: ALL math expressions MUST use LaTeX inside $ or $$. NEVER use Unicode symbols like ⁿ, ≥, ≠, ², ×, ∑, ∈. Use $n$, $\geq$, $\neq$, $^2$, $\times$, $\sum$, $\in$ instead.
|
||||
- Block formula: $$ on its own line, with blank lines before and after
|
||||
- Inline formula: $x^2$ no line break
|
||||
- Matrix: \\begin{{bmatrix}} ... \\end{{bmatrix}}
|
||||
@@ -174,6 +175,7 @@ Rules:
|
||||
- Keep each item matched to the same question_number
|
||||
- All text must be in English
|
||||
- HTML only, KaTeX compatible
|
||||
- CRITICAL LaTeX requirement: ALL mathematical expressions MUST use LaTeX notation wrapped in $ (inline) or $$ (display block). NEVER use Unicode math symbols like ⁿ, ≥, ≠, ², ×, ∑, ∈, ⊆, etc. Instead use $n$, $\geq$, $\neq$, $^2$, $\times$, $\sum$, $\in$, $\subseteq$, etc. Every variable, number in a formula, operator, and equation must be inside $ delimiters.
|
||||
- For MC questions, explain why the correct option is right and why the others are wrong
|
||||
- For long questions, show a complete derivation or reasoning chain
|
||||
- Use <ol> or numbered steps in solution when appropriate
|
||||
|
||||
47
backend/regen_comp2711h_trio.py
Normal file
47
backend/regen_comp2711h_trio.py
Normal file
@@ -0,0 +1,47 @@
|
||||
"""
|
||||
One-off script: clear AI trio for COMP2711H paper and regenerate with LaTeX-enforced prompt.
|
||||
Run inside the backend Docker container or locally with .env loaded.
|
||||
"""
|
||||
import asyncio
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
from dotenv import load_dotenv
|
||||
load_dotenv(os.path.join(os.path.dirname(__file__), "..", ".env"))
|
||||
|
||||
from app.services.supabase_client import get_supabase
|
||||
from app.services.paper_processor import _resume_ai_trio
|
||||
|
||||
PAPER_ID = "5ee87a62-65bf-4952-be40-fcdf9ba7ca63" # COMP2711H 2025 fall final
|
||||
|
||||
|
||||
async def main():
|
||||
sb = get_supabase()
|
||||
|
||||
# 1. Clear existing AI trio fields so _resume_ai_trio will regenerate them
|
||||
questions = sb.table("paper_questions").select("id, question_number, solution").eq("paper_id", PAPER_ID).execute().data
|
||||
print(f"Found {len(questions)} questions for paper {PAPER_ID[:8]}")
|
||||
|
||||
cleared = 0
|
||||
for q in questions:
|
||||
if q.get("solution"):
|
||||
sb.table("paper_questions").update({
|
||||
"knowledge_reminder": "",
|
||||
"ai_hint": "",
|
||||
"solution": "",
|
||||
}).eq("id", q["id"]).execute()
|
||||
cleared += 1
|
||||
q["solution"] = None # so _resume_ai_trio picks it up
|
||||
|
||||
print(f"Cleared AI trio for {cleared} questions. Regenerating...")
|
||||
|
||||
# 2. Regenerate
|
||||
await _resume_ai_trio(sb, PAPER_ID, questions)
|
||||
print("Done! AI trio regenerated with LaTeX-enforced prompt.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user