File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/CM000-dQaGFKuD.js.map
{"version":3,"file":"CM000-dQaGFKuD.js","sources":["../../src/exercices/CM/CM000.js"],"sourcesContent":["import { combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { miseEnEvidence } from '../../lib/outils/embellissements'\nimport { nombreDeChiffresDansLaPartieEntiere } from '../../lib/outils/nombres.js'\nimport Exercice from '../Exercice.js'\nimport { context } from '../../modules/context.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n// on importait amcReady de 5L10 cf commit cf25dab mais mieux vaut le déclarer explicitement\n\nexport const titre = 'Additions et de soustractions'\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCNum'\n\n/**\n * Additions et/ou soustractions classique et/ou à trou.\n *\n * Par défaut c'est un mélange d'additions, soustractions avec et sans trou avec des nombres jusqu'à 20.\n * @author Rémi Angot\n * Référence CM000\n */\nexport const uuid = '6d698'\nexport const ref = 'CM000'\nexport default function TablesAdditionsSoustractions () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.sup = 20\n this.sup2 = 6 // additions|additions à trous|soustractions|soustractions à trous|mélange sans trou|mélange avec trou\n this.consigne = 'Calculer.'\n this.spacing = 2\n this.tailleDiaporama = 3\n this.nouvelleVersion = function () {\n this.autoCorrection = []\n this.sup = parseInt(this.sup)\n this.sup2 = parseInt(this.sup2)\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n let listeTypeDeQuestions = []\n if (this.sup2 === 1) {\n listeTypeDeQuestions = combinaisonListes(\n ['addition'],\n this.nbQuestions\n )\n }\n if (this.sup2 === 2) {\n listeTypeDeQuestions = combinaisonListes(\n ['addition_a_trou'],\n this.nbQuestions\n )\n }\n if (this.sup2 === 3) {\n listeTypeDeQuestions = combinaisonListes(\n ['soustraction'],\n this.nbQuestions\n )\n }\n if (this.sup2 === 4) {\n listeTypeDeQuestions = combinaisonListes(\n ['soustraction_a_trou'],\n this.nbQuestions\n )\n }\n if (this.sup2 === 5) {\n listeTypeDeQuestions = combinaisonListes(\n ['addition', 'soustraction'],\n this.nbQuestions\n )\n }\n if (this.sup2 === 6) {\n listeTypeDeQuestions = combinaisonListes(\n ['addition', 'addition_a_trou', 'soustraction', 'soustraction_a_trou'],\n this.nbQuestions\n )\n }\n for (let i = 0, a, b, texte, texteCorr; i < this.nbQuestions; i++) {\n a = randint(2, this.sup)\n b = randint(2, this.sup)\n this.autoCorrection[i] = {}\n switch (listeTypeDeQuestions[i]) {\n case 'addition':\n texte = `$${a} + ${b} =$`\n if (this.interactif && context.isHtml) {\n texte = ajouteChampTexteMathLive(this, i, 'largeur10 inline', {\n texte: `$${a} + ${b} = $`\n })\n }\n texteCorr = `$${a} + ${b} = ${a + b}$`\n setReponse(this, i, a + b, { formatInteractif: 'calcul' })\n break\n case 'addition_a_trou':\n texte = `$${a} + \\\\ldots\\\\ldots = ${a + b}$`\n if (this.interactif && context.isHtml) {\n texte = ajouteChampTexteMathLive(this, i, 'largeur10 inline', {\n texte: `$${a}~+ $`,\n texteApres: `$= ${a + b}$`\n })\n }\n texteCorr = `$${a} + ${miseEnEvidence(b)} = ${a + b}$`\n setReponse(this, i, b, { formatInteractif: 'calcul' })\n break\n case 'soustraction':\n if (a === b) {\n a = randint(2, this.sup, b)\n }\n if (a < b) {\n b = [a, (a = b)][0] // échange les variables a et b\n }\n texte = `$${a} - ${b} =$`\n if (this.interactif && context.isHtml) {\n texte = ajouteChampTexteMathLive(this, i, 'largeur10 inline', {\n texte: `$${a} - ${b} = $`\n })\n }\n texteCorr = `$${a} - ${b} = ${a - b}$`\n setReponse(this, i, a - b, { formatInteractif: 'calcul' })\n break\n case 'soustraction_a_trou':\n if (a === b) {\n a = randint(2, this.sup, b)\n }\n if (a < b) {\n b = [a, (a = b)][0] // échange les variables a et b\n }\n texte = `$${a} - \\\\ldots\\\\ldots = ${a - b}$`\n if (this.interactif && context.isHtml) {\n texte = ajouteChampTexteMathLive(this, i, 'largeur10 inline', {\n texte: `$${a}~- $`,\n texteApres: `$= ${a - b}$`\n })\n }\n texteCorr = `$${a} - ${miseEnEvidence(b)} = ${a - b}$`\n setReponse(this, i, b, { formatInteractif: 'calcul' })\n break\n }\n\n this.autoCorrection[i].reponse.param = {\n digits: nombreDeChiffresDansLaPartieEntiere(this.autoCorrection[i].reponse.valeur[0]),\n decimals: 0,\n signe: false,\n exposantNbChiffres: 0,\n exposantSigne: false,\n approx: 0,\n formatInteractif: 'calcul'\n }\n this.autoCorrection[i].enonce = texte\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n }\n listeQuestionsToContenu(this)\n }\n this.besoinFormulaireNumerique = ['Valeur maximale', 9999] // Texte, tooltip\n this.besoinFormulaire2Numerique = [\n 'Style de questions',\n 6,\n '1 : Additions\\n2: Additions à trous\\n3: Soustractions\\n4 : Soustractions à trous\\n5 : Additions et soustractions \\n6 : Additions et soustractions avec ou sans trous'\n ]\n}\n"],"names":["titre","interactifReady","interactifType","amcReady","amcType","uuid","ref","TablesAdditionsSoustractions","Exercice","listeTypeDeQuestions","combinaisonListes","a","b","texte","texteCorr","randint","context","ajouteChampTexteMathLive","setReponse","miseEnEvidence","nombreDeChiffresDansLaPartieEntiere","listeQuestionsToContenu"],"mappings":"6FAUY,MAACA,EAAQ,gCACRC,EAAkB,GAClBC,EAAiB,WACjBC,EAAW,GACXC,EAAU,SASVC,EAAO,QACPC,EAAM,QACJ,SAASC,GAAgC,CACtDC,EAAS,KAAK,IAAI,EAClB,KAAK,IAAM,GACX,KAAK,KAAO,EACZ,KAAK,SAAW,YAChB,KAAK,QAAU,EACf,KAAK,gBAAkB,EACvB,KAAK,gBAAkB,UAAY,CACjC,KAAK,eAAiB,CAAE,EACxB,KAAK,IAAM,SAAS,KAAK,GAAG,EAC5B,KAAK,K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