File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/6C34-F0HbYnFv.js.map
{"version":3,"file":"6C34-F0HbYnFv.js","sources":["../../src/exercices/6e/6C34.js"],"sourcesContent":["import { combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { texteGras } from '../../lib/format/style'\nimport Exercice from '../deprecatedExercice.js'\nimport { context } from '../../modules/context.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\nimport { ajouteChampTexteMathLive } from '../../lib/interactif/questionMathLive.js'\nimport { setReponse } from '../../lib/interactif/gestionInteractif.js'\n\nexport const titre = 'Determining the last digit of a calculation'\nexport const amcReady = true\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcType = 'AMCNum'\n\n/**\n * Trouver le dernier chiffre d'un calcul (somme, produit, différence)\n * @author Erwan DUPLESSY\n * 6C34\n */\n\nexport const uuid = 'b3843'\nexport const ref = '6C34'\nexport default function DernierChiffre () {\n Exercice.call(this)\n this.sup = 3\n this.titre = titre\n this.consigne = 'For each calculation, determine the last digit of the result.'\n this.nbQuestions = 4 // Ici le nombre de questions\n this.nbQuestionsModifiable = true // Active le formulaire nombre de questions\n this.nbCols = 2 // Le nombre de colonnes dans l'énoncé LaTeX\n this.nbColsCorr = 2// Le nombre de colonne pour la correction LaTeX\n this.tailleDiaporama = 3\n this.pasDeVersionLatex = false // mettre à true si on ne veut pas de l'exercice dans le générateur LaTeX\n this.pas_de_version_HMTL = false // mettre à true si on ne veut pas de l'exercice en ligne\n this.video = '' // Id YouTube ou url\n this.correctionDetailleeDisponible = true\n // See the Exercise Class for an exhaustive list of available properties.\n\n this.sup = 1 // A décommenter : valeur par défaut d'un premier paramètre\n\n // this is where the exercise code begins this function creates a copy of the exercise\n this.nouvelleVersion = function () {\n if (this.version === 2) {\n this.sup = 2\n }\n this.sup = parseInt(this.sup)\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\n this.listeQuestions = [] // tableau contenant la liste des questions\n this.listeCorrections = []\n this.autoCorrection = []\n let typeDeQuestionsDisponibles = []\n if (this.sup === 1) {\n typeDeQuestionsDisponibles = ['sum']\n }\n if (this.sup === 2) {\n typeDeQuestionsDisponibles = ['sum', 'product']\n }\n if (this.sup === 3) {\n typeDeQuestionsDisponibles = ['sum', 'product', 'difference']\n }\n const listeTypeDeQuestions = combinaisonListes(typeDeQuestionsDisponibles, this.nbQuestions)\n\n for (let i = 0, a = 0, b = 0, texte = '', texteCorr = '', cpt = 0; i < this.nbQuestions && cpt < 50;) {\n this.contenuCorrection = ''\n switch (listeTypeDeQuestions[i]) {\n case 'sum':\n a = randint(11, 999)\n b = randint(11, 999)\n texte = `$${a} + ${b}$`\n texteCorr = ''\n if (this.correctionDetaillee) {\n texteCorr += `The last digit of $${a} + ${b}$ is the last digit of $${a % 10} + ${b % 10}$.`\n texteCorr += `Or: $${a % 10} + ${b % 10} = ${a % 10 + b % 10} $<br>`\n }\n texteCorr += texteGras(`The last digit of $${a} + ${b}$ is: $${(b + a) % 10}$.`)\n setReponse(this, i, (b + a) % 10)\n\n break\n case 'product':\n a = randint(11, 999)\n b = randint(11, 999)\n texte = `$${a} \\\\times ${b}$`\n texteCorr = ''\n if (this.correctionDetaillee) {\n texteCorr += `The last digit of $${a} \\\\times ${b}$ is the last digit of $${a % 10} \\\\times ${b % 10}$.`\n texteCorr += `Or: $${a % 10} \\\\times ${b % 10} = ${(a % 10) * (b % 10)} $<br>`\n }\n texteCorr += texteGras(`The last digit of $${a} \\\\times ${b}$ is: $${(b * a) % 10}$.`)\n setReponse(this, i, (b * a) % 10)\n break\n\n case 'difference':\n b = randint(11, 999)\n a = randint(b + 1, b + 999)\n texte = `$${a} - ${b}$`\n texteCorr = ''\n if (this.correctionDetaillee) {\n if (a % 10 - b % 10 >= 0) {\n texteCorr += `The last digit of $${a} - ${b}$ is equal to: $${a % 10} - ${b % 10} = ${(a % 10) - (b % 10)}$. <br>`\n } else {\n texteCorr += `As $${a % 10} < ${b % 10}$, we must subtract: $${(a % 10) + 10} - ${b % 10} = ${((a % 10) + 10) - (b % 10)}$. <br>`\n }\n }\n texteCorr += texteGras(`The last digit of $${a} - ${b}$ is: $${(a - b) % 10}$.`)\n setReponse(this, i, (a - b) % 10)\n break\n }\n\n if (context.isHtml && this.interactif) texte += '<br>The units digit is:' + ajouteChampTexteMathLive(this, i, 'largeur10 inline')\n if (context.isAmc) {\n this.autoCorrection[i].enonce = texte.substring(0, texte.length - 1) + '~=$<br>The units digit is:'\n this.autoCorrection[i].propositions = [{ texte: texteCorr, statut: '' }]\n this.autoCorrection[i].reponse.param.digits = 1\n this.autoCorrection[i].reponse.param.decimals = 0\n }\n if (this.listeQuestions.indexOf(texte) === -1) {\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.besoinFormulaireNumerique = ['Difficulty level', 3, '1: Sums\\n2: Sums and products\\n3: Sums, products and differences']\n}\n"],"names":["titre","amcReady","interactifReady","interactifType","amcType","uuid","ref","DernierChiffre","Exercice","typeDeQuestionsDisponibles","listeTypeDeQuestions","combinaisonListes","i","a","b","texte","texteCorr","cpt","randint","texteGras","setReponse","context","ajouteChampTexteMathLive","listeQuestionsToContenu"],"mappings":"sHAQY,MAACA,EAAQ,8CACRC,EAAW,GACXC,EAAkB,GAClBC,EAAiB,WACjBC,EAAU,SAQVC,EAAO,QACPC,EAAM,OACJ,SAASC,GAAkB,CACxCC,EAAS,KAAK,IAAI,EAClB,KAAK,IAAM,EACX,KAAK,MAAQR,EACb,KAAK,SAAW,gEAChB,KAAK,YAAc,EACnB,KAAK,sBAAwB,GAC7B,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,gBAAkB,EACvB,KAAK,kBAAoB,GACzB,KAAK,oBAAsB,GAC3B,KAAK,MAAQ,GACb,KAAK,8BAAgC,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