diff --git a/exercices/Exo_BioCID.html b/exercices/Exo_BioCID.html index edb93f1..4093958 100644 --- a/exercices/Exo_BioCID.html +++ b/exercices/Exo_BioCID.html @@ -603,10 +603,7 @@
- diff --git a/exercices/correction-biocid.html b/exercices/correction-biocid.html index a7784af..9b3f242 100644 --- a/exercices/correction-biocid.html +++ b/exercices/correction-biocid.html @@ -502,6 +502,24 @@ dropzone.addEventListener("drop", e => { if (file) handleFile(file); }); document.getElementById("filePicker").addEventListener("change", e => handleFile(e.target.files?.[0])); + +// Chargement automatique depuis la page « Corriger un exercice » (?auto=1) +(function autoLoadFromHub() { + const params = new URLSearchParams(location.search); + if (params.get("auto") !== "1") return; + const dataUrl = localStorage.getItem("correctionFile"); + const name = localStorage.getItem("correctionFileName") || "rendu.pdf"; + localStorage.removeItem("correctionFile"); + localStorage.removeItem("correctionFileName"); + localStorage.removeItem("correctionExo"); + if (!dataUrl) return; + try { + const bin = atob(dataUrl.split(",").pop()); + const bytes = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i); + handleFile(new File([bytes], name, { type: "application/pdf" })); + } catch (e) { console.error(e); } +})();