Bnot fixes ; Missing énoncés fixes.
This commit is contained in:
1 parent
f39868207d
commit
55d5cf16c9
18 files changed
+486
-44
No files matched your search
+17
-4
@@ -893,11 +893,13 @@ class CopienatorApp(tk.Tk):
|
||||
value = False # Deletion is a one-run choice, never a saved default.
|
||||
if step.id == 'statement' and spec.name == 'restart':
|
||||
value = False
|
||||
if step.id == "final_score" and spec.name == "copy_merged_histogramme" and spec.name not in values:
|
||||
value = bool(self.state_store.step("personal_read").get("wsnm_run", False))
|
||||
if step.id == "modify_annotations" and spec.name == "annotation_dir" and spec.name not in values:
|
||||
reader = self.state_store.step("read_annotations")
|
||||
value = annotation_mode_for_reader(reader)
|
||||
choices = spec.choices
|
||||
if spec.name == "annotation_dir" and step.id in {"export", "import"}:
|
||||
if spec.name == "annotation_dir" and step.id in {"export", "import", "giving_names"}:
|
||||
choices, value = self._annotation_directory_choices(step.id)
|
||||
argument_label = ttk.Label(self.form, text=f"{spec.label} ⓘ")
|
||||
argument_label.grid(row=row, column=0, sticky="nw", pady=4, padx=(0, 8))
|
||||
@@ -1033,7 +1035,7 @@ class CopienatorApp(tk.Tk):
|
||||
controls = ttk.Frame(self.form)
|
||||
controls.grid(row=row, column=0, columnspan=2, sticky="w", pady=8)
|
||||
self.review_buttons = []
|
||||
for command in ("re", "wsn", "we"):
|
||||
for command in ("re", "wsn", "we", "mei", "wsnm"):
|
||||
button = ttk.Button(
|
||||
controls, text=f"gestion_classe {command}",
|
||||
command=lambda command=command: self._run_current_step(review_command=command),
|
||||
@@ -1301,8 +1303,10 @@ class CopienatorApp(tk.Tk):
|
||||
evaluation = self.evaluation
|
||||
detected = detected_annotation_directories(evaluation) if evaluation else ()
|
||||
choices = detected or ANNOTATION_DIRECTORIES
|
||||
if step_id == "giving_names":
|
||||
choices = ANNOTATION_DIRECTORIES
|
||||
|
||||
if step_id == "export":
|
||||
if step_id in {"export", "giving_names"}:
|
||||
annotation = self.state_store.step("annotation")
|
||||
variant = annotation.get("last_run_variant", annotation.get("variant", "grouped"))
|
||||
preferred = ANNOTATION_VARIANT_DIRECTORIES.get(str(variant), "BGnot")
|
||||
@@ -1608,7 +1612,7 @@ class CopienatorApp(tk.Tk):
|
||||
if orientation_repair and (not step or step.id != 'labels'):
|
||||
return
|
||||
if review_command is not None and (
|
||||
not step or step.id != "personal_read" or review_command not in {"re", "wsn", "we"}
|
||||
not step or step.id != "personal_read" or review_command not in {"re", "wsn", "we", "mei", "wsnm"}
|
||||
):
|
||||
return
|
||||
if not step or not evaluation or not self.state_store.evaluation:
|
||||
@@ -1671,6 +1675,10 @@ class CopienatorApp(tk.Tk):
|
||||
command = [sys.executable, '-m', 'copienator', 'repair-orientation', str(evaluation)]
|
||||
if step.id == "personal_read":
|
||||
command = ["gestion_classe", review_command]
|
||||
if review_command not in {"mei", "wsnm"}:
|
||||
evaluation_name = str(self._values().get("evaluation_name", evaluation.name)).strip()
|
||||
if evaluation_name:
|
||||
command.append(evaluation_name)
|
||||
if variant.dangerous and not messagebox.askyesno(
|
||||
"Nettoyage irréversible" if step.id == "clean" else "Confirmation requise",
|
||||
variant.danger_warning
|
||||
@@ -1718,6 +1726,11 @@ class CopienatorApp(tk.Tk):
|
||||
self._append_console(f"\n$ {command_display(command)}\n")
|
||||
try:
|
||||
self.runner.start(command, self.repository, environment, log_path)
|
||||
if step.id == "personal_read" and review_command == "wsnm" and not self.state_store.step(step.id).get("wsnm_run"):
|
||||
self.state_store.update_step(step.id, wsnm_run=True)
|
||||
values = dict(self.state_store.step("final_score").get("values", {}))
|
||||
values["copy_merged_histogramme"] = True
|
||||
self.state_store.update_step("final_score", values=values)
|
||||
if step.id == 'statement_persp':
|
||||
self.arg_vars['delete_persp'].set(False)
|
||||
self._save_current_form()
|
||||
|
||||
@@ -11,6 +11,7 @@ from copienator import configuration
|
||||
from copienator.configuration import ALWAYS_CROP
|
||||
|
||||
EVALUATION = "${evaluation}"
|
||||
EVALUATION_NAME = "${evaluation_name}"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -83,6 +84,14 @@ def arg_correction_workers(variants: tuple[str, ...] = ()) -> ArgumentSpec:
|
||||
)
|
||||
|
||||
|
||||
def arg_evaluation_name() -> ArgumentSpec:
|
||||
return ArgumentSpec(
|
||||
"evaluation_name", "Nom de l’évaluation", default=EVALUATION_NAME,
|
||||
positional=True,
|
||||
help="Nom transmis à gestion_classe, prérempli avec le nom du dossier de l’évaluation et modifiable.",
|
||||
)
|
||||
|
||||
|
||||
def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
def python(ident, label, script, **kwargs):
|
||||
supports_verbose = kwargs.pop("supports_verbose", True)
|
||||
@@ -794,8 +803,9 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
"personal_read",
|
||||
"Étapes personnelles",
|
||||
"Relire avec gestion_classe",
|
||||
"Utilisez les boutons gestion_classe re, wsn et we, puis cliquez sur « Marquer réussie ».",
|
||||
(CommandVariant("default", "gestion_classe re", "gestion_classe", "external", ("re",)),),
|
||||
"Utilisez les boutons gestion_classe re, wsn, we, mei et wsnm, puis cliquez sur « Marquer réussie ».",
|
||||
(CommandVariant("default", "gestion_classe re", "gestion_classe", "external", ("re",), fixed_args_before_positionals=True),),
|
||||
arguments=(arg_evaluation_name(),),
|
||||
personal=True,
|
||||
),
|
||||
StepDefinition(
|
||||
@@ -803,7 +813,8 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
"Étapes personnelles",
|
||||
"Écrire les notes finales",
|
||||
"Exécute gestion_classe wsent.",
|
||||
(CommandVariant("default", "gestion_classe wsent", "gestion_classe", "external", ("wsent",)),),
|
||||
(CommandVariant("default", "gestion_classe wsent", "gestion_classe", "external", ("wsent",), fixed_args_before_positionals=True),),
|
||||
arguments=(arg_evaluation_name(),),
|
||||
personal=True,
|
||||
),
|
||||
StepDefinition(
|
||||
@@ -814,7 +825,14 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
"Génère ensuite les dossiers de diffusion avec le score final, puis copie "
|
||||
"gestion_classe/Staging/histogramme.pdf dans le dossier Server/copies de l’évaluation.",
|
||||
(python("default", "Score final", "add-final-score", supports_verbose=False),),
|
||||
arguments=(arg_target("le dossier de l’évaluation"),),
|
||||
arguments=(
|
||||
arg_target("le dossier de l’évaluation"),
|
||||
ArgumentSpec(
|
||||
"copy_merged_histogramme", "copy merged histogramme", "bool",
|
||||
"--copy-merged-histogramme",
|
||||
help="Copie aussi Staging/merged_histogramme.pdf. Cochée par défaut après le premier lancement de gestion_classe wsnm pour cette évaluation.",
|
||||
),
|
||||
),
|
||||
personal=True,
|
||||
),
|
||||
StepDefinition(
|
||||
@@ -920,6 +938,8 @@ def build_refaire_workflow() -> list[StepDefinition]:
|
||||
|
||||
|
||||
def value_for_default(value: object, evaluation_arg: str) -> object:
|
||||
if value == EVALUATION_NAME:
|
||||
return Path(evaluation_arg).name
|
||||
return evaluation_arg if value == EVALUATION else value
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user