File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/2N41-4-ZMBMmC0I.js.map
{"version":3,"file":"2N41-4-ZMBMmC0I.js","sources":["../../src/exercices/2e/2N41-4.js"],"sourcesContent":["import { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { deprecatedTexFraction, texFractionReduite } from '../../lib/outils/deprecatedFractions.js'\nimport { pgcd } from '../../lib/outils/primalite.js'\nimport Exercice from '../Exercice.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { context } from '../../modules/context.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const titre = 'Développer (a+b)²'\n\n/**\n * Développer (ax+b)²\n * @author Matthieu Devillers\n * matthieu.devillers@ac-rennes.fr\n * 2N41-4, ex 2L12-2\n */\nexport const uuid = '877a9'\nexport const ref = '2N41-4'\nexport default function DevelopperIdentitesRemarquables3 () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.titre = titre\n this.consigne = 'Développer puis réduire les expressions suivantes.'\n this.nbCols = 1\n this.nbColsCorr = 1\n this.spacing = 1\n this.spacingCorr = 1\n this.nbQuestions = 3\n this.sup = 5\n this.interactifReady = interactifReady\n this.interactifType = interactifType\n this.correctionDetailleeDisponible = true\n context.isHtml ? (this.spacingCorr = 3) : (this.spacingCorr = 2)\n if (!context.isHtml) {\n this.correctionDetaillee = false\n }\n this.nouvelleVersion = function () {\n this.sup = parseInt(this.sup)\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n const listeFractions = [\n [1, 2],\n [1, 3],\n [2, 3],\n [1, 4],\n [3, 4],\n [1, 5],\n [2, 5],\n [3, 5],\n [4, 5],\n [1, 6],\n [5, 6],\n [1, 7],\n [2, 7],\n [3, 7],\n [4, 7],\n [5, 7],\n [6, 7],\n [1, 8],\n [3, 8],\n [5, 8],\n [7, 8],\n [1, 9],\n [2, 9],\n [4, 9],\n [5, 9],\n [7, 9],\n [8, 9],\n [1, 10],\n [3, 10],\n [7, 10],\n [9, 10]\n ]\n let typesDeQuestionsDisponibles = []\n if (this.sup === 1) {\n typesDeQuestionsDisponibles = [1] // coef de x = 1\n } else if (this.sup === 2) {\n typesDeQuestionsDisponibles = [2] // coef de x > 1\n } else if (this.sup === 3) {\n typesDeQuestionsDisponibles = [3] // coef de x négatif\n } else if (this.sup === 4) {\n typesDeQuestionsDisponibles = [4] // coefficients rationnels\n } else {\n typesDeQuestionsDisponibles = [1, 2, 3, 4]\n } // mélange des questions\n\n const listeTypeDeQuestions = combinaisonListes(typesDeQuestionsDisponibles, this.nbQuestions)\n for (let i = 0, texte, texteCorr, reponse, cpt = 0, a, b, fraction = [], ns, ds, typesDeQuestions; i < this.nbQuestions && cpt < 50;) {\n typesDeQuestions = listeTypeDeQuestions[i]\n a = randint(1, 12)\n b = randint(2, 12)\n fraction = choice(listeFractions)\n ns = fraction[0]\n ds = fraction[1]\n texteCorr = ''\n switch (typesDeQuestions) {\n case 1:\n texte = `$\\\\left(x+${a}\\\\right)^2$` // (x+a)^2\n if (this.correctionDetaillee) {\n texteCorr += `On développe l'expression en utilisant l'identité remarquable $(a+b)^2=a^2+2ab+b^2$, <br> avec $\\\\color{red} a = x\\\\color{black}$ et $\\\\color{green} b = ${a} \\\\color{black} $ : <br> <br>`\n texteCorr += `$\\\\left(\\\\color{red}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2=\\\\color{red}x\\\\color{black}^2+2 \\\\times \\\\color{red}x \\\\color{black}\\\\times \\\\color{green}${a} \\\\color{black}+ \\\\color{green}${a}\\\\color{black}^2$ <br>`\n texteCorr += `$\\\\phantom{\\\\left(\\\\color{red}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = x^2+${2 * a}x+${a * a}$`\n } else {\n texteCorr += `$\\\\left(x+${a} \\\\right)^2=x^2+${2 * a}x+${a * a}$`\n }\n reponse = `x^2+${2 * a}x+${a * a}`\n break\n case 2:\n texte = `$\\\\left(${b}x+${a}\\\\right)^2$` // b>1\n if (this.correctionDetaillee) {\n texteCorr += `On développe l'expression en utilisant l'identité remarquable $(a+b)^2=a^2+2ab+b^2$, <br> avec $\\\\color{red} a = ${b}x\\\\color{black}$ et $\\\\color{green} b = ${a} \\\\color{black} $ : <br> <br>`\n texteCorr += `$\\\\left(\\\\color{red}${b}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2 = \\\\left(\\\\color{red}${b}x\\\\color{black}\\\\right)^2 + 2 \\\\times \\\\color{red}${b}x\\\\color{black} \\\\times \\\\color{green}${a} + ${a}\\\\color{black}^2$ <br>`\n texteCorr += `$\\\\phantom{\\\\left(\\\\color{red}${b}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = ${b * b}x^2+${2 * b * a}x+${a * a}$`\n } else {\n texteCorr += `$\\\\left(${b}x+${a}\\\\right)^2 = ${b * b}x^2+${2 * b * a}x+${a * a}$`\n }\n reponse = `${b * b}x^2+${2 * b * a}x+${a * a}`\n break\n case 3:\n b = -b\n texte = `$\\\\left(${b}x+${a}\\\\right)^2$` // b<-1\n if (this.correctionDetaillee) {\n texteCorr += `On développe l'expression en utilisant l'identité remarquable $(a+b)^2=a^2+2ab+b^2$, <br> avec $\\\\color{red} a = ${b}x\\\\color{black}$ et $\\\\color{green} b = ${a} \\\\color{black} $ : <br> <br>`\n texteCorr += `$\\\\left(\\\\color{red}${b}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2 = \\\\left(\\\\color{red}${b}x\\\\color{black}\\\\right)^2 + 2 \\\\times \\\\color{red}(${b}x)\\\\color{black} \\\\times \\\\color{green}${a} + ${a}\\\\color{black}^2$ <br>`\n texteCorr += `$\\\\phantom{\\\\left(\\\\color{red}${b}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = ${b * b}x^2 -${2 * (-b) * a}x+${a * a}$`\n } else {\n texteCorr = texte + `$= ${b * b}x^2 -${2 * (-b) * a}x+${a * a}$`\n }\n reponse = `${b * b}x^2-${2 * (-b) * a}x+${a * a}`\n break\n case 4:\n texte = `$\\\\left(${deprecatedTexFraction(ns, ds)}x+${a}\\\\right)^2$`\n if (this.correctionDetaillee) {\n texteCorr += `On développe l'expression en utilisant l'identité remarquable $(a+b)^2=a^2+2ab+b^2$, <br> avec $\\\\color{red} a = ${deprecatedTexFraction(ns, ds)}x\\\\color{black}$ et $\\\\color{green} b = ${a} \\\\color{black} $ : <br> <br>`\n texteCorr += `$\\\\left(\\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2 = \\\\left(\\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black}\\\\right)^2 + 2 \\\\times \\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black} \\\\times \\\\color{green}${a} + ${a}\\\\color{black}^2 $ <br><br>`\n texteCorr += `$\\\\phantom{\\\\left(\\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = ${deprecatedTexFraction(ns * ns, ds * ds)}x^2+${deprecatedTexFraction(2 * ns * a, ds)}x+${a * a}$`\n if ((pgcd(ns, ds) !== 1 || pgcd(2 * ns * a, ds) !== 1)) {\n texteCorr += `<br> <br> $\\\\phantom{\\\\left(\\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = ${texFractionReduite(ns * ns, ds * ds)}x^2+${texFractionReduite(2 * ns * a, ds)}x+${a * a}$`\n }\n } else {\n // texteCorr = texte + `$= ${texFractionReduite(ns * ns, ds * ds)}x^2+${texFractionReduite(2 * ns * a, ds)}x+${a * a}$`\n texteCorr = texte + `$= ${deprecatedTexFraction(ns * ns, ds * ds)}x^2+${deprecatedTexFraction(2 * ns * a, ds)}x+${a * a}$`\n if ((pgcd(ns, ds) !== 1 || pgcd(2 * ns * a, ds) !== 1)) {\n texteCorr += `<br> <br> $\\\\phantom{\\\\left(\\\\color{red}${deprecatedTexFraction(ns, ds)}x\\\\color{black}+\\\\color{green}${a}\\\\color{black}\\\\right)^2} = ${texFractionReduite(ns * ns, ds * ds)}x^2+${texFractionReduite(2 * ns * a, ds)}x+${a * a}$`\n }\n }\n reponse = [`${deprecatedTexFraction(ns * ns, ds * ds)}x^2+${deprecatedTexFraction(2 * ns * a, ds)}x+${a * a}`, `${texFractionReduite(ns * ns, ds * ds)}x^2+${texFractionReduite(2 * ns * a, ds)}x+${a * a}`]\n break\n }\n texte += ajouteChampTexteMathLive(this, i)\n setReponse(this, i, reponse)\n if (this.questionJamaisPosee(i, typesDeQuestions, a)) {\n // Si la question n'a jamais été posée, on en créé une autre\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n this.besoinFormulaireNumerique = ['Niveau de difficulté', 5, '1 : Coefficient de x égal à 1\\n 2 : Coefficient de x supérieur à 1\\n 3 : Coefficient de x négatif\\n 4 : Coefficient de x rationnel\\n 5 : Mélange des cas précédents']\n}\n"],"names":["interactifReady","interactifType","titre","uuid","ref","DevelopperIdentitesRemarquables3","Exercice","context","listeFractions","typesDeQuestionsDisponibles","listeTypeDeQuestions","combinaisonListes","i","texte","texteCorr","reponse","cpt","a","b","fraction","ns","ds","typesDeQuestions","randint","choice","deprecatedTexFraction","pgcd","texFractionReduite","ajouteChampTexteMathLive","setReponse","listeQuestionsToContenu"],"mappings":"+JASY,MAACA,EAAkB,GAClBC,EAAiB,WACjBC,EAAQ,oBAQRC,EAAO,QACPC,EAAM,SACJ,SAASC,GAAoC,CAC1DC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQJ,EACb,KAAK,SAAW,qDAChB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,QAAU,EACf,KAAK,Y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