File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/6N22-1-KHfwPycs.js.map
{"version":3,"file":"6N22-1-KHfwPycs.js","sources":["../../src/exercices/6e/6N22-1.js"],"sourcesContent":["import { combinaisonListesSansChangerOrdre } from '../../lib/outils/arrayOutils'\nimport { miseEnEvidence } from '../../lib/outils/embellissements'\nimport Exercice from '../deprecatedExercice.js'\nimport { mathalea2d } from '../../modules/2dGeneralites.js'\nimport { context } from '../../modules/context.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\n\nimport { fraction } from '../../modules/fractions.js'\nexport const titre = 'Express the ratio of two lengths on a segment'\n\n/**\n * * Exprimer un rapport de longueurs sur un segment\n * * 6N22-1\n * @author Sébastien Lozano\n */\n\nexport const uuid = '7781a'\nexport const ref = '6N22-1'\nexport default function RapportsSurUnSegment () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.nbQuestions = 2\n\n this.consigne = 'On all axes, the graduations are regular.'\n\n this.nbCols = 1\n this.nbColsCorr = 1\n // this.nbQuestionsModifiable = false;\n context.isHtml ? this.spacing = 3 : this.spacing = 2\n context.isHtml ? this.spacingCorr = 2.5 : this.spacingCorr = 1.5\n\n let typesDeQuestionsDisponibles\n\n this.nouvelleVersion = function () {\n typesDeQuestionsDisponibles = [0, 1]\n\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n\n const listeTypeDeQuestions = combinaisonListesSansChangerOrdre(typesDeQuestionsDisponibles, this.nbQuestions) // Tous les types de questions sont posées --> à remettre comme ci-dessus\n\n for (let i = 0, texte, texteCorr, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n const entierMax = 9\n const m = randint(1, entierMax)\n const n = randint(1, entierMax, m) // on évite l'autre pour éviter la fraction 1\n const params = {\n xmin: -0.4,\n ymin: -2,\n xmax: 15 * entierMax, // pour éviter un cadrage trop large\n ymax: 1,\n pixelsParCm: 20,\n scale: 1\n }\n // we stick the figure to the statement\n const yEnonce = -1.2\n\n // we sometimes have figures that are too small or too big\n //\n const rayon = 5\n // if (m<n) {\n // radius = 15\n // } else {\n // radius = 15/Math.ceil(m/n)\n // };\n\n // we randomly choose a triplet of names for the points\n const nomsChoix = [['A', 'B', 'C'], ['D', 'E', 'F'], ['I', 'J', 'K'], ['L', 'M', 'N']]\n const noms = nomsChoix[randint(0, nomsChoix.length - 1)]\n\n // for situations, as many situations as there are cases in the switch!\n const situations = [\n { // case 0 --> m < n\n m: Math.min(m, n),\n n: Math.max(m, n),\n rapport: `\\\\dfrac{${noms[0] + noms[1]}}{${noms[0] + noms[2]}}`,\n rapport_inverse: `\\\\dfrac{${noms[0] + noms[2]}}{${noms[0] + noms[1]}}`,\n fig: mathalea2d(\n params,\n fraction(Math.min(m, n), Math.max(m, n)).representation(0, 0, rayon, 0, 'segment', 'none', noms[0], noms[1], 1, noms[2])\n ),\n segment_corr1: `\\\\textcolor{red}{[${noms[0] + noms[2]}]}`,\n longueur_corr1: `\\\\textcolor{red}{${noms[0] + noms[2]}}`,\n m_color_corr: `\\\\textcolor{red}{${Math.min(m, n)}}`,\n n_color_corr: `\\\\textcolor{blue}{${Math.max(m, n)}}`,\n fig_corr1: mathalea2d(\n params,\n fraction(Math.min(m, n), Math.max(m, n)).representation(0, yEnonce, rayon, 0, 'segment', 'red', noms[0], noms[1], 1, noms[2])\n ),\n segment_corr2: `\\\\textcolor{blue}{[${noms[0] + noms[1]}]}`,\n longueur_corr2: `\\\\textcolor{blue}{${noms[0] + noms[1]}}`,\n fig_corr2: mathalea2d(\n params,\n fraction(Math.max(m, n), Math.min(m, n)).representation(0, yEnonce, (Math.min(m, n) / Math.max(m, n)) * rayon, 0, 'segment', 'blue', noms[0], noms[2], 1, noms[1])\n )\n },\n { // case 1 --> m > n\n m: Math.max(m, n),\n n: Math.min(m, n),\n rapport: `\\\\dfrac{${noms[0] + noms[1]}}{${noms[0] + noms[2]}}`,\n rapport_inverse: `\\\\dfrac{${noms[0] + noms[2]}}{${noms[0] + noms[1]}}`,\n fig: mathalea2d(\n params,\n fraction(Math.max(m, n), Math.min(m, n)).representation(0, 0, 5, 0, 'segment', 'none', noms[0], noms[1], 1, noms[2])\n ),\n segment_corr1: `\\\\textcolor{red}{[${noms[0] + noms[2]}]}`,\n longueur_corr1: `\\\\textcolor{red}{${noms[0] + noms[2]}}`,\n m_color_corr: `\\\\textcolor{red}{${Math.max(m, n)}}`,\n n_color_corr: `\\\\textcolor{blue}{${Math.min(m, n)}}`,\n fig_corr1: mathalea2d(\n params,\n fraction(Math.max(m, n), Math.min(m, n)).representation(0, yEnonce, 5, 0, 'segment', 'red', noms[0], noms[1], 1, noms[2])\n ),\n segment_corr2: `\\\\textcolor{blue}{[${noms[0] + noms[1]}]}`,\n longueur_corr2: `\\\\textcolor{blue}{${noms[0] + noms[1]}}`,\n fig_corr2: mathalea2d(\n params,\n fraction(Math.min(m, n), Math.max(m, n)).representation(0, yEnonce, (Math.max(m, n) / Math.min(m, n)) * 5, 0, 'segment', 'blue', noms[0], noms[2], 1, noms[1])\n )\n }\n\n ]\n\n const enonces = []\n for (let k = 0; k < situations.length; k++) {\n enonces.push({\n enonce: `\n Express the following ratios $${situations[k].rapport}$ and $${situations[k].rapport_inverse}$.\n <br>\n ${situations[k].fig}\n`,\n question: '',\n correction: `\n The graduations being regular, let's count the number of spaces between two graduations for each segment :<br>\n ${situations[k].fig_corr1}<br>\n The segment $${situations[k].segment_corr1}$ account $${situations[k].m_color_corr}$ ${singPlur(situations[k].m, 'space', 'spaces')}.<br>\n ${situations[k].fig_corr2}<br>\n The segment $${situations[k].segment_corr2}$ segment $${situations[k].n_color_corr}$ ${singPlur(situations[k].n, 'space', 'spaces')}.<br><br>\n $\\\\textbf{Donc}$ $\\\\mathbf{\\\\dfrac{${situations[k].longueur_corr2}}{${situations[k].longueur_corr1}}=\\\\dfrac{${situations[k].n_color_corr}}{${situations[k].m_color_corr}}}$\n $\\\\textbf{et}$ $\\\\mathbf{\\\\dfrac{${situations[k].longueur_corr1}}{${situations[k].longueur_corr2}}=\\\\dfrac{${situations[k].m_color_corr}}{${situations[k].n_color_corr}}}$<br><br>\n ${Remarque(situations[k].rapport, situations[k].rapport_inverse, situations[k].n, situations[k].m)}\n`\n })\n }\n\n // as many boxes as elements in the situation table\n switch (listeTypeDeQuestions[i]) {\n case 0:\n texte = `${enonces[0].enonce}`\n texteCorr = `${enonces[0].correction}`\n break\n case 1:\n texte = `${enonces[1].enonce}`\n texteCorr = `${enonces[1].correction}`\n break\n case 2:\n texte = `${enonces[2].enonce}`\n texteCorr = `${enonces[2].correction}`\n break\n case 3:\n texte = `${enonces[3].enonce}`\n texteCorr = `${enonces[3].correction}`\n break\n case 4:\n texte = `${enonces[4].enonce}`\n texteCorr = `${enonces[4].correction}`\n break\n }\n\n if (this.questionJamaisPosee(i, texte)) { // <- laisser le i et ajouter toutes les variables qui rendent les exercices différents (par exemple a, b, c et d)\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n // this.needNumericalForm = ['Difficulty level',2,\"1: Natural integers\\n2: Relative integers\"];\n // this.needFormular2BoxCheck = [\"With quadratic expressions\"];\n}\nfunction singPlur (nombre, singulier, pluriel) {\n if (nombre > 1) {\n return pluriel\n } else {\n return singulier\n }\n}\nfunction etapeSimp (n, m) {\n let sortie\n const rapport = fraction(n, m).n / fraction(n, m).numIrred\n if (rapport !== 1) {\n sortie = `\\\\dfrac{${fraction(n, m).numIrred} ${miseEnEvidence(`\\\\times ${fraction(n, m).n / fraction(n, m).numIrred}`)}}{${fraction(n, m).denIrred}${miseEnEvidence(`\\\\times ${fraction(n, m).n / fraction(n, m).numIrred}`)}}\\\\mathbf{=}${fraction(n, m).texFractionSimplifiee}`\n } else {\n sortie = `${fraction(n, m).texFractionSimplifiee}`\n }\n return sortie\n}\nfunction Remarque (rapAlph, rapAlphI, n, m) {\n let sortie\n const rapport = fraction(n, m).n / fraction(n, m).numIrred\n if (rapport !== 1) {\n sortie = `Note: We will see later that $${rapAlph}=${etapeSimp(fraction(n, m).n, fraction(n, m).d)}$ and $${rapAlphI}=${etapeSimp(fraction(m, n).n, fraction(m, n).d)}$<br>`\n } else {\n sortie = ''\n }\n return sortie\n}\n"],"names":["titre","uuid","ref","RapportsSurUnSegment","Exercice","context","typesDeQuestionsDisponibles","listeTypeDeQuestions","combinaisonListesSansChangerOrdre","texte","texteCorr","cpt","m","randint","n","params","yEnonce","rayon","nomsChoix","noms","situations","mathalea2d","fraction","enonces","k","singPlur","Remarque","listeQuestionsToContenu","nombre","singulier","pluriel","etapeSimp","sortie","miseEnEvidence","rapAlph","rapAlphI"],"mappings":"qFAQY,MAACA,EAAQ,gDAQRC,EAAO,QACPC,EAAM,SACJ,SAASC,GAAwB,CAC9CC,EAAS,KAAK,IAAI,EAClB,KAAK,YAAc,EAEnB,KAAK,SAAW,4CAEhB,KAAK,OAAS,EACd,KAAK,WAAa,EAElBC,EAAQ,OAAS,KAAK,QAAU,EAAI,KAAK,QAAU,EACnDA,EAAQ,OAAS,KAAK,YAAc,IAAM,KAAK,YAAc,IAE7D,IAAIC,EAEJ,KAAK,gBAAkB,UAAY,CACjCA,EAA8B,CAAC,EAAG,CAAC,EAEnC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EAExB,MAAMC,EAAuBC,EAAkCF,EAA6B,KAAK,WAAW,EAE5G,QAAS,EAAI,EAAGG,EAAOC,EAAWC,EAAM,EAAG,EAAI,KAAK,aAAeA,EAAM,IAAK,CAE5E,MAAMC,EAAIC,EAAQ,EAAG,CAAS,EACxBC,EAAID,EAAQ,EAAG,EAAWD,CAAC,EAC3BG,EAAS,CACb,KAAM,IACN,KAAM,GACN,KAAM,GAAK,EACX,KAAM,EACN,YAAa,GACb,MAAO,CACR,EAEKC,EAAU,KAIVC,EAAQ,EAQRC,EAAY,CAAC,CAAC,IAAK,IAAK,GAAG,EAAG,CAA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