// on ajoute à la classe Parcours la méthode Sectiontestrexams_dist Parcours.prototype.Sectiontestrexams_dist = function() { // toute section doit avoir une fonction nommée ainsi function _Donnees() { this.nomsection = "testrexams_dist"; this.touche_entree = false; this.nbchances = 1; // un seul essai accordé à l’élève this.numeroessai = 1; this.structure = "presentation1"; this.pe = 0; // score initial mis à 0 ... } // pour récupérer les fichiers html créés avec RMarkdown this.chemin = "sections/EssaisPatrick/rexams/dist/"; this.nom_fichier = "ex"; this.nb_fichiers = 50; // ex1.html ... ex50.html this.extype = "num"; // QCM de type numérique this.extol = 0.01; // tolérance pour une réponse approchée // pour gérer 3 états possibles pendant l’exécution du graphe switch (this.etat) { case "enonce": if (this.debutdelasection) { this.DonneesSection = new _Donnees(); j3pRexams.enonce_debutdelasection_vrai(this); } else { j3pRexams.enonce_debutdelasection_faux(this); } break; case "correction": j3pRexams.correction(this); break; case "navigation": j3pRexams.navigation(this); break; } }