File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/6P13-kgStElXP.js.map
{"version":3,"file":"6P13-kgStElXP.js","sources":["../../src/exercices/6e/6P13.js"],"sourcesContent":["import { choice, combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { texteEnCouleurEtGras } from '../../lib/outils/embellissements'\nimport { lampeMessage } from '../../lib/format/message.js'\nimport { arrondi, nombreDeChiffresDansLaPartieDecimale } from '../../lib/outils/nombres.js'\nimport { numAlpha, sp } from '../../lib/outils/outilString.js'\nimport { prenomF, prenomM } from '../../lib/outils/Personne.js'\nimport { texPrix } from '../../lib/format/style'\nimport Exercice from '../Exercice.js'\nimport { calculANePlusJamaisUtiliser, listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { context } from '../../modules/context.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n\nexport const titre = 'Increase or decrease by a percentage'\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCHybride'\nexport const dateDePublication = '23/07/2021'\nexport const dateDeModifImportante = '16/04/2023'\n\n/**\n * Description didactique de l'exercice\n * augmenter ou diminuer un prix d'un pourcentage,\n * le calcul intermédiaire du montant de l'augmentation ou de la baisse est demandé\n * Quatre niveaux :\n * - 1 valeurs entières et 10%, 20%...;\n * - 2 Comme le 1 mais avec 25% et 75% en plus ;\n * - 3 valeurs entières et 13%, 28%...;\n * - 4 valeurs décimale comme 13,5%...;\n * @author Laurence CANDILLE (Rajout de 25% et 50% par Eric Elter)\n * Référence 6P13\n * Date de Publication : 23/07/2021\n * Relecture : Novembre 2021 par EE\n */\nexport const uuid = '064ce'\nexport const ref = '6P13'\nexport default function AugmenterEtReduireDunPourcentage () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.consigne = ''\n this.nbQuestions = 2\n this.nbCols = 1 // Uniquement pour la sortie LaTeX\n this.nbColsCorr = 1 // Uniquement pour la sortie LaTeX\n this.sup = 1 // Niveau de difficulté\n this.sup2 = 2\n this.tailleDiaporama = 3 // Pour les exercices chronométrés. 50 par défaut pour les exercices avec du texte\n this.video = '' // Id YouTube ou url\n this.interactifType = 'mathLive'\n this.listePackages = 'bclogo'\n\n this.nouvelleVersion = function () {\n const n = this.sup - 1\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n this.introduction = (this.sup2 && this.interactif && context.isHtml)\n ? lampeMessage({\n titre: 'Authorized calculator.',\n texte: 'Write the answers in the boxes without rounding, do not specify \"€\" or \"euros\"...',\n couleur: 'numbers'\n })\n : ''\n const typeQuestionsDisponibles = ['increase', 'reduction'] // On créé 2 types de questions\n const listeTypeQuestions = combinaisonListes(typeQuestionsDisponibles, this.nbQuestions) // Tous les types de questions sont posés mais l'ordre diffère à chaque 'cycle'\n\n let billet, loyer // prix du billet, loyer de l'appart\n let pr, pa // pourcentage réduction, pourcentage augmentation\n let mr, ma // montant réduction, montant augmentation\n let final1, final2 // prix final 1 , prix final 2\n let prenom1, prenom2 // choix aleatoire des prenoms\n function nombreDecimales (n) {\n if (n === 0) {\n pr = randint(1, 6) * 10\n pa = randint(1, 3) * 10\n } else if (n === 1) {\n pr = choice([10, 20, 25, 30, 50, 60, 70, 75])\n pa = choice([10, 20, 25, 30])\n } else if (n === 2) {\n pr = randint(21, 39, [30])\n pa = randint(2, 9)\n } else {\n pr = calculANePlusJamaisUtiliser((randint(40, 60) * 100 + randint(1, 9) * 10) / 100)\n pa = calculANePlusJamaisUtiliser((randint(1, 9) * 10 + randint(1, 9)) / 10)\n }\n }\n\n for (let i = 0, texte, texteCorr, enonceInit, enonceAMC, propositionsAMC, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n // Main loop where i+1 corresponds to the question number\n prenom1 = prenomM()\n prenom2 = prenomF()\n billet = arrondi(2 * randint(50, 100), 0)\n loyer = arrondi(2 * randint(251, 449, [300, 350, 400]), 0)\n\n switch (listeTypeQuestions[i]) { // Suivant le type de question, le contenu sera différent\n case 'reduction':\n nombreDecimales(n)\n mr = calculANePlusJamaisUtiliser(pr * billet / 100)\n final1 = calculANePlusJamaisUtiliser(billet - mr)\n texte = `A plane ticket costs ${billet} ${sp()}€. ${prenom1} benefits from a reduction of $${pr} ${sp()}\\\\%$.`\n enonceInit = texte\n enonceAMC = (this.interactif && context.isHtml) ? `${numAlpha(0)} The amount of the reduction is:` : `${numAlpha(0)} Calculate the amount of the reduction.`\n texte = enonceInit + '<br>' + enonceAMC\n texte += (this.interactif && context.isHtml) ? ajouteChampTexteMathLive(this, 2 * i, 'width15 inline nospacebefore', { texteApres: ' €.' }) : ''\n texte += '<br>'\n if (!context.isAmc) {\n setReponse(this, 2 * i, mr, { formatInteractif: 'calculation' })\n } else {\n propositionsAMC = [\n {\n type: 'AMCNum',\n propositions: [\n {\n texte: texteCorr,\n reponse: {\n texte: enonceAMC,\n valeur: [mr],\n param: {\n digits: 5,\n decimals: 2,\n signe: false,\n approx: 0,\n exposantNbChiffres: 0\n }\n }\n }\n ]\n }\n ]\n }\n enonceAMC = (this.interactif && context.isHtml) ? `${numAlpha(1)} Finally, ${prenom1} will pay its ticket:` : `${numAlpha(1)} Calculate the ticket price from ${prenom1}.`\n texte += enonceAMC\n texte += (this.interactif && context.isHtml) ? ajouteChampTexteMathLive(this, 2 * i + 1, 'width15 inline nospacebefore', { texteApres: ' €.' }) : ''\n if (!context.isAmc) {\n setReponse(this, 2 * i + 1, final1)\n } else {\n propositionsAMC.push(\n {\n type: 'AMCNum',\n propositions: [\n {\n texte: '',\n reponse: {\n texte: enonceAMC,\n valeur: [final1],\n param: {\n digits: 5,\n decimals: 2,\n signe: false,\n approx: 0,\n exposantNbChiffres: 0\n }\n }\n }\n ]\n }\n )\n }\n texteCorr = `${numAlpha(0)} The amount of the reduction is: $${billet} ${sp()}€ \\\\times ${pr} \\\\div 100$` + sp(1)\n texteCorr += nombreDeChiffresDansLaPartieDecimale(mr) < 3 ? '$=$' : '$ \\\\approx$'\n texteCorr += texteEnCouleurEtGras(` $${texPrix(mr)} ${sp()}€$.<br>`)\n texteCorr += `${numAlpha(1)} Finally, ${prenom1} will pay for his ticket: $${billet} ${sp()}€ - ${texPrix(mr)} ${sp()}€ =$` + sp(1)\n texteCorr += texteEnCouleurEtGras(`$${texPrix(final1)} ${sp()}€$.`)\n break\n case 'increase':\n nombreDecimales(n)\n calculANePlusJamaisUtiliser(ma = pa * loyer / 100)\n calculANePlusJamaisUtiliser(final2 = loyer + ma)\n\n enonceInit = `The rent for ${prenom2}'s apartment costs ${loyer} ${sp()}€. On January 1, it increases by $${pa} ${sp()}\\\\%$.`\n enonceAMC = (this.interactif && context.isHtml) ? `${numAlpha(0)} The amount of the increase is:` : `${numAlpha(0)} Calculate the amount of the increase.`\n texte = enonceInit + '<br>' + enonceAMC\n texte += (this.interactif && context.isHtml) ? ajouteChampTexteMathLive(this, 2 * i, 'width15 inline nospacebefore', { texteApres: ' €.' }) : ''\n texte += '<br>'\n if (!context.isAmc) {\n setReponse(this, 2 * i, ma)\n } else {\n propositionsAMC = [\n {\n type: 'AMCNum',\n propositions: [\n {\n texte: texteCorr,\n reponse: {\n texte: enonceAMC,\n valeur: [ma],\n param: {\n digits: 5,\n decimals: 2,\n signe: false,\n approx: 0,\n exposantNbChiffres: 0\n }\n }\n }\n ]\n }\n ]\n }\n enonceAMC = (this.interactif && context.isHtml) ? `${numAlpha(1)} Finally, ${prenom2} will pay its rent:` : `${numAlpha(1)} Calculate the rent amount from ${prenom2}.`\n texte += enonceAMC\n texte += (this.interactif && context.isHtml) ? ajouteChampTexteMathLive(this, 2 * i + 1, 'width15 inline nospacebefore', { texteApres: ' €.' }) : ''\n if (!context.isAmc) {\n setReponse(this, 2 * i + 1, final2)\n } else {\n propositionsAMC.push(\n {\n type: 'AMCNum',\n propositions: [\n {\n texte: texteCorr,\n reponse: {\n texte: enonceAMC,\n valeur: [final2],\n param: {\n digits: 5,\n decimals: 2,\n signe: false,\n approx: 0,\n exposantNbChiffres: 0\n }\n }\n }\n ]\n }\n )\n }\n texteCorr = `${numAlpha(0)} The amount of the increase is: $${loyer} ${sp()}€ \\\\times ${pa} \\\\div 100$` + sp(1)\n texteCorr += nombreDeChiffresDansLaPartieDecimale(ma) < 3 ? '$=$' : '$ \\\\approx$'\n texteCorr += texteEnCouleurEtGras(` $${texPrix(ma)} ${sp()}€$.<br>`)\n texteCorr += `${numAlpha(1)} Finally, ${prenom2} will pay its rent: $${loyer} ${sp()}€ + ${texPrix(ma)} ${sp()}€ =$` + sp(1)\n texteCorr += texteEnCouleurEtGras(`$${texPrix(final2)} ${sp()}€$.`)\n break\n }\n if (this.listeQuestions.indexOf(texte) === -1) {\n // If the question has never been asked, we create another one\n if (context.isAmc) {\n this.autoCorrection[i] = {\n enonce: enonceInit,\n options: { multicols: true, barreseparation: true }, // facultatif. Par défaut, multicols est à false. Ce paramètre provoque un multicolonnage (sur 2 colonnes par défaut) : pratique quand on met plusieurs AMCNum. !!! Attention, cela ne fonctionne pas, nativement, pour AMCOpen. !!!\n propositions: propositionsAMC\n }\n }\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n this.besoinFormulaireNumerique = ['Difficulty level', 4, '1: Integer values and 10%, 20%...\\n2: Integer values and 10%, 20%... but also 25% and 50%\\n3: Integer values and 4%, 23%...\\n4 : A decimal like 34.5%']\n this.besoinFormulaire2CaseACocher = ['With calculator indication (interactive)']\n}\n"],"names":["titre","interactifReady","interactifType","amcReady","amcType","dateDePublication","dateDeModifImportante","uuid","ref","AugmenterEtReduireDunPourcentage","Exercice","n","context","lampeMessage","listeTypeQuestions","combinaisonListes","billet","loyer","pr","pa","mr","ma","final1","final2","prenom1","prenom2","nombreDecimales","randint","choice","calculANePlusJamaisUtiliser","i","texte","texteCorr","enonceInit","enonceAMC","propositionsAMC","cpt","prenomM","prenomF","arrondi","sp","numAlpha","ajouteChamp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