HEX
Server: Apache
System: Linux vps.mmtprep.com 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: mmtprep (1001)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/can6G07-EcNuptFS.js.map
{"version":3,"file":"can6G07-EcNuptFS.js","sources":["../../src/exercices/can/6e/can6G07.js"],"sourcesContent":["import { droite } from '../../../lib/2d/droites.js'\nimport { point, tracePoint } from '../../../lib/2d/points.js'\nimport { papierPointe } from '../../../lib/2d/reperes.js'\nimport { longueur } from '../../../lib/2d/segmentsVecteurs.js'\nimport { symetrieAxiale } from '../../../lib/2d/transformations.js'\nimport { choice, shuffle } from '../../../lib/outils/arrayOutils'\nimport Exercice from '../../Exercice.js'\nimport { colorToLatexOrHTML, mathalea2d } from '../../../modules/2dGeneralites.js'\nimport { listeQuestionsToContenu, randint } from '../../../modules/outils.js'\nimport { context } from '../../../modules/context.js'\nimport { ajouteChampTexteMathLive } from '../../../lib/interactif/questionMathLive.js'\n\nimport { setReponse } from '../../../lib/interactif/gestionInteractif.js'\n\nexport const titre = 'Compter les points symétriques manquant'\nexport const dateDePublication = '18/12/2021'\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCNum'\n\n/**\n * Symétrie axiale sur papier pointé\n * Ref can6G07\n * @author Jean-Claude Lhote\n * Publié le 18/12/2021\n */\nexport const uuid = '85dfb'\nexport const ref = 'can6G07'\nexport default function CompleterParSymetrieCan () {\n  Exercice.call(this) // Héritage de la classe Exercice()\n  this.consigne = ''\n  this.nbQuestions = 1\n  this.nbCols = 1\n  this.nbColsCorr = 1\n  this.sup = 1\n  this.sup2 = 1\n  this.nouvelleVersion = function () {\n    this.sup = randint(1, 2)\n    this.listeQuestions = [] // Liste de questions\n    this.listeCorrections = [] // Liste de questions corrigées\n    this.autoCorrection = []\n    const couples = []\n    let pointsPossibles\n    const pointsChoisis = []\n    const pointsAffiches = []\n    const pointsEnPlusCorr = []\n    const typeDePapier = ['quad', 'quad', 'hexa', 'equi'] // l'élément 0 sera changé aléatoirement pour correspondre au type mélange (this.sup2 % 4)\n    for (let i = 0, cpt = 0, papier, image, d, j, trouve, texte, texteCorr, objetsEnonce, nbCouplesComplets, objetsCorrection; i < this.nbQuestions && cpt < 50;) {\n      typeDePapier[0] = typeDePapier[1 + i % 3]\n      // on remet à vide tous les tableaux utilisés pour la question suivante\n      objetsEnonce = []\n      objetsCorrection = []\n      pointsChoisis.length = 0\n      pointsAffiches.length = 0\n      pointsEnPlusCorr.length = 0\n      couples.length = 0\n\n      papier = papierPointe({ xmin: 0, ymin: 0, xmax: 6, ymax: 6, type: 'quad' })\n\n      objetsEnonce.push(papier)\n\n      switch (randint(1, 2)) {\n        case 1:\n          d = droite(point(3, 0), point(3, 6))\n          break\n        case 2:\n          d = droite(point(0, 3), point(6, 3))\n          break\n      }\n      d.epaisseur = 2\n      d.color = context.isHtml ? colorToLatexOrHTML('blue') : colorToLatexOrHTML('black')\n      objetsEnonce.push(d)\n      pointsPossibles = papier.listeCoords.slice()\n      // on prépare les points cliquables pour la version interactive\n      while (pointsPossibles.length > 1) { // si il n'en reste qu'un, on ne peut pas trouver de symétrique\n        image = symetrieAxiale(point(pointsPossibles[0][0], pointsPossibles[0][1]), d)\n        j = 1\n        trouve = false\n        while (j < pointsPossibles.length && !trouve) {\n          // si l'image est proche d'un point, c'est qu'on a deux symétriques donc un couple potentiel.\n          if (longueur(image, point(pointsPossibles[j][0], pointsPossibles[j][1])) < 0.5) {\n            trouve = true\n          } else j++\n        }\n        if (trouve) {\n          // on stocke le couple de symétrique en modifiant aléatoirement l'ordre.\n          couples.push(choice([true, false]) ? [pointsPossibles[0], pointsPossibles[j]] : [pointsPossibles[j], pointsPossibles[0]])\n          pointsPossibles.splice(j, 1) // on retire d'abord le points d'indice j\n          pointsPossibles.splice(0, 1) // puis le point d'indice 0\n        } else {\n          pointsPossibles.splice(0, 1) // Le point d'indice 0 n'a pas de symétrique, on le retire\n        }\n      }\n      // la liste des couples est prête, on va pouvoir choisir les points affichés et ceux qu'on n'affiche pas.\n      const nbCouplesChoisis = randint(4, 7)\n      const couplesChoisis = shuffle(couples).splice(0, nbCouplesChoisis)\n      for (let p = 0; p < couplesChoisis.length; p++) {\n        pointsChoisis.push(couplesChoisis[p][0], couplesChoisis[p][1])\n      }\n      nbCouplesComplets = randint(1, 3)\n      for (let p = 0; p < pointsChoisis.length; p += 2) {\n        if (p < nbCouplesComplets) { // On affiche un certains nombre de couples\n          pointsAffiches.push(point(pointsChoisis[p][0], pointsChoisis[p][1]))\n          pointsAffiches.push(point(pointsChoisis[p + 1][0], pointsChoisis[p + 1][1]))\n        } else { // et on affiche un seul des points pour les couples restants\n          pointsAffiches.push(point(pointsChoisis[p][0], pointsChoisis[p][1]))\n          pointsEnPlusCorr.push(point(pointsChoisis[p + 1][0], pointsChoisis[p + 1][1]))\n        }\n      }\n      for (let p = 0; p < pointsAffiches.length; p++) {\n        objetsEnonce.push(tracePoint(pointsAffiches[p]))\n      }\n      for (let p = 0; p < pointsEnPlusCorr.length; p++) {\n        objetsCorrection.push(tracePoint(pointsEnPlusCorr[p], 'red'))\n      }\n      texte = context.isAmc\n        ? 'Voici une grille contenant des points et un axe de symétrie.<br>Quel nombre minimum de points faut-il ajouter pour que chacun ait son symétrique ?<br>Écrire le nombre de points ajoutés dans le cadre. Coder ensuite ce nombre de points.<br>'\n        : 'Voici une grille contenant des points et un axe de symétrie.<br>Quel nombre minimum de points faut-il ajouter pour que chacun ait son symétrique ?<br>'\n      texteCorr = ''\n      // On prépare la figure...\n      texte += mathalea2d({ xmin: -0.5, ymin: -0.5, xmax: 6.5, ymax: 6.5, scale: 0.7 }, ...objetsEnonce)\n      if (this.interactif && context.isHtml) {\n        texte += ajouteChampTexteMathLive(this, i, 'largeur10 inline')\n      }\n      texteCorr += mathalea2d({\n        xmin: -0.5,\n        ymin: -0.5,\n        xmax: 6.5,\n        ymax: 6.5,\n        scale: 0.5\n      }, ...objetsEnonce, ...objetsCorrection)\n      setReponse(this, i, pointsEnPlusCorr.length)\n      if (this.questionJamaisPosee(i, nbCouplesChoisis, nbCouplesComplets, pointsChoisis[0][0], pointsChoisis[0][1])) {\n        this.listeQuestions.push(texte)\n        this.listeCorrections.push(texteCorr)\n        i++\n      }\n      cpt++\n    }\n    listeQuestionsToContenu(this)\n  }\n  // this.besoinFormulaireNumerique = ['Type d\\'axes', 4, '1 : Axe vertical\\n2 : Axe horizontal\\n3 : Axe oblique\\n4 : Mélange']\n  // this.besoinFormulaire2Numerique = ['Type de papier pointé', 4, '1 : Carrés\\n2 : Hexagones\\n3 : Triangles équilatéraux\\n4 : Mélange']\n}\n"],"names":["titre","dateDePublication","interactifReady","interactifType","amcReady","amcType","uuid","ref","CompleterParSymetrieCan","Exercice","randint","couples","pointsPossibles","pointsChoisis","pointsAffiches","pointsEnPlusCorr","typeDePapier","i","cpt","papier","image","d","j","trouve","texte","texteCorr","objetsEnonce","nbCouplesComplets","objetsCorrection","papierPointe","droite","point","context","colorToLatexOrHTML","symetrieAxiale","longueur","choice","nbCouplesChoisis","couplesChoisis","shuffle","p","tracePoint","mathalea2d","ajouteChampTexteMathLive","setReponse","listeQuestionsToContenu"],"mappings":"mLAcY,MAACA,EAAQ,0CACRC,EAAoB,aACpBC,EAAkB,GAClBC,EAAiB,WACjBC,EAAW,GACXC,EAAU,SAQVC,EAAO,QACPC,EAAM,UACJ,SAASC,GAA2B,CACjDC,EAAS,KAAK,IAAI,EAClB,KAAK,SAAW,GAChB,KAAK,YAAc,EACnB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,IAAM,EACX,KAAK,KAAO,EACZ,KAAK,gBAAkB,UAAY,CACjC,KAAK,IAAMC,EAAQ,EAAG,CAAC,EACvB,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EACxB,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