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/geoCarre2-OOdPhaVv.js.map
{"version":3,"file":"geoCarre2-OOdPhaVv.js","sources":["../../src/exercices/geodyn/geoCarre2.ts"],"sourcesContent":["import Exercice from '../ExerciceTs'\nimport Figure from 'apigeom'\nimport figureApigeom from '../../lib/figureApigeom'\nimport { randint } from '../../modules/outils'\n\nexport const titre = 'Tracer un carré de dimension donnée'\nexport const dateDePublication = '10/11/2023'\nexport const interactifReady = true\nexport const interactifType = 'custom'\n\n/**\n * Tracer un carré\n * @author Rémi Angot\n * Références geoCarre2\n */\n\nexport const ref = 'carre2'\nexport const uuid = '01607'\n\nclass ConstructionCarre2 extends Exercice {\n  // On déclare des propriétés supplémentaires pour cet exercice afin de pouvoir les réutiliser dans la correction\n  figure!: Figure\n  idApigeom!: string\n  cote!: number\n  constructor () {\n    super()\n    this.typeExercice = 'simple'\n    this.nbQuestions = 1\n    this.nbQuestionsModifiable = false\n    this.reponse = ''\n    this.formatChampTexte = 'none'\n    this.exoCustomResultat = true\n  }\n\n  nouvelleVersion (): void {\n    this.idApigeom = `apigeomEx${this.numeroExercice}F0`\n    this.figure = new Figure({ xMin: 0, yMin: 0, width: 800, height: 500, border: true })\n    this.figure.options.labelAutomaticBeginsWith = 'A'\n    this.cote = randint(3, 10)\n\n    const enonce = `Tracer un carré $ABCD$ de côté ${this.cote}.`\n    this.figure.setToolbar({ tools: ['POINT', 'POINT_ON', 'POINT_INTERSECTION', 'SEGMENT', 'LINE_PERPENDICULAR', 'LINE_PARALLEL', 'POLYGON', 'CIRCLE_CENTER_POINT', 'CIRCLE_RADIUS', 'NAME_POINT', 'DRAG', 'HIDE', 'REMOVE', 'UNDO', 'REDO', 'SHAKE'], position: 'top' })\n    const emplacementPourFigure = figureApigeom({ exercice: this, idApigeom: this.idApigeom, figure: this.figure })\n    let texteCorr = 'Un carré est un quadrilatère qui a 4 angles droits et quatre côtés de même longueur.'\n    texteCorr += '<br>On peut tracer un carré de différentes façons.'\n    texteCorr += '<br>Dans cette animation, on va tracer un quadrilatère avec 3 angles droits et deux côtés consécutifs de même longueur mais on n\\'aurait pu aussi ne faire qu\\'un angle droit et tracer des côtés opposés parallèles.'\n    const figureCorrection = createAnimationConstructionCarre(this.cote)\n    const emplacementPourFigureCorrection = figureApigeom({ animation: true, exercice: this, idApigeom: `apigeomEx${this.numeroExercice}Correction`, figure: figureCorrection })\n    this.question = enonce + emplacementPourFigure\n    this.correction = texteCorr + emplacementPourFigureCorrection\n  }\n\n  correctionInteractive = () => {\n    this.answers = {}\n    // Sauvegarde de la réponse pour Capytale\n    this.answers[this.idApigeom] = this.figure.json\n    const resultat = []\n    let feedback = ''\n    // 1 point par angle droit + 1 point si tout est correct (on ne vérifie pas que le triangle est tracé)\n    const divFeedback = document.querySelector(`#feedback${this.idApigeom}`) as HTMLDivElement\n    const { isValid, message } = this.figure.checkAngle({ angle: 90, label1: 'A', label2: 'B', label3: 'C' })\n    resultat.push(isValid ? 'OK' : 'KO')\n    if (message !== '') { feedback += message + '<br>' }\n    const { isValid: isValid2, message: message2 } = this.figure.checkAngle({ angle: 90, label1: 'B', label2: 'C', label3: 'D' })\n    resultat.push(isValid2 ? 'OK' : 'KO')\n    if (message2 !== '') { feedback += message2 + '<br>' }\n    const { isValid: isValid3, message: message3 } = this.figure.checkAngle({ angle: 90, label1: 'C', label2: 'D', label3: 'A' })\n    resultat.push(isValid3 ? 'OK' : 'KO')\n    if (message3 !== '') { feedback += message3 + '<br>' }\n    const { isValid: isValid4, message: message4 } = this.figure.checkDistance({ distance: this.cote, label1: 'A', label2: 'B' })\n    resultat.push(isValid4 ? 'OK' : 'KO')\n    if (message4 !== '') { feedback += message4 + '<br>' }\n    const { isValid: isValid5, message: message5 } = this.figure.checkDistance({ distance: this.cote, label1: 'B', label2: 'C' })\n    resultat.push(isValid5 ? 'OK' : 'KO')\n    if (message5 !== '') { feedback += message5 + '<br>' }\n    if (isValid && isValid2 && isValid3 && isValid4 && isValid5) {\n      feedback += 'Le quadrilatère $ABCD$ a 3 angles droits et deux côtés consécutifs de même longueur donc c\\'est un carré.'\n      feedback += '<br>Bravo !'\n    }\n    divFeedback.innerHTML = feedback\n    this.figure.isDynamic = false\n    this.figure.divButtons.style.display = 'none'\n    this.figure.divUserMessage.style.display = 'none'\n    this.figure.buttons.get('SHAKE')?.click()\n    return resultat\n  }\n}\n\nexport default ConstructionCarre2\n\nfunction createAnimationConstructionCarre (c: number) : Figure {\n  const figure = new Figure({ xMin: 0, yMin: 0, width: 800, height: 500, border: true })\n  figure.setToolbar({ position: 'top', tools: ['RESTART', 'PLAY_SKIP_BACK', 'PLAY', 'PLAY_SKIP_FORWARD', 'PAUSE'] })\n  const description = figure.create('TextByPosition', { anchor: 'bottomLeft', backgroundColor: 'white', text: 'On peut commencer par tracer le côté $[AB]$.', x: 10, y: 15 })\n  description.text += `<br>$AB=${c}$ donc le point $B$ est sur le cercle de centre $A$ et de rayon ${c}.`\n  const A = figure.create('Point', { x: 3, y: 3, label: 'A' })\n  const cA = figure.create('Circle', { center: A, radius: c })\n  const B = figure.create('PointOnCircle', { circle: cA, angleWithHorizontal: 0.1, label: 'B' })\n  const sAB = figure.create('Segment', { point1: A, point2: B })\n  figure.saveState()\n  description.text = 'On trace la droite perpendiculaire à $(AB)$ passant par $A$.'\n  const dAD = figure.create('LinePerpendicular', { line: sAB, point: A })\n  figure.saveState()\n  description.text = `$AD=${c}$ donc le point $D$ est à l'intersection du cercle et de cette perpendiculaire.`\n  const D = figure.create('PointIntersectionLC', { line: dAD, circle: cA, label: 'D' })\n  figure.saveState()\n  const dBC = figure.create('LinePerpendicular', { line: sAB, point: B })\n  description.text = 'On peut tracer la perpendiculaire à $(AB)$ passant par le point $B$.'\n  figure.saveState()\n  description.text = 'On peut tracer la perpendiculaire à $(AD)$ passant par $D$ (ou la pralèlle à $(AB)$ passant par $D$).'\n  const dCD = figure.create('LinePerpendicular', { line: dAD, point: D })\n  figure.saveState()\n  const C = figure.create('PointIntersectionLL', { line1: dBC, line2: dCD, label: 'C' })\n  description.text = 'On place le point $C$ à l\\'intersection de ces deux dernières droites.'\n  figure.saveState()\n  description.text = 'On peut cacher le segment, le cercle et les droites.'\n  sAB.hide()\n  dBC.hide()\n  dCD.hide()\n  dAD.hide()\n  cA.hide()\n  figure.saveState()\n  description.text = 'On peut tracer le quadrilatère $ABCD$. Comme il a 3 angles droits, et deux côtés consécutifs de même longueur, c\\'est obligatoirement un carré.'\n  figure.create('Polygon', { points: [A, B, C, D] })\n  figure.saveState()\n  return figure\n}\n"],"names":["titre","dateDePublication","interactifReady","interactifType","ref","uuid","ConstructionCarre2","Exercice","__publicField","resultat","feedback","divFeedback","isValid","message","isValid2","message2","isValid3","message3","isValid4","message4","isValid5","message5","_a","Figure","randint","enonce","emplacementPourFigure","figureApigeom","texteCorr","figureCorrection","createAnimationConstructionCarre","emplacementPourFigureCorrection","c","figure","description","A","cA","B","sAB","dAD","D","dBC","dCD","C"],"mappings":"oVAKO,MAAMA,EAAQ,sCACRC,EAAoB,aACpBC,EAAkB,GAClBC,EAAiB,SAQjBC,EAAM,SACNC,EAAO,QAEpB,MAAMC,UAA2BC,CAAS,CAKxC,aAAe,CACP,QAJRC,EAAA,eACAA,EAAA,kBACAA,EAAA,aA6BAA,EAAA,6BAAwB,IAAM,OAC5B,KAAK,QAAU,GAEf,KAAK,QAAQ,KAAK,SAAS,EAAI,KAAK,OAAO,KAC3C,MAAMC,EAAW,CAAA,EACjB,IAAIC,EAAW,GAEf,MAAMC,EAAc,SAAS,cAAc,YAAY,KAAK,SAAS,EAAE,EACjE,CAAE,QAAAC,EAAS,QAAAC,CAAA,EAAY,KAAK,OAAO,WAAW,CAAE,MAAO,GAAI,OAAQ,IAAK,OAAQ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