File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/_Tables_de_multiplications-MyByOWFr.js.map
{"version":3,"file":"_Tables_de_multiplications-MyByOWFr.js","sources":["../../src/exercices/6e/_Tables_de_multiplications.js"],"sourcesContent":["import { choice, creerCouples } from '../../lib/outils/arrayOutils'\nimport { texNombre } from '../../lib/outils/texNombre'\nimport Exercice from '../deprecatedExercice.js'\nimport { context } from '../../modules/context.js'\nimport { gestionnaireFormulaireTexte, listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\nimport { miseEnEvidence } from '../../lib/outils/embellissements'\n\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCNum'\nexport const titre = 'Multiplication tables'\nexport const dateDeModifImportante = '24/09/2023'\n/**\n * Tables de multiplication classiques, à trou ou un mélange des deux.\n *\n * Par défaut ce sont les tables de 2 à 9 mais on peut choisir les tables que l'on veut\n * @author Rémi Angot (ES6: Loïc Geeraerts)\n * Référence 6C10-1\n */\nexport default function TablesDeMultiplications (tablesParDefaut = '2-3-4-5-6-7-8-9-10') {\n // Multiply two numbers\n Exercice.call(this)\n this.sup = tablesParDefaut\n this.sup2 = 1 // classique|a_trous|melange\n this.sup3 = true\n this.consigne = 'Calculate:'\n this.spacing = 2\n\n this.besoinFormulaireTexte = ['Choice of tables (between 2 and 10)', 'Numbers separated by hyphens'] // Texte, tooltip\n this.besoinFormulaire2Numerique = [\n 'Type of questions',\n 4,\n '1: Classic\\n2: Holes\\n3: Quotient\\n4: Combination'\n ]\n this.besoinFormulaire3CaseACocher = ['The factor on the left is that of the table', true]\n\n this.nouvelleVersion = function () {\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n const tables = gestionnaireFormulaireTexte({\n min: 2,\n max: 10,\n defaut: randint(2, 10),\n nbQuestions: this.nbQuestions,\n saisie: this.sup,\n enleveDoublons: true\n })\n\n const couples = creerCouples(\n tables,\n [2, 3, 4, 5, 6, 7, 8, 9, 10],\n this.nbQuestions\n ) // Liste tous les couples possibles (2,3)≠(3,2)\n let typesDeQuestions = 'with holes in'\n for (let i = 0, cpt = 0, a, b, texte, texteCorr; i < this.nbQuestions && cpt < 100;) {\n a = couples[i][0]\n b = couples[i][1]\n const ordre = this.sup3 ? [true] : [true, false]\n const choix = choice(ordre)\n if (this.sup2 === 1) {\n typesDeQuestions = 'classic'\n } else if (this.sup2 === 2) {\n typesDeQuestions = 'with holes in'\n } else if (this.sup2 === 3) {\n typesDeQuestions = 'quotient'\n } else {\n typesDeQuestions = choice(['classic', 'with holes in', 'quotient'])\n }\n if (typesDeQuestions === 'classic') {\n // classic\n if (choix) {\n texte = `$${texNombre(a, 0)}\\\\times ${texNombre(b, 0)} =`\n texte += (this.interactif && context.isHtml) ? '$' + ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore') : '\\\\ldots\\\\ldots$'\n texteCorr = `$${texNombre(a, 0)}\\\\times ${texNombre(b, 0)} = ${miseEnEvidence(texNombre(a * b, 0))}$`\n } else {\n texte = `$${texNombre(b, 0)}\\\\times ${texNombre(a, 0)} =`\n texte += (this.interactif && context.isHtml) ? '$' + ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore') : '\\\\ldots\\\\ldots$'\n texteCorr = `$${texNombre(b, 0)}\\\\times ${texNombre(a, 0)} = ${miseEnEvidence(texNombre(a * b, 0))}$`\n }\n setReponse(this, i, a * b)\n } else if (typesDeQuestions === 'with holes in') {\n // with holes in\n // if (tables.length > 2) {\n // If for the first factor there are more than 2 possibilities we can search for it\n\n if (choix) {\n texte = '$' + a.toString() + '\\\\times'\n texte += (this.interactif && context.isHtml) ? '$' + ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore', { texteApres: ` $=${(a * b).toString()}$` }) : ` \\\\ldots\\\\ldots =${(a * b).toString()}$`\n setReponse(this, i, b)\n } else {\n texte = (this.interactif && context.isHtml) ? ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore', { texteApres: ` $\\\\times ${b.toString()} = ${(a * b).toString()}$` }) : `$ \\\\ldots\\\\ldots \\\\times ${b.toString()} =${(a * b).toString()}$`\n setReponse(this, i, a)\n }\n /* } else {\n // Otherwise we necessarily ask for the 2nd factor\n texte = `$${a.toString()} \\\\times`\n texte += (this.interactif && context.isHtml) ? '$' + ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore', { texteApres: ` =${(a * b).toString()}` }) + '$' : `\\\\ldots\\\\ldots = ${(a * b).toString()}$`\n setReponse(this, i, b)\n } */\n texteCorr = choix\n ? `$${a.toString()} \\\\times ${miseEnEvidence(b.toString())} =${(a * b).toString()}$`\n : `$${miseEnEvidence(a.toString())}\\\\times ${b.toString()} =${(a * b).toString()}$`\n } else { // typeDeQuestion === 'quotient'\n texte = `$${texNombre(a * b, 0)} \\\\div ${texNombre(a, 0)} =`\n texte += (this.interactif && context.isHtml) ? '$' + ajouteChampTexteMathLive(this, i, 'inline width10 nospacebefore') : '\\\\ldots\\\\ldots$'\n texteCorr = `$ ${texNombre(a * b, 0)}\\\\div ${texNombre(a, 0)} = ${miseEnEvidence(texNombre(b, 0))}$`\n setReponse(this, i, b)\n }\n if (context.isAmc) {\n this.autoCorrection[i].reponse.param = {\n digits: 2,\n decimals: 0,\n signe: false,\n exposantNbChiffres: 0,\n exposantSigne: false,\n approx: 0\n }\n }\n if (this.questionJamaisPosee(i, a, b, typesDeQuestions)) {\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n } else {\n cpt++\n }\n }\n listeQuestionsToContenu(this)\n }\n}\n"],"names":["interactifReady","interactifType","amcReady","amcType","titre","dateDeModifImportante","TablesDeMultiplications","tablesParDefaut","Exercice","tables","gestionnaireFormulaireTexte","randint","couples","creerCouples","typesDeQuestions","i","cpt","a","b","texte","texteCorr","ordre","choix","choice","texNombre","context","ajouteChampT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