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
-
AI Tagging: JEE Main and NEET from the active CMS exam TOC (node IDs)
Sahil Kumar +1: Claude Opus 5.5build_active_exam_toc.py reads the CMS active exam-TOC exports for JEE Main (exam 2) and NEET (exam 1), keeps the exam's own Active rows in its tagging subjects (JEE Main: Physics/Chemistry/Mathematics; NEET: Physics/Chemistry/ Botany/Zoology), drops video / IPE / bridge-course chapters and the export's other exam (Pre-NEET&JEE), checks every subtopic against live CMS navigation and writes active_exam_toc.json with the node IDs per path (6,882 paths, all confirmed by CMS). tag_assist loads it next to kcet_toc.json, so JEE Main / NEET prompts list the CMS's own active TOC and push_tags tags those rows from stored IDs instead of the Master-TOC name walk. exam_toc.json stays as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>ea605ce -
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 -
ppt: even option spacing, readable picture questions, one typeface
Sahil Kumar +1: Claude Opus 5.5- Strip line breaks / at the start and end of each paragraph: CMS options ending "20 J <br> " drew a blank line under that option only, so option gaps looked random. - Cap image heights (question body 380px, options 210px, aspect kept) and lay picture options out two per row: four stacked option structures made the card ~3x taller than wide, shrinking the whole question to ~32% on the slide. Across 237 questions in six decks, none is now shown below 60% (was 12). - Drop pasted font-family (e.g. Word's "Aptos") so a question no longer mixes two typefaces, and mask entities in inline styles so " inside a value no longer splits a declaration in half. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1086400
-
qtags: edge-case fixes from live testing
Sahil Kumar +1: Claude Opus 5.5- A missing QID (CMS answers 500 "You don't have the question with this id") is reported as not found, not failed. - Existing labels are written back exactly as stored; new tags are only appended, and a save that drops an existing tag is reported as failed. - Status is compared through the CMS aliases (unapproved == draft) so an alias is not mistaken for a status change. - An unknown tag name reloads the cached CMS tag list once (at most once a minute), so a tag created in the CMS after caching is accepted. - Edge-case tests for all of the above, bad payloads, cancel and CSV safety. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>110f97e -
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 -
ppt: render CMS content at slide size (math, images, tables, blank lines)
Sahil Kumar +1: Claude Opus 5.5CMS content is authored at editor size and some of it hard-codes that size, which came out tiny or broken on the 30px slide card (15 slides of the Equilibrium deck). Before rendering, normalize_cms_html now: - drops MathType/ChemType mathsize="12-16px" and inline font-size - scales pasted images 2x from their editor size (capped to the slide) and clears white backgrounds so the invert filter no longer draws black boxes - removes fixed table widths and blank paragraphs / table rows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>51aa28e
-
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: 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: stop showing the CMS question type in the prompt
Sahil Kumar +1: Claude Opus 5The prompt sent four CMS fields per question. Three earn their place — the stem, the options, and the stored answer key. The CMS question_type does not: it reads "single correct mcq" for nearly every question, a match-the-following included (ILQ-107874), which is why the format rule already had to tell the model not to trust it. Withholding it is simpler than warning about it, so the rule now says the type is not given, and why. The options and the answer key stay. A third of a typical batch reads "which of the following ...", which cannot be placed without the options; and on a "which is NOT" item the key is what identifies the second LO, since the odd one out is the concept the question turns on — ILQ-456828 and ILQ-1354945 in the Reproductive Health batch both map to a second LO the key points straight at. Only what the POC's prompt SHOWS changes. ai_assist.fetch_contents still retrieves every field: it is shared by all five prompt builders and /verify compares the AI's answer aga…1cafe53 -
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
-
speed: parallel QID fetch + parallel tagging/solution push + lookups cache
Sahil KumarPrompt building (AI Tagging / LO / Verify / Solutions prep) now fetches QIDs in parallel via push_tags.fetch_many (8 workers) instead of one HTTP round-trip at a time; results stay in input order and progress is reported from the collector thread. verify_assist.fetch_solutions uses the same pool. Tagging (/tagger/start -> api_tagger.run_automation) and solution writing (/solutions/push -> solution_assist.push_rows) now respect worker counts: run_automation finally uses the 1-5 UI stepper it was already handed, with all counters/callbacks on the collector thread so Excel status writes stay serialized; push_rows runs 5 workers. TOC caches in push_tags are self-locked (double-checked in children/_nav_entries) so concurrent resolve_ids is safe. CLI push_tags.main() runs in parallel too (--workers N, default 5) with the PUSH_LOG writes and prints guarded. make_template.lookups_options caches per QB token so /tag/prep + /tag/apply stop double-fetching /lookups.e1428c4 -
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: pool connections and cache nav so a batch resolves ~5x faster
Sahil Kumar +1: Claude Opus 5A resolve is two API calls per question and nothing else, so it is pure I/O wait — but the thread count was only a third of the problem. On a modelled 100-ID batch (120ms per call, 5 subtopics): 6.8s before, 1.2s after. - Threads 6 -> 12, via RESOLVE_TOC_WORKERS (clamped 1-32, capped at the batch size). An env var because the ceiling is the CMS's tolerance, not ours. - One pooled requests.Session. Every call was opening a fresh TCP+TLS connection — two handshakes per question. The pool is sized to the worker count so threads never queue for a connection, and 429/5xx get two short retries: with more threads in flight a transient blip would otherwise land in the SME's Excel as an ERROR row. - A per-job cache of nav responses keyed by subtopic — the biggest real win. SMEs paste a chapter's worth of IDs, so a few subtopics repeat across every row; the community call now happens once per subtopic instead of once per question (100 calls -> 12 in the benchmark). Per job, neve…5eb3969 -
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 -
cms: carry a question pattern on every path that writes or approves
Sahil Kumar +1: Claude Opus 5CMS now wants a question pattern wherever a question is approved. The real vocabulary isn't published — it is not in /lookups under any code, and a sample of 69 live questions across the bank turned up none carrying a real value — so every writer stamps the placeholder the uploader has always sent, and the real values get wired in later. The uploader already sent it; the gap was everywhere else. The tagger and solutions tools do fetch -> modify -> PUT, which faithfully preserves the empty list most of the bank is in, so a tagged question stayed unapprovable. Approval is worse: the status API carries only {"status": ...}, so a question sitting on an empty pattern is rejected on a field that call never sends — approve_one now fills it with a full PUT before running the transitions. ensure_question_pattern() only fills a missing or blank value, never replaces a real one: the placeholder exists to be replaced, and a tagging run must not undo a pattern an SME set in CMS. In push_partial i…572a729 -
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
-
tests: cover the Word maths and image pipeline
Sahil Kumar +1: Claude Opus 5First tests in the repo. pytest collected 0 items before this. Fixtures build .docx files on the fly from OMML written the way Word writes it, rather than committing binaries, so each test shows the markup it exercises. Covers OMML -> MathML for the constructs papers contain, the no-stylesheet fallback and its warning, the unconverted-marker guard, image extraction and the undrawable-metafile case, every option layout keeping its solution, and that the reviewed HTML and the uploaded payload are the same string. Two tests document limitations rather than assert correctness: Word's boxed and cancelled formulas convert to <menclose>, which no browser draws, and data-URI images carry no dimensions so the CMS gets an unsized image where the preview only looks right because of its own CSS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>0451415