Bnot : split large copies into pieces.

This commit is contained in:
sebastien committed 2026-10-23 08:32:17 +02:00
1 parent 834ffe32f2
commit 1959c5d3bb
10 files changed
+333 -52

No files matched your search

@@ -25,6 +25,7 @@ from copienator import (
)
from copienator.annotation_actions import apply_checkbox_actions, apply_score_overrides
from copienator.annotation_data import AnnotationData, RefaireList, load_annotation_data
from copienator.annotation_documents import copy_documents, tablet_documents
from copienator.annotation_layout import legacy_layout
from copienator.annotation_modifications import (
BASELINE,
@@ -463,11 +464,10 @@ def _scan_redo_annotations(
incomplete: set[str] = set()
plans = []
required = ("checkboxes.json", "Reference.jpg", "Concat_annotated.pdf")
for path in sorted(directory.iterdir()):
if not path.is_dir():
continue
for _name, path in tablet_documents(directory):
copy_name = path.name if path.name.startswith("Copie") else path.parent.name
default_id = (
path.name.removeprefix("Copie") if path.name.startswith("Copie") else None
copy_name.removeprefix("Copie") if copy_name.startswith("Copie") else None
)
try:
metadata = read_json(path / "bnote.json")
@@ -590,12 +590,12 @@ def run(
if annotation_dir == "Bnot":
for student_id in refaire_by_student:
directory = workspace.root / annotation_dir / f"Copie{student_id}"
if directory.is_dir():
for document in copy_documents(directory) if directory.is_dir() else []:
_merge_scan_result(
actions_by_student,
notes_by_student,
_scan_annotation_directory(
directory, default_student_id=student_id
document, default_student_id=student_id
),
)