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/can5G03-e88GFU9l.js.map
{"version":3,"file":"can5G03-e88GFU9l.js","sources":["../../src/exercices/can/5e/can5G03.js"],"sourcesContent":["import { point, tracePoint } from '../../../lib/2d/points.js'\nimport { papierPointe } from '../../../lib/2d/reperes.js'\nimport { longueur } from '../../../lib/2d/segmentsVecteurs.js'\nimport { labelPoint } from '../../../lib/2d/textes.js'\nimport { rotation } from '../../../lib/2d/transformations.js'\nimport { choice, shuffle } from '../../../lib/outils/arrayOutils'\nimport Exercice from '../../Exercice.js'\nimport { 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 manquants'\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 centrale sur papier pointé\n * @author Jean-Claude Lhote\n */\nexport const uuid = '36f08'\nexport const ref = 'can5G03'\nexport default function CompterlesSymetriquesCan5e () {\n  Exercice.call(this) // Héritage de la classe Exercice()\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      objetsEnonce.push(papier)\n      const O = point(3, 3, 'O')\n      d = tracePoint(O, context.isHtml ? 'blue' : 'black')\n      d.epaisseur = 2\n      d.style = '+'\n      d.color = 'none'\n      objetsEnonce.push(d)\n      pointsPossibles = papier.listeCoords.slice()\n      while (pointsPossibles.length > 1) { // si il n'en reste qu'un, on ne peut pas trouver de symétrique\n        image = rotation(point(pointsPossibles[0][0], pointsPossibles[0][1]), O, 180)\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 centre 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 centre 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({\n        xmin: -0.5,\n        ymin: -0.5,\n        xmax: 6.5,\n        ymax: 6.5,\n        scale: 0.7\n      }, ...objetsEnonce, labelPoint(O))\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, labelPoint(O))\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","CompterlesSymetriquesCan5e","Exercice","randint","couples","pointsPossibles","pointsChoisis","pointsAffiches","pointsEnPlusCorr","typeDePapier","i","cpt","papier","image","d","j","trouve","texte","texteCorr","objetsEnonce","nbCouplesComplets","objetsCorrection","papierPointe","O","point","tracePoint","context","rotation","longueur","choice","nbCouplesChoisis","couplesChoisis","shuffle","p","mathalea2d","labelPoint","ajouteChampTexteMathLive","setReponse","listeQuestionsToContenu"],"mappings":"gLAcY,MAACA,EAAQ,2CACRC,EAAoB,aACpBC,EAAkB,GAClBC,EAAiB,WACjBC,EAAW,GACXC,EAAU,SAMVC,EAAO,QACPC,EAAM,UACJ,SAASC,GAA8B,CACpDC,EAAS,KAAK,IAAI,EAClB,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,MAAMC,EAAU,CAAE,EAClB,IAAIC,EACJ,MAAMC,EAAgB,CAAE,EAClBC,EAAiB,CAAE,EACnBC,EAAmB,CAAE,EACrBC,EAAe,CAAC,OAAQ,OAAQ,OAAQ,MAAM,EACpD,Q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