Ajoute une page unique de correction des exercices
- Nouvelle page corriger-exercice.html : sélection de l'exercice (BioCID, FDS, TP Nuisibles) + zone de dépôt PDF - Le PDF déposé est transmis à la page de correction dédiée qui se charge automatiquement (?auto=1) - Carte 'Corriger un exercice' ajoutée à la section Exercices de l'index - Slide 6 BioCID : suppression du bouton biocid-anses.fr, alignement des boutons Télécharger / Corriger / Recommencer - Le bouton 'Corriger un rendu' redirige vers la nouvelle page
This commit is contained in:
@@ -645,6 +645,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); }
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user