HEX
Server: Apache
System: Linux vps.mmtprep.com 4.18.0-477.21.1.el8_8.x86_64 #1 SMP Thu Aug 10 13:51:50 EDT 2023 x86_64
User: mmtprep (1001)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/3G42-KiPwvMmH.js.map
{"version":3,"file":"3G42-KiPwvMmH.js","sources":["../../src/exercices/3e/3G42.js"],"sourcesContent":["import { choice } from '../../lib/outils/arrayOutils'\nimport { texteExposant } from '../../lib/outils/ecritures'\nimport { nombreDeChiffresDansLaPartieDecimale, nombreDeChiffresDe } from '../../lib/outils/nombres'\nimport { stringNombre, texNombre } from '../../lib/outils/texNombre'\nimport Exercice from '../deprecatedExercice.js'\nimport { mathalea2d } from '../../modules/2dGeneralites.js'\nimport { gestionnaireFormulaireTexte, listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { cylindre3d, point3d, sphere3d, vecteur3d } from '../../modules/3d.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport Decimal from 'decimal.js'\nimport Grandeur from '../../modules/Grandeur'\nimport { context } from '../../modules/context.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\nimport { texteEnCouleurEtGras } from '../../lib/outils/embellissements'\nimport { sp } from '../../lib/outils/outilString.js'\n\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCNum'\n\nexport const titre = 'Determine the volume of a ball'\nexport const dateDePublication = '09/02/2021' // La date de publication initiale au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\nexport const dateDeModifImportante = '05/11/2023' // Une date de modification importante au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\n\n/**\n * Calculer le volume d'une boule\n * @author Erwan DUPLESSY (AMC par EE)\n */\n\nexport const uuid = '8c803'\nexport const ref = '3G42'\nexport default function VolumeBoule () {\n  Exercice.call(this)\n  this.video = 'YQF7CBY-uEk'\n  this.nbQuestions = 3 // Ici le nombre de questions\n  this.sup = '1-2-4'\n  const unites = ['km', 'hmm', 'dam', 'm', 'dm', 'cm', 'mm']\n  // this is where the exercise code begins this function creates a copy of the exercise\n  this.nouvelleVersion = function () {\n    // the numeroExercice variable can be retrieved to allow two copies of the same exo to be differentiated\n    // For example, to be sure not to have the same point names by calling this exo twice on the same page\n    this.listeQuestions = [] // tableau contenant la liste des questions\n    this.listeCorrections = []\n    this.autoCorrection = []\n\n    const listeTypeDeQuestions = gestionnaireFormulaireTexte({\n      saisie: this.sup,\n      min: 1,\n      max: 4,\n      melange: 5,\n      defaut: 5,\n      nbQuestions: this.nbQuestions\n    })\n    for (let i = 0, r, d, A, rayon, O, B, OO, o, R, s, c, texte, texteCorr, reponse, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n      texte = '' // Nous utilisons souvent cette variable pour construire le texte de la question.\n      texteCorr = '' // Idem pour le texte de la correction.\n      const choixUnites = choice(unites)\n      switch (listeTypeDeQuestions[i]) {\n        case 1:\n          r = randint(2, 30)\n          reponse = new Decimal(r).pow(3).mul(Decimal.acos(-1)).mul(4).div(3).toDP(1)\n          texte += 'Calculate volume' + (context.isAmc ? `, in ${choixUnites}` + texteExposant(3) + ',' : '') + ` of a ball of radius ${r} ${choixUnites}. Round to the tenth.`\n          texteCorr += 'The volume of a ball is given by the formula: $V = \\\\dfrac{4}{3}\\\\pi r^3$. <br>'\n          texteCorr += `We therefore have: $V = \\\\dfrac{4}{3} \\\\times \\\\pi \\\\times (${r} \\\\text{ ${choixUnites}})^3$. <br>`\n          texteCorr += 'The volume of the ball is therefore approximately: ' + texteEnCouleurEtGras(stringNombre(reponse, 1) + ` ${choixUnites}` + texteExposant(3)) + '. <br>'\n          break\n\n        case 2:\n          d = randint(2, 30)\n          reponse = new Decimal(d).pow(3).mul(Decimal.acos(-1)).mul(4).div(3).toDP(1)\n          texte += 'Calculate volume' + (context.isAmc ? `, in ${choixUnites}` + texteExposant(3) + ',' : '') + ` of a ball of diameter ${2 * d} ${choixUnites}. Round to the tenth.`\n          texteCorr += 'The volume of a ball is given by the formula: $V = \\\\dfrac{4}{3}\\\\pi r^3$. <br>'\n          texteCorr += `The radius of the ball is half its diameter, i.e.: ${d} ${choixUnites}. <br>`\n          texteCorr += `We therefore have: $V = \\\\dfrac{4}{3} \\\\times \\\\pi \\\\times (${d} \\\\text{ ${choixUnites}})^3$. <br>`\n          texteCorr += 'The volume of the ball is therefore approximately: ' + texteEnCouleurEtGras(stringNombre(reponse, 1) + ` ${choixUnites}` + texteExposant(3)) + '. <br>'\n          break\n\n        case 3:\n          A = randint(2, 30)\n          texte += 'Calculate volume' + (context.isAmc ? `, in ${choixUnites}` + texteExposant(3) + ',' : '') + ` of a ball of area ${A} cm². Round to the tenth.`\n          texteCorr += 'The volume of a ball is given by the formula: $V = \\\\dfrac{4}{3}\\\\pi r^3$. <br>'\n          texteCorr += 'We must therefore find the radius of the ball. <br>'\n          texteCorr += 'The area of a ball is given by the formula: $A = 4\\\\pi r^2$. <br>'\n          texteCorr += `We therefore have the equality: $${A} = 4\\\\pi r^2$.`\n          texteCorr += `We deduce: $r^2 = \\\\dfrac{${A}}{4\\\\pi}$. <br>`\n          texteCorr += `And, since $r$ is positive: $r=\\\\sqrt{\\\\dfrac{${A}}{4\\\\pi}}$. <br>`\n          rayon = new Decimal(A).div(Decimal.acos(-1).mul(4)).sqrt()\n          reponse = Decimal.acos(-1).mul(4 * rayon ** 3).div(3).toDP(1)\n          texteCorr += 'We therefore obtain an approximate value of $r$: $r \\\\approx' + texNombre(rayon, 2) + `$${choixUnites}. <br>`\n          texteCorr += 'We therefore have: $V \\\\approx \\\\dfrac{4}{3} \\\\times \\\\pi \\\\times (' + texNombre(rayon, 2) + ` \\\\text{ ${choixUnites}})^3$. <br>`\n          texteCorr += 'The volume of the ball is therefore approximately: ' + texteEnCouleurEtGras(stringNombre(reponse, 1) + ` ${choixUnites}` + texteExposant(3)) + '. <br>'\n          break\n\n        case 4:\n          rayon = randint(2, 30)\n          texte += `A cylindrical box of ${2 * rayon} ${choixUnites} in diameter and ${2 * rayon} ${choixUnites} in height contains a ball of diameter ${2 * rayon} ${choixUnites}. <br>`\n          texte += 'Calculate volume' + (context.isAmc ? `, in ${choixUnites}` + texteExposant(3) + ',' : '') + ' in the box left free by the ball. Round to the tenth.'\n\n          texteCorr += 'Let\\'s represent the situation with a small diagram: <br>'\n          O = point3d(0, 0, 0)\n          B = point3d(2.5, 0, 0)\n          OO = point3d(0, 0, 5)\n          o = point3d(0, 0, 2.5)\n          R = vecteur3d(O, B)\n          s = sphere3d(o, 2.5, 'blue', 'blue', 4, 'gray', 10, 'gray')\n          c = cylindre3d(O, OO, R, R, 'black', false)\n          reponse = Decimal.acos(-1).mul(2 * rayon ** 3).div(3).toDP(1)\n          texteCorr += '<br>' + mathalea2d({\n            xmin: -5,\n            max: 9,\n            ymin: -1.5,\n            ymax: 6,\n            scale: 0.8\n          }, ...s.c2d, ...c.c2d) + '<br>'\n          texteCorr += 'Method: we calculate the volume of the cylinder from which we will subtract the volume of the ball. <br>'\n          texteCorr += 'The volume of the cylinder is: $V_c = \\\\pi r^2 h$; and that of the ball is: $V_b = \\\\dfrac{4}{3}\\\\pi r^3$. <br>'\n          texteCorr += `The radius of the cylinder is half its diameter, ${rayon} ${choixUnites}, and its height is ${2 * rayon} ${choixUnites}. <br>`\n          texteCorr += `The radius of the ball is half its diameter, i.e.: ${rayon} ${choixUnites}. <br>`\n          texteCorr += `Here, the volume of the cylinder is therefore: $V_c = \\\\pi \\\\times (${rayon} \\\\text{ ${choixUnites}})^2 \\\\times (${2 * rayon}\\\\text{ ${choixUnites}})$. <br>`\n          texteCorr += `The volume of the ball is: $V_b = \\\\dfrac{4}{3} \\\\times \\\\pi \\\\times (${rayon} \\\\text{ ${choixUnites}})^3$. <br>`\n          texteCorr += `The volume sought is therefore given by: $\\\\pi \\\\times (${rayon} \\\\text{ ${choixUnites}})^2 \\\\times (${2 * rayon}\\\\text{ ${choixUnites}}) - \\\\dfrac{4}{3} \\\\times \\\\pi \\\\times (${rayon} \\\\text{ ${choixUnites}})^3$. <br>`\n          texteCorr += 'The volume sought is approximately: ' + texteEnCouleurEtGras(stringNombre(reponse, 1) + ` ${choixUnites}` + texteExposant(3)) + '. <br>'\n          break\n      }\n      // EE: It is the setReponse which returns a red console.\n      // console.log('BEGIN OF PB')\n      // console.log(i, listTypeOfQuestions[i], response.toNumber(), choiceUnits)\n      setReponse(this, i, new Grandeur(reponse.toNumber(), `${choixUnites}^3`), { formatInteractif: 'units' })\n      // console.log('END OF PB')\n      texte += ajouteChampTexteMathLive(this, i, 'largeur15 inline units[Lengths, Areas, Volumes]', { texteAvant: '<br>' + sp(12) + 'You should remember to specify the unit in the response volume: ' })\n      if (context.isAmc) {\n        this.autoCorrection[i] = {\n          enonce: texte,\n          propositions: [{ texte: texteCorr, statut: 0 }],\n          reponse: {\n            texte: '',\n            valeur: reponse.toNumber(),\n            param: {\n              digits: nombreDeChiffresDe(reponse.toNumber()),\n              decimals: nombreDeChiffresDansLaPartieDecimale(reponse.toNumber()),\n              signe: false,\n              exposantNbChiffres: 0,\n              exposantSigne: false,\n              approx: 0\n            }\n          }\n        }\n      }\n      if (this.questionJamaisPosee(i, reponse)) {\n        // If the question has never been asked, we store it in the list of questions\n        this.listeQuestions.push(texte)\n        this.listeCorrections.push(texteCorr)\n        i++\n      }\n      cpt++\n    }\n    listeQuestionsToContenu(this) // On envoie l'exercice à la fonction de mise en page\n  }\n  this.besoinFormulaireTexte = ['Choice of problems', 'Numbers separated by hyphens\\n1: From radius\\n2: From diameter\\n3: From area\\n4: By solving a problem\\n5: Combination']\n} // Fin de l'exercice.\n"],"names":["interactifReady","interactifType","amcReady","amcType","titre","dateDePublication","dateDeModifImportante","uuid","ref","VolumeBoule","Exercice","unites","listeTypeDeQuestions","gestionnaireFormulaireTexte","i","r","d","A","rayon","O","B","OO","o","R","s","c","texte","texteCorr","reponse","cpt","choixUnites","choice","randint","Decimal","context","texteExposant","texteEnCouleurEtGras","stringNombre","texNombre","point3d","vecteur3d","sphere3d","cylindre3d","mathalea2d","setReponse","Grandeur","ajouteChampTexteMathLive","sp","nombreDeChiffresDe","nombreDeChiffresDansLaPartieDecimale","listeQuestionsToContenu"],"mappings":"qSAgBY,MAACA,EAAkB,GAClBC,EAAiB,WACjBC,EAAW,GACXC,EAAU,SAEVC,EAAQ,iCACRC,EAAoB,aACpBC,EAAwB,aAOxBC,EAAO,QACPC,EAAM,OACJ,SAASC,IAAe,CACrCC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQ,cACb,KAAK,YAAc,EACnB,KAAK,IAAM,QACX,MAAMC,EAAS,CAAC,KAAM,MAAO,MAAO,IAAK,KAAM,KAAM,IAAI,EAEzD,KAAK,gBAAkB,UAAY,CAGjC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EAExB,MAAMC,EAAuBC,EAA4B,CACvD,OAAQ,KAAK,IACb,IAAK,EACL,IAAK,EACL,QAAS,EACT,OAAQ,EACR,YAAa,KAAK,WACxB,CAAK,EACD,QAASC,EAAI,EAAGC,EAAGC,EAAGC,EAAGC,EAAOC,EAAGC,EAAGC,EAAIC,EAAGC,EAAGC,EAAGC,EAAGC,EAAOC,EAAWC,EAASC,EAAM,EAAGf,EAAI,KAAK,aAAee,EAAM,IAAK,CAC3HH,EAAQ,GACRC,EAAY,GACZ,MAAMG,EAAcC,EAAOpB,CAAM,EACjC,OAAQC,EAAqBE,CAAC,EAAC,CAC7B,IAAK,GACHC,EAAIiB,EAAQ,EAAG,EAAE,EACjBJ,EAAU,IAAIK,EAAQlB,CAAC,EAAE,IAAI,CAAC,EAAE,IAAIkB,EAAQ,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,EAC1EP,GAAS,oBAAsBQ,EAAQ,MAAQ,QAAQJ,CAAW,GAAKK,EAAc,CAAC,EAAI,IAAM,IAAM,w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