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/6G42-1-2pq1bPN6.js.map
{"version":3,"file":"6G42-1-2pq1bPN6.js","sources":["../../src/exercices/6e/6G42-1.js"],"sourcesContent":["import { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { texteEnCouleurEtGras } from '../../lib/outils/embellissements'\nimport { choisitLettresDifferentes } from '../../lib/outils/aleatoires.js'\nimport { rangeMinMax } from '../../lib/outils/nombres.js'\nimport { numAlpha } from '../../lib/outils/outilString.js'\nimport Exercice from '../Exercice.js'\nimport { context } from '../../modules/context.js'\nimport { contraindreValeur, gestionnaireFormulaireTexte, listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { pave3d, point3d } from '../../modules/3d.js'\nimport { fixeBordures, mathalea2d } from '../../modules/2dGeneralites.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { propositionsQcm } from '../../lib/interactif/qcm.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n\nexport const titre = 'Naming faces in a straight pad'\nexport const amcReady = true\nexport const amcType = 'AMCHybride'\nexport const interactifReady = true\nexport const interactifType = ['qcm', 'mathLive']\n\nexport const dateDePublication = '06/11/2022'\n\n/**\n * Nommer des faces dans un pavé droit\n * @author Eric Elter\n */\n\nexport const uuid = '6809f'\nexport const ref = '6G42-1'\nexport default function LireFacePaveDroit () {\n  Exercice.call(this) // Héritage de la classe Exercice()\n  this.titre = titre\n  this.nbQuestions = 4\n  this.nbCols = 1\n  this.nbColsCorr = 1\n  this.sup = 3\n  this.sup2 = 7\n  this.sup3 = 1\n  this.sup4 = 6\n\n  /**\n     * Inverse une chaîne de caractères\n     * @param {string} str Chaîne à inverser\n     * @author Eric Elter (enfin copié sur le net)\n     * @example inverseChaine('laval') renvoie 'laval' /// Hihihihi...\n     * @example inverseChaine('Perfect') renvoie 'tiafrap'\n     * @example inverseChaine('1234') renvoie '4321'\n     */\n  function inverseChaine (str) {\n    return (str === '') ? '' : inverseChaine(str.substr(1)) + str.charAt(0)\n  }\n\n  function differentsNomsPossiblesDUneFace (face, nomSolide) {\n    let nouvelleFaceChiffree = ''\n    let nouvelleFace = ''\n    const tabChiffre = [face, inverseChaine(face)]\n    const tab = []\n    for (let i = 0; i < face.length - 1; i++) {\n      nouvelleFaceChiffree = tabChiffre[2 * i][3] + tabChiffre[2 * i].slice(0, 3)\n      tabChiffre.push(nouvelleFaceChiffree, inverseChaine(nouvelleFaceChiffree))\n    }\n    for (let i = 0; i < tabChiffre.length; i++) {\n      nouvelleFace = ''\n      for (let j = 0; j < face.length; j++) {\n        nouvelleFace += nomSolide[tabChiffre[i][j]]\n      }\n      tab.push(nouvelleFace)\n    }\n    return tab\n  }\n\n  this.nouvelleVersion = function () {\n    this.sup4 = contraindreValeur(2, 6, this.sup4, 6)\n    this.interactifType = this.sup3 === 2 ? 'mathLive' : 'mth'\n    this.autoCorrection = []\n    /*\n        let typesDeQuestionsIndisponibles = []\n        if (!this.sup2) { // Si aucune liste n'est saisie\n          typesDeQuestionsIndisponibles = 7\n        } else {\n          if (typeof (this.sup2) === 'number') { // Si c'is a number it means the number was entered in the address bar\n            typesDeQuestionsIndisponibles[0] = contraindreValeur(1, 6, this.sup2, 1)\n          } else {\n            typesDeQuestionsIndisponibles = this.sup2.split('-')// Sinon on créé un tableau à partir des valeurs séparées par des -\n            for (let i = 0; i < typesDeQuestionsIndisponibles.length; i++) { // on a un tableau avec des strings : ['1', '1', '2']\n              typesDeQuestionsIndisponibles[i] = contraindreValeur(1, 6, parseInt(typesDeQuestionsIndisponibles[i]), 1) // parseInt en fait un tableau d'entiers\n            }\n          }\n        }\n        if (compteOccurences(typesDeQuestionsIndisponibles, 7) > 0) typesDeQuestionsIndisponibles = [] // Teste si l'utilisateur a choisi rien\n        enleveDoublonNum(typesDeQuestionsIndisponibles)\n        */\n\n    const typesDeQuestionsIndisponibles = gestionnaireFormulaireTexte({\n      max: 6,\n      defaut: randint(1, 6),\n      nbQuestions: this.nbQuestions,\n      shuffle: false,\n      saisie: this.sup2,\n      enleveDoublons: true\n    })\n\n    function comparerNombres (a, b) {\n      return a - b\n    }\n\n    typesDeQuestionsIndisponibles.sort(comparerNombres)\n    let choixFace = rangeMinMax(0, 5)\n    for (let i = typesDeQuestionsIndisponibles.length - 1; i >= 0; i--) {\n      choixFace.splice(typesDeQuestionsIndisponibles[i], 1)\n    }\n    choixFace = combinaisonListes(choixFace, choixFace.length)\n    this.listeQuestions = [] // Liste de questions\n    this.listeCorrections = [] // Liste de questions corrigées\n    this.autoCorrection = []\n    let indiceQuestion\n\n    for (let i = 0, texte, texteCorr, objetsEnonce, A, B, D, E, solideDessine, nomSolide, enonceAMC, enonceFigure,\n      L, p, choixProfondeur, facesPossibles, h, resultatsPossibles, resultatsImpossibles, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n      texte = ''\n      texteCorr = ''\n      objetsEnonce = []\n      context.anglePerspective = choice([-30, -60, 30, 60])\n\n      L = randint(5, 20)\n      h = randint(5, 20, [L])\n      p = randint(5, 20, [L, h])\n      A = point3d(0, 0, 0)\n      B = point3d(L, 0, 0)\n      D = point3d(0, 0, h)\n      choixProfondeur = choice([p, -p])\n      E = point3d(0, choixProfondeur, 0)\n\n      nomSolide = choisitLettresDifferentes(8, 'OQWXD').join('')\n      solideDessine = pave3d(A, B, D, E, 'blue', true, nomSolide)\n      objetsEnonce.push(...solideDessine.c2d)\n      // enonceFigure = (context.isAmc ? '' : '<br>') + mathalea2d(Object.assign({}, fixedBorders(enonce objects), { scale: context.isHtml ? 0.7 : 0.2, style: 'block' } ), objectsStatement) + '<br>'\n      enonceFigure = mathalea2d(Object.assign({}, fixeBordures(objetsEnonce), {\n        scale: context.isHtml ? 0.7 : 0.3,\n        style: 'block'\n      }), objetsEnonce) + '<br>'\n      texte += enonceFigure\n      facesPossibles = [['front', '0123'], ['behind', '4567'], ['from the left', '0374'], ['of right', '1265'], ['from above', '2376'], ['from below', '0154']]\n\n      if (context.isAmc) {\n        this.autoCorrection[i] = {\n          enonce: enonceFigure,\n          enonceCentre: false,\n          options: {\n            ordered: false\n          }\n        }\n        this.autoCorrection[i].propositions = []\n      }\n\n      for (let ee = 0; ee < Math.min(choixFace.length, this.sup); ee++) {\n        indiceQuestion = i * Math.min(choixFace.length, this.sup) + ee\n\n        enonceAMC = this.sup === 1 ? '' : (((ee === 0 || context.isAmc) ? '' : '<br>') + numAlpha(ee))\n\n        enonceAMC += `What can the ${facesPossibles[choixFace[ee]][0]} face of the right ${nomSolide} pad be called?`\n        texte += enonceAMC\n        resultatsPossibles = combinaisonListes(differentsNomsPossiblesDUneFace(facesPossibles[choixFace[ee]][1], nomSolide))\n        texteCorr += this.sup === 1 ? '' : numAlpha(ee)\n        texteCorr += `The ${facesPossibles[choixFace[ee]][0]} face of the right ${nomSolide} pad can be called ${texteEnCouleurEtGras(resultatsPossibles[0])} but also`\n        for (let j = 1; j < resultatsPossibles.length - 2; j++) texteCorr += `${resultatsPossibles[j]},`\n        texteCorr += `${resultatsPossibles[resultatsPossibles.length - 2]} or ${resultatsPossibles[resultatsPossibles.length - 1]}.<br>`\n\n        if ((this.interactifType && this.interactifType === 'mth') || context.isAmc) {\n          resultatsImpossibles = []\n          for (let j = 0; j < 6; j++) {\n            if (j !== choixFace[ee]) {\n              resultatsImpossibles.push(combinaisonListes(differentsNomsPossiblesDUneFace(facesPossibles[j][1], nomSolide))[0])\n            }\n          }\n        }\n        if (this.interactif) {\n          this.autoCorrection[indiceQuestion] = {}\n          if (this.interactifType === 'mth') {\n            this.autoCorrection[indiceQuestion].enonce = `${texte}\\n`\n            this.autoCorrection[indiceQuestion].propositions = [{\n              texte: `${resultatsPossibles[0]}`,\n              statut: true\n            }]\n            for (let j = 0; j < Math.min(resultatsImpossibles.length, this.sup4 - 1); j++) {\n              this.autoCorrection[indiceQuestion].propositions.push({\n                texte: `${resultatsImpossibles[j]}`,\n                statut: false\n              })\n            }\n\n            this.autoCorrection[indiceQuestion].options = {}\n            texte += propositionsQcm(this, indiceQuestion).texte\n          } else {\n            setReponse(this, indiceQuestion, resultatsPossibles, { formatInteractif: 'text' })\n            texte += ajouteChampTexteMathLive(this, indiceQuestion, 'width25 inline') + '<br>'\n          }\n        }\n        if (context.isAmc) {\n          this.autoCorrection[i].propositions.push(\n            {\n              type: 'mthMono',\n              enonce: enonceAMC,\n              propositions: [\n                {\n                  texte: `${resultatsPossibles[0]}`,\n                  statut: true\n                }\n              ]\n            }\n          )\n          for (let j = 0; j < Math.min(resultatsImpossibles.length, this.sup4 - 1); j++) {\n            this.autoCorrection[i].propositions[ee].propositions.push({\n              texte: `${resultatsImpossibles[j]}`,\n              statut: false\n            })\n          }\n        }\n      }\n\n      if (this.questionJamaisPosee(i, nomSolide)) {\n        // If the question has never been asked, we create another one\n        this.listeQuestions.push(texte)\n        this.listeCorrections.push(texteCorr)\n        i++\n      }\n      cpt++\n    }\n    listeQuestionsToContenu(this)\n  }\n  this.besoinFormulaireNumerique = ['Number of faces to find (between 1 and 6)', 6]\n  this.besoinFormulaire2Texte = ['Faces to exclude from choice', 'Numbers separated by hyphens\\n1: front\\n2: back\\n3: left\\n4: right\\n5: above\\n6: below\\n7: none to exclude']\n  this.besoinFormulaire3Numerique = ['Type of interactive exercise or AMC', 2, '1: MCQ\\n2: Numerical']\n  this.besoinFormulaire4Numerique = ['Number of answers in the MCQ (between 2 and 6)', 6]\n}\n"],"names":["titre","amcReady","amcType","interactifReady","interactifType","dateDePublication","uuid","ref","LireFacePaveDroit","Exercice","inverseChaine","str","differentsNomsPossiblesDUneFace","face","nomSolide","nouvelleFaceChiffree","nouvelleFace","tabChiffre","tab","i","j","contraindreValeur","typesDeQuestionsIndisponibles","gestionnaireFormulaireTexte","randint","comparerNombres","a","b","choixFace","rangeMinMax","combinaisonListes","indiceQuestion","texte","texteCorr","objetsEnonce","A","B","D","E","solideDessine","enonceAMC","enonceFigure","L","p","choixProfondeur","facesPossibles","h","resultatsPossibles","resultatsImpossibles","cpt","context","choice","point3d","choisitLettresDifferentes","pave3d","mathalea2d","fixeBordures","ee","numAlpha","texteEnCouleurEtGras","propositionsQcm","setReponse","ajouteChampTexteMathLive","listeQuestionsToContenu"],"mappings":"qRAcY,MAACA,EAAQ,iCACRC,EAAW,GACXC,EAAU,aACVC,GAAkB,GAClBC,GAAiB,CAAC,MAAO,UAAU,EAEnCC,GAAoB,aAOpBC,GAAO,QACPC,GAAM,SACJ,SAASC,IAAqB,CAC3CC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQT,EACb,KAAK,YAAc,EACnB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,IAAM,EACX,KAAK,KAAO,EACZ,KAAK,KAAO,EACZ,KAAK,KAAO,EAUZ,SAASU,EAAeC,EAAK,CAC3B,OAAQA,IAAQ,GAAM,GAAKD,EAAcC,EAAI,OAAO,CAAC,CAAC,EAAIA,EAAI,OAAO,CAAC,CACvE,CAED,SAASC,EAAiCC,EAAMC,EAAW,CACzD,IAAIC,EAAuB,GACvBC,EAAe,GACnB,MAAMC,EAAa,CAACJ,EAAMH,EAAcG,CAAI,CAAC,EACvCK,EAAM,CAAE,EACd,QAASC,EAAI,EAAGA,EAAIN,EAAK,OAAS,EAAGM,IACnCJ,EAAuBE,EAAW,EAAIE,CAAC,EAAE,CAAC,EAAIF,EAAW,EAAIE,CAAC,EAAE,MAAM,EAAG,CAAC,EAC1EF,EAAW,KAAKF,EAAsBL,EAAcK,CAAoB,CAAC,EAE3E,QAASI,EAAI,EAAGA,EAAIF,EAAW,OAAQE,IAAK,CAC1CH,EAAe,GACf,QAASI,EAAI,EAAGA,EAAIP,EAAK,OAAQO,IAC/BJ,GAAgBF,EAAUG,EAAWE,CAAC,EAAEC,CAAC,CAAC,EAE5CF,E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