chore: update Q1 scripts with minor fixes

This commit is contained in:
null 2026-06-19 00:38:43 -05:00
parent a13167dc3e
commit 8cfcb6d51f
2 changed files with 6 additions and 4 deletions

View File

@ -13,8 +13,6 @@ Room schema and identity hash are untouched. build_db.py is NOT run.
from __future__ import annotations from __future__ import annotations
import json import json
import os
import re
import sqlite3 import sqlite3
from collections import defaultdict from collections import defaultdict
from pathlib import Path from pathlib import Path
@ -279,7 +277,12 @@ def rewrite_template_overflow(files: dict[Path, dict[str, Any]]) -> dict[str, st
by_stem[stem].append(q) by_stem[stem].append(q)
break break
taken = {normalize_text(q["text"]) for data in files.values() for q in data.get("questions", []) if q.get("text")} taken = {
normalize_text(q["text"])
for data in files.values()
for q in data.get("questions", [])
if q.get("text")
}
for stem, rows in by_stem.items(): for stem, rows in by_stem.items():
rows = sorted(rows, key=lambda item: item["id"]) rows = sorted(rows, key=lambda item: item["id"])

View File

@ -13,7 +13,6 @@ from __future__ import annotations
import argparse import argparse
import json import json
import os
import re import re
import sqlite3 import sqlite3
import sys import sys