Spaces:
Running
Running
Commit History
8 days ago
-
Uploader: keep paper question numbers out of CMS text; preprod tagging login Running
Sahil Kumar +1: Claude Opus 5.5Word uploader (parse_word): - Store the paper's own question number (shuffled papers run 67, 59, 77 ...) in question_num and strip it from the stem, so "67." no longer lands in the CMS question text. - Drop a leading "Sol:" / "Solution:" label from the solution. - Review panel and upload results show the paper's number, not the position. Tagger on preprod: - Match the configured CMS origin when reading the login token (preprod is cmspreprod.devinfinitylearn.in, which has no "community" in it). - Use the SME's own CMS token for TOC lookups first; the shared service account only exists on production. Shared credentials can be overridden with IL_COMMUNITY_PHONE / IL_COMMUNITY_PASSWORD. Also ships pending work: Question Reveal PPT page, foundation TOC builders/export, README/nav/home updates and their tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>301bae7
-
Question + Blank PPT: new page, blank slide after every question
Sahil Kumar +1: Claude Opus 5.5/ppt_blank builds the same deck as Quiz PPT, but each question slide is followed by the same template slide with no question on it (same header and topic/year boxes; notes "<qid> (blank)"). Chapter/topic title slides are not doubled. It shares the Quiz PPT template and /ppt/start (blank_after=1); Quiz PPT's own output is unchanged. Own nav link, dashboard card, saved inputs, file prefix (quiz_blank_) and usage label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>59c6e79
-
Add tags feature
Sahil Kumarfd498c8
-
Foundation Tagging (CBSE Grades 3-10), KCET TOC, project map and cleanup
Sahil Kumar +1: Claude Opus 5.5Foundation Tagging (/foundation): AI Tagging for school grades. Each grade is its own CMS exam with its own chapter/topic nodes, so foundation_toc.json keeps the exact node IDs per TOC path and push_tags tags straight from them. - CBSE Grade 6-10 (Maths/Science): build_foundation_toc.py, from the master-TOC export via live CMS navigation - CBSE Grade 3-5 (Maths, EVS, English): build_foundation_exam_toc.py, from each grade's exam-TOC export, checked row by row against live CMS - /tag and /foundation share one set of routes and tag.html; the grade is set from the chosen exam KCET on AI Tagging: kcet_toc.json from the CMS KCET export (build_kcet_toc.py), resolved from stored IDs like the foundation exams. Fixes and cleanup: - AI Tagging used make_template without importing it, so the live CMS option lists were never used (always the snapshot) - unused imports and other lint across backend/ and tests/ - docs/PROJECT_MAP.md: what every file is for; README updated - handover docume…1936d6d
-
resolve_toc: one Excel row per question (first exam match) + dashboard card gating
Sahil KumarThe SME asked for a single row per question instead of one row per match. A subtopic can sit under several chapters within one exam, so _resolve_toc_variants now returns the FIRST of them in CMS's own order and reports "first of N <exam> rows" in Exam Match. The extra matches are not listed, but Exam Match still says how many existed, so a question with alternatives stays visible rather than being silently dropped or silently multiplied into rows nobody asked for. Also fixes the dashboard: each tool card is now gated the way _nav.html already gates it, and the Usage card is only shown where the link would work, since /usage refuses any request that is not from the host laptop. 563 tests pass.6feaff0
-
Question Text tool (5,000 QIDs per run) + pending approve/unapprove, solutions and Resolve TOC work
Sahil Kumar +1: Claude Opus 5.5Question Text (/qtext): paste QIDs, get prompt-ready plain text (QID, type, question, options; MathML as LaTeX), blind by default. Runs as a background job like Resolve TOC so a 5,000-ID batch does not time out: start / status / cancel / preview / download. Output keeps the pasted order; cancel keeps what was already fetched. Downloads as .txt, .md, or a .zip split into files of N questions. Home card and README section added. Also commits the pending Unapprove & Approve tool, solutions sources/PDF reader, and Resolve TOC bulk/exam-filter changes with their tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>5b082d6
-
deckbuilder: standalone Custom PPT builder (manual slides on a template)
Sahil KumarPure python-pptx engine (no Playwright/CMS), so it works on the Space. Cover slide, tabs-pasted tables, auto-fitted images with captions, speaker notes, dark/light auto text colour, blank 16:9 fallback. App-password only.fe0d41a -
lo: add question level (easy/moderate/difficult) column to classifier output
Sahil Kumar1bd6d74
-
ppt: TAB-separated outline parsing + per-run exam tag
Sahil Kumar- Parse Excel clipboard rows (Chapter<TAB>Topic<TAB>QID<TAB>Year) positionally, with a fallback token-walk for space-flattened pastes; header rows and index number columns are ignored. Fixes year being eaten as a q_no ('2022' alone). - SME picks the exam tag (NEET PYQ default, JEE Main/Advanced, or custom) per run on /ppt. It prints on every chapter/topic title slide rather than the hardcoded 'NEET PYQ'. Blank custom tags are rejected client-side. - PPT page: new tag picker + custom box, sessionStorage persistence, updated paste hints. Tests cover TSV/space parity, header cols, bare year, and the chapter-wise ZIP grouping.4f44eec
-
lo_poc: the NCERT box now follows the chapter you pick
Sahil Kumar +1: Claude Opus 5The backend already scoped NCERT to the selected chapter, but the box still listed every file in the folder and said "2 chapters available" whatever you ticked — so a Reproductive Health batch still looked as though it was dragging the Principles textbook along, and there was no sign that picking a chapter is how you choose the NCERT text. The box is now a live region driven by the chapter chips: "Using: Reproductive Health" once you pick it, "Pick a chapter above" before you do, and an amber note naming any picked chapter that has no file and will therefore be judged from the model's memory. Redrawn on load, on restore from sessionStorage, and on reset, so it can never sit stale next to a changed selection. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>ccbfdab -
lo_poc: require a chapter on the page, so NCERT is scoped to the batch
Sahil Kumar +1: Claude Opus 5Leaving the chapter chips blank meant "every chapter" — which was fine when the chapter only scoped the LO list, but it now scopes the NCERT text too. A Reproductive Health batch was quietly getting the Principles of Inheritance textbook pasted in beside it: ~21.7k tokens of chapter the questions have nothing to do with, and an open invitation for ncert_reference to cite it. The page now asks for the chapter these questions belong to, and both /lo_poc/prep and /lo_poc/apply refuse without one. apply still falls back to whatever the prompt was built with, so a reply is always checked against the chapter it was asked about; only a blank on both sides is refused, since that would let an LO from the wrong chapter validate. The CLI keeps its documented "no --chapter means all" behaviour — it reports the NCERT text it loaded per chapter, so the cost is visible there rather than hidden. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>67ac506 -
lo_poc: normalise NCERT PDF exports on read
Sahil Kumar +1: Claude Opus 5The two real chapters arrived as Mathpix exports of the NCERT PDFs, and they carry four mechanical artifacts. That matters more here than it would anywhere else: ncert_reference exists to be verbatim-checkable, so whatever is in the file is what a reviewer reads back. * Reproductive Health had 37 fullwidth CJK marks standing in for ASCII punctuation, used as SENTENCE punctuation with no following space — "reproduction,i.e.,physical", "functions.However,it". * 31 Mathpix CDN image URLs, ~130 chars each of noise the model cannot see. They become [figure], the marker cms_text already uses for images in question text, so the model meets one convention not two. * End-of-chapter EXERCISES: textbook questions, in a prompt already full of questions to be mapped. * OCR misreads of the gender symbols: 우 for ♀, $\sigma^{7}$ for ♂. Repaired when the file is READ rather than by a cleanup script. This folder grows a chapter at a time as the Biology sheet is completed, a…b74b0e5
-
lo_poc: NCERT chapter text in the prompt, and an ncert_reference column
Sahil Kumar +1: Claude Opus 5Without the textbook, ncert_alignment is the model's recollection of NCERT — exactly the judgement models are confidently wrong about. Drop one markdown file per chapter into backend/lo_poc/ncert/ and the call is made against the real text instead, with a new ncert_reference column quoting the section it rests on, so a reviewer checks one citation rather than re-reading the chapter. Markdown rather than PDF: no extraction step, none of the column-bleed and hyphen-breaks that PDF text extraction inflicts on NCERT pages, and the ## headings give the citation something to name. Files are matched on the CHAPTER NAME, so nothing has to be configured — "Reproductive Health.md", "03 Reproductive Health.md" and "reproductive-health.md" all match the chapter. The folder is GITIGNORED: the textbook is copyrighted and this repo pushes to a public Space. The whole feature is optional and degrades quietly. With no folder, no matching file, or the toggle off, the prompt drops the textbook section…72a3924 -
lo_poc: question format + NCERT alignment columns
Sahil Kumar +1: Claude Opus 5From the SME's "Style guide for LO mapping.docx". Two new question-level columns in both sheets, so a reviewer can slice a batch by what kind of question it is and how far it sits from the textbook. question_format is one of the guide's five: Assertion-Reason, Statement Type, Multiple Statement, Matrix Match, Single Correct MCQ. These are STRUCTURAL and the CMS cannot supply them — question_type reads "single correct mcq" for all five, a match-the-following included (ILQ-107874), so the prompt says in as many words not to trust the Type: line and gives the discriminator for each: two labelled statements is Statement Type, three or more with subset options is Multiple Statement, two columns to pair is Matrix Match. The rules were written against live examples of all five (ILQ-1700956 / 2083584 / 2170143 / 107874 / 124541). ncert_alignment is Within / Close to / Beyond NCERT, for the content the question tests rather than its shape. Both are matched case- and punctuation-insensitively…376bf96 -
lo_poc: confidence as a 0-100 percentage instead of high/medium/low
Sahil Kumar +1: Claude Opus 5Three words are too coarse to triage a few hundred rows by — an SME sorting for the weakest mappings cannot tell a shaky "medium" from a nearly-certain one. The prompt now asks for a whole number 0-100 and says how to use the range, the workbook column is headed "confidence (0-100)" and holds a real integer (so Excel sorts and filters it), and the page shows the number with a small meter under it. The parser stays tolerant, because a model told to write a number still sometimes writes something else: 85, "85", "85%", 0.85 and the old high/medium/low are all accepted, out-of-range values are clamped, and anything unusable is dropped rather than guessed at. Every value that is derived rather than stated raises a warning, so the sheet never implies a precision the AI did not give. Missing stays blank, never 0 — 0 would read as "certainly wrong". Summaries carry the spread, not just the mean: an average of 78 reads very differently once you see a third of the rows sit under 50. out/repl…b8b4b4b -
lo_poc: LO Mapping POC page, enabled locally and off on the Space
Sahil Kumar +1: Claude Opus 5The POC now lives on main so `python app.py` serves /lo_poc on the host laptop with no branch switching. It is NOT finished, so it must not reach SMEs yet: Hugging Face always sets SPACE_ID, and the tool enables itself everywhere except a Space. Setting ENABLE_LO_POC=1 in the Space's variables publishes it later — no code change, no separate branch. The guard closes all six endpoints, not just the nav link; hiding the link alone would leave /lo_poc/prep reachable by URL on the Space. The page wraps the POC's own CLI: its taxonomy, prompt builder, question reader and validator are imported, never reimplemented, so the page and `python lo_poc.py` cannot drift apart. Chapter picker with per-chapter LO counts, three question sources (CMS QIDs, an xlsx/csv upload, one pasted question), the copy-paste prompt, then hard validation against the sheet and the four-sheet workbook download. Generated run artifacts (prompt.txt, questions.json, the dated workbooks) are gitignored; the reply.json …eca8aa5 -
fix: keep match-the-following tables; ppt chapter-wise ZIP + title slides
Sahil Kumar +1: Claude Opus 5CMS question fetch — <figure> no longer swallows tables -------------------------------------------------------- CKEditor wraps tables in <figure class="table">, not just images, but cms_text collapsed every <figure> to a "[figure]" marker and returned without recursing. A "match the following" question, whose List I / List II grid IS the question, therefore reached the AI as nothing but the marker, and every tool downstream reported it as image-based (verify_assist.has_image saw the marker and flagged it). A <figure> is now recursed into: a nested <img> still emits the marker itself, a nested <table> renders as rows, and a figure holding neither (a media embed) keeps the marker rather than vanishing. One shared function, so this fixes the fetch in all five prompt builders at once — AI Tagging, LO Classifier, Q-A Verification, Solutions & Keys and the LO bank. Verified live against ILQ-107874 and ILQ-228703; guarded by tests/test_cms_text_figure.py, whose fixture is ILQ-107874's actu…68c4638
-
ppt: chapter/topic title slide design + separate plain-QID input box
Sahil Kumar8891439
-
ppt: numbered options 1-4, topic+year labels, parallel workers
Sahil Kumar49aab3c
-
AI Tagging + LO Classifier: multi-subject selection (chips UI)
Sahil KumarBackend routes accept a subjects list (single-subject fallback kept): - /tag/prep, /tag/apply merge tag_assist.scoped per subject - /lo/prep, /lo/apply use lo_assist.merged + per-row subject validation lo_assist: merged(), subject-keyed taxonomy text, build_prompt/parse_and_validate accept several subjects (AI replies now carry a per-row subject; a single subject still defaults rows without one). Banks stay per-subject, unchanged. Frontend: subject <select> replaced with multi-select chips on both pages; chapter chips merge across selected subjects; selection persisted in sessionStorage.a4ee7c3
-
resolve_toc: report row 1 of the exam TOC list, not the master chapter
Sahil Kumar +1: Claude Opus 5Resolve TOC named chapter/topic from subtopicMasterTocNavigation, so the Excel described a master-taxonomy chapter the question is not filed under. CMS itself shows a numbered "Visible to students in this exams" list on the question page — for ILQ-1836594: 1. CBSE Grade 7 > Mathematics > Exponents and Powers > Laws of exponents 2. CBSE Grade 8 > Mathematics > Power Play. > Laws of Exponents 3. Grade 8-AP State Board > Mathematics > Exponents and Powers(Inactive) > ... Those rows already ride along in the get_navigation_details_for_subtopic response the names needed anyway, so row 1 costs no extra call. Rows read exam > subject > chapter > topic, and a new TOC Chain column reproduces row 1 verbatim; Exam TOC, Chapter, Topic and Subject come from that same row. Row order is the API's own, which is the order CMS numbers them in. It is NOT re-sorted by the question's stored chapter_id: that ID routinely points at a later row, which is what made two earlier attempts report the wron…7fd7644
-
tagger: make Full Approve admin-only (9939921144), others locked to Under Review
Sahil Kumareafd264 -
history: keep job records and result files where a restart can't reach them
Sahil Kumar +1: Claude Opus 5Every job store was in memory behind a 1h STORE_TTL sweep, and the Space wipes its disk on each rebuild, so the Excel from a run you walked away from was gone — /download_results had a "Results expired" message for exactly this. /usage was no help: it reads usage_log.csv, which is host-only and wiped with the disk. Job history now reads the Supabase usage_events table, which log_usage() has been writing all along and nothing ever read back (il_job_history.py). Result files go to a private Supabase bucket (il_artifacts.py) at completion, hooked on the log_usage() call every tool already makes, so a new tool opts in by passing artifact=(name, bytes) — one place to remember, same as the usage row. The bucket is private because result files carry question content, unlike the diagrams in the public question-images bucket. /history/file checks the key's owner segment against the caller's CMS phone before minting a 5-minute signed URL, since a signed URL bypasses the login gate by design. …e99d2d3 -
deploy: split the tree into backend/frontend/database and centralise hosts
Sahil Kumar +1: Claude Opus 5Every CMS host name now comes from backend/il_endpoints.py instead of being hardcoded across eight modules, so switching stacks is config rather than an edit. The four defaults point at PRODUCTION: .env is gitignored and dockerignored, so the Space has no IL_* variables and inherits these defaults — it will read and write live CMS content. To put the Space back on preprod, set IL_QB_API, IL_GATEWAY_API, IL_COMMUNITY_API and IL_COMMUNITY_WEB as Space secrets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>2e740d5