File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/6D10-R-R-KnAN.js.map
{"version":3,"file":"6D10-R-R-KnAN.js","sources":["../../src/exercices/6e/6D10.js"],"sourcesContent":["import { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { texNombre } from '../../lib/outils/texNombre.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport Exercice from '../Exercice.js'\n\nexport const titre = 'Convert durations'\n\n/**\n * Conversions de durées.\n * * 1 : H vers min ou H ou min ou Hmin vers s\n * * 2 : h vers j-h\n * * 3 : s vers h min s\n * * 4 : h vers semaines j h\n * * 5 : toutes les conversions\n * @author Rémi Angot\n * Référence 6D10\n */\nexport const uuid = '8b0f9'\nexport const ref = '6D10'\nexport default function ConversionsDeDurees () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.sup = 5\n this.titre = titre\n this.consigne = 'Convert.'\n this.nbCols = 1\n this.nbColsCorr = 1\n this.spacing = 2\n this.nbQuestions = 5\n\n this.nouvelleVersion = function () {\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n const listeSousTypeDeQuestionV1 = combinaisonListes(\n [1, 2, 3, 4],\n this.nbQuestions\n )\n const listeSousTypeDeQuestionV2 = combinaisonListes(\n [0, 1, 2],\n this.nbQuestions\n )\n let typesDeQuestions = []\n if (this.sup < 5) {\n typesDeQuestions = combinaisonListes([this.sup], this.nbQuestions)\n }\n if (parseInt(this.sup) === 5) {\n typesDeQuestions = combinaisonListes([1, 2, 3, 4], this.nbQuestions)\n }\n\n for (\n let i = 0, h, m, s, j, texte, texteCorr, cpt = 0;\n i < this.nbQuestions && cpt < 50;\n\n ) {\n if (typesDeQuestions[i] === 1) {\n const sousTypeDeQuestion = listeSousTypeDeQuestionV1[i]\n if (sousTypeDeQuestion === 1) {\n h = randint(2, 11)\n texte = `$${h}~\\\\text{h in minutes.}$`\n texteCorr = `$${h}~\\\\text{h} = ${h}\\\\times60~~\\\\text{min} = ${texNombre(\n h * 60\n )}~\\\\text{min}$`\n }\n if (sousTypeDeQuestion === 2) {\n h = choice([1, 2, 10, 20])\n texte = `$${h}~\\\\text{h in seconds.}$`\n texteCorr = `$${h}~\\\\text{h} = ${h}\\\\times3~600~\\\\text{s} = ${texNombre(\n h * 3600\n )}~\\\\text{s}$`\n }\n if (sousTypeDeQuestion === 3) {\n m = randint(2, 59)\n texte = `$${m}~\\\\text{min in seconds.}$`\n texteCorr = `$${m}~\\\\text{min} = ${m}\\\\times60~\\\\text{s} = ${texNombre(\n m * 60\n )}~\\\\text{s}$`\n }\n if (sousTypeDeQuestion === 4) {\n h = randint(1, 2)\n m = randint(2, 59)\n texte = `$${h}~\\\\text{h}~${m}~\\\\text{min in seconds.}$`\n texteCorr = `$${h}~\\\\text{h}~${m}~\\\\text{min} = ${h}\\\\times3~600~\\\\text{s} + ${m}\\\\times60~\\\\text{s} = ${texNombre(\n h * 3600\n )}+${texNombre(m * 60)}~\\\\text{s} = ${texNombre(\n h * 3600 + m * 60\n )}~\\\\text{s}$`\n }\n }\n if (typesDeQuestions[i] === 2) {\n j = randint(1, 6)\n h = randint(1, 23)\n texte = `$${texNombre(h + 24 * j)}~\\\\text{h in days and hours.}$`\n texteCorr = `$${texNombre(\n h + 24 * j\n )}~\\\\text{h} = ${j}\\\\times24~\\\\text{h} + ${h}~\\\\text{h} = ${j}~\\\\text{j}~${h}~\\\\text{h}$`\n }\n\n if (typesDeQuestions[i] === 3) {\n h = listeSousTypeDeQuestionV2[i]\n m = randint(1, 59)\n s = randint(1, 59)\n if (h > 0) {\n texte = `$${texNombre(\n h * 3600 + m * 60 + s\n )}~\\\\text{s in hours, minutes and seconds.}$`\n texteCorr = `$${texNombre(\n h * 3600 + m * 60 + s\n )}~\\\\text{s} = ${texNombre(h * 3600)}~\\\\text{s}+${\n m * 60 + s\n }~\\\\text{s} =${h}~\\\\text{h}+${m}\\\\times60~\\\\text{s}+${s}~\\\\text{s}=${h}~\\\\text{h}~${m}~\\\\text{min}~${s}~\\\\text{s}$`\n } else {\n texte = `$${texNombre(m * 60 + s)}~\\\\text{s in hours, minutes and seconds.}$`\n texteCorr = `$${texNombre(\n m * 60 + s\n )}~\\\\text{s} = ${m}\\\\times60~\\\\text{s}+${s}~\\\\text{s}=${m}~\\\\text{min}~${s}~\\\\text{s}$`\n }\n }\n if (typesDeQuestions[i] === 4) {\n s = randint(1, 9) // nombre de semaines\n j = randint(1, 6)\n h = randint(1, 23)\n texte = `$${texNombre(\n h + 24 * j + 24 * 7 * s\n )}~\\\\text{h in weeks days and hours.}$`\n if (s > 1) {\n // for managing the plural of weeks\n texteCorr = `$${texNombre(h + 24 * j + 24 * 7 * s)}~\\\\text{h} = ${\n j + 7 * s\n }\\\\times24~\\\\text{h} + ${h}~\\\\text{h} = ${\n j + 7 * s\n }~\\\\text{j}~${h}~\\\\text{h} = ${s}\\\\times7~\\\\text{j} + ${j}~\\\\text{j}~${h}~\\\\text{h} = ${s}~\\\\text{semaines}~${j}~\\\\text{j}~${h}~\\\\text{h}$`\n } else {\n texteCorr = `$${texNombre(h + 24 * j + 24 * 7 * s)}~\\\\text{h} = ${\n j + 7 * s\n }\\\\times24~\\\\text{h} + ${h}~\\\\text{h} = ${\n j + 7 * s\n }~\\\\text{j}~${h}~\\\\text{h} = ${s}\\\\times7~\\\\text{j} + ${j}~\\\\text{j}~${h}~\\\\text{h} = ${s}~\\\\text{semaine}~${j}~\\\\text{j}~${h}~\\\\text{h}$`\n }\n }\n if (this.listeQuestions.indexOf(texte) === -1) {\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 = [\n 'Difficulty level',\n 5,\n '1: Conversions in seconds or minutes\\n2: Conversions in days-hours\\n3: Conversions in hours-minutes-seconds\\n4: Conversions in weeks-days-hours\\n5: Mix'\n ]\n}\n"],"names":["titre","uuid","ref","ConversionsDeDurees","Exercice","listeSousTypeDeQuestionV1","combinaisonListes","listeSousTypeDeQuestionV2","typesDeQuestions","i","h","m","j","texte","texteCorr","cpt","sousTypeDeQuestion","randint","texNombre","choice","listeQuestionsToContenu"],"mappings":"4EAKY,MAACA,EAAQ,oBAYRC,EAAO,QACPC,EAAM,OACJ,SAASC,GAAuB,CAC7CC,EAAS,KAAK,IAAI,EAClB,KAAK,IAAM,EACX,KAAK,MAAQJ,EACb,KAAK,SAAW,WAChB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,QAAU,EACf,KAAK,YAAc,EAEnB,KAAK,gBAAkB,UAAY,CACjC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EACxB,MAAMK,EAA4BC,EAChC,CAAC,EAAG,EAAG,EAAG,CAAC,EACX,KAAK,WACN,EACKC,EAA4BD,EAChC,CAAC,EAAG,EAAG,CAAC,EACR,KAAK,WACN,EACD,IAAIE,EAAmB,CAAE,EACrB,KAAK,IAAM,IACbA,EAAmBF,EAAkB,CAAC,KAAK,GAAG,EAAG,KAAK,WAAW,GAE/D,SAAS,KAAK,GAAG,IAAM,IACzBE,EAAmBF,EAAkB,CAAC,EAAG,EAAG,EAAG,CAAC,EAAG,KAAK,WAAW,GAGrE,QACMG,EAAI,EAAGC,EAAGC,EAAG,EAAGC,EAAGC,EAAOC,EAAWC,EAAM,EAC/CN,EAAI,KAAK,aAAeM,EAAM,IAE9B,CACA,GAAIP,EAAiBC,CAAC,IAAM,EAAG,CAC7B,MAAMO,EAAqBX,EAA0BI,CAAC,EAClDO,IAAuB,IACzBN,EAAIO,EAAQ,EAAG,EAAE,EACjBJ,EAAQ,IAAIH,CAAC,0BACbI,EAAY,IAAIJ,CAAC,gBAAgBA,CAAC,4BAA4BQ,EAC1DR,EAAI,EACL,CAAA,iBAEDM,IAAuB,IACzBN,EAAIS,EAAO,CAAC,EAAG,EAAG,GAAI,EAAE,CAAC,E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