Add per label remark, post correction

This commit is contained in:
sebastien committed 2026-10-26 12:44:29 +01:00
1 parent 3abd7873e6
commit 8918d64452
13 files changed
+343 -23

No files matched your search

+19 -4
View File
@@ -1086,7 +1086,7 @@ class CopienatorApp(tk.Tk):
return row
if step.id == "edit_scores" and self.evaluation:
self.score_editor_panel = ScoreEditorPanel(
self.form, self.evaluation, self._score_changed
self.form, self.evaluation, self._score_changed, self._remark_changed
)
self.score_editor_panel.grid(row=row, column=0, columnspan=2, sticky="ew", pady=8)
row += 1
@@ -1644,7 +1644,16 @@ class CopienatorApp(tk.Tk):
if (step.is_manual or step.id == "personal_create"
or (step.id == "personal_read" and review_command is None)):
self._mark_step("success")
self._move_selection_from(step.id, 1)
if step.id == "edit_scores":
entry = self.state_store.step("read_annotations")
values = dict(entry.get("values", {}))
values["update_score"] = True
self.state_store.update_step("read_annotations", status="stale", values=values)
self._populate_tree()
self.tree.selection_set("read_annotations")
self.tree.see("read_annotations")
else:
self._move_selection_from(step.id, 1)
return
if os.name == "nt" and step.id != "statement":
labels_path = evaluation / "labels"
@@ -1799,13 +1808,19 @@ class CopienatorApp(tk.Tk):
self._populate_tree()
self.info_var.set("Renommage validé — aucun fichier modifié.")
def _score_changed(self, copy_id: str, label: str, previous: str, current: str) -> None:
def _remark_changed(self, copy_id: str, label: str, previous: str, current: str) -> None:
self._score_changed(copy_id, label, previous, current, remark=True)
def _score_changed(self, copy_id: str, label: str, previous: str, current: str,
*, remark: bool = False) -> None:
step = self.step_by_id["edit_scores"]
self._invalidate_after_step(step, "default")
self.state_store.update_step(step.id, status="detected")
self.state_store.update_step("read_annotations", status="stale")
self.state_store.add_history({
"step": step.id, "copy_id": copy_id, "label": label,
"previous_score": previous, "score": current, "manual": True,
("previous_remark" if remark else "previous_score"): previous,
("remark" if remark else "score"): current, "manual": True,
})
# Refresh statuses without rebuilding the form between score edits.
for item in self.steps: