File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/geoRectangle2-uov-Pvmq.js.map
{"version":3,"file":"geoRectangle2-uov-Pvmq.js","sources":["../../src/exercices/geodyn/geoRectangle2.ts"],"sourcesContent":["import Exercice from '../Exercice'\nimport Figure from 'apigeom'\nimport figureApigeom from '../../lib/figureApigeom'\nimport { randint } from '../../modules/outils'\n\nexport const titre = 'Tracer un rectangle de dimensions données'\nexport const dateDePublication = '4/11/2023'\nexport const interactifReady = true\nexport const interactifType = 'custom'\n\n/**\n * Tracer un rectangle\n * @author Rémi Angot\n * Références geoRectangle2\n */\n\nexport const ref = 'rectangle2'\nexport const uuid = '1d6ca'\n\nclass ConstructionRectangleDimensions 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 L!: number\n l!: 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: -7, yMin: -7, width: 800, height: 500, border: true })\n this.figure.options.labelAutomaticBeginsWith = 'A'\n this.L = randint(4, 10)\n this.l = randint(2, this.L - 1)\n const enonce = `Tracer un rectangle $ABCD$ tel que $AB=${this.L}$ et $BC=${this.l}$.`\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 rectangle est un quadrilatère qui a 4 angles droits.'\n texteCorr += '<br>On peut tracer un rectangle de différentes façons.'\n texteCorr += '<br>Dans cette animation, on va tracer un quadrilatère avec 3 angles droits mais on n\\'aurait pu aussi ne faire qu\\'un angle droit et tracer des côtés opposés parallèles.'\n texteCorr += '<br>Pour faire un segment de longueur donnée, il faut obligatoirement un tracer un cercle de centre un point et de rayon la longueur du segment.'\n const figureCorrection = createAnimationConstructionRectangle(this.L, this.l)\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({ label1: 'A', label2: 'B', distance: this.L })\n resultat.push(isValid4 ? 'OK' : 'KO')\n if (message4 !== '') { feedback += message4 + '<br>' }\n const { isValid: isValid5, message: message5 } = this.figure.checkDistance({ label1: 'B', label2: 'C', distance: this.l })\n resultat.push(isValid5 ? 'OK' : 'KO')\n if (message5 !== '') { feedback += message5 + '<br>' }\n if (isValid && isValid2 && isValid3 && isValid4) {\n feedback += '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 ConstructionRectangleDimensions\n\nfunction createAnimationConstructionRectangle (L: number, l: 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: `$AB=${L}$ donc le point $B$ est sur le cercle de centre $A$ et de rayon ${L}.`, x: 10, y: 15 })\n const A = figure.create('Point', { x: 3, y: 3, label: 'A' })\n const cAL = figure.create('Circle', { center: A, radius: L })\n const B = figure.create('PointOnCircle', { circle: cAL, angleWithHorizontal: 0.1, label: 'B' })\n const sAB = figure.create('Segment', { point1: A, point2: B })\n figure.saveState()\n description.text = 'On peut cacher le cercle'\n cAL.hide()\n figure.saveState()\n description.text = 'On trace la droite perpendiculaire à $(AB)$ passant par $B$.'\n const dBC = figure.create('LinePerpendicular', { line: sAB, point: B })\n figure.saveState()\n description.text = `$BC=${l}$ donc le point $C$ est à une intersection de cette droite et du cercle de centre $B$ et de rayon ${l}.`\n const cBl = figure.create('Circle', { center: B, radius: l })\n const C = figure.create('PointIntersectionLC', { line: dBC, circle: cBl, shape: 'x', label: 'C' })\n figure.saveState()\n description.text = 'On trace la droite perpendiculaire à $(BC)$ passant par $C$.'\n const dCD = figure.create('LinePerpendicular', { line: dBC, point: C })\n figure.saveState()\n description.text = 'On trace la perpendiculaire à la droite $(AB)$ passant par $A$.'\n const dAD = figure.create('LinePerpendicular', { line: sAB, point: A })\n figure.saveState()\n description.text = 'On place un point $D$ à l\\'intersection de ces deux dernières droites en utilisant le bouton « Point à l\\'intersection » et non « Point libre ».'\n const D = figure.create('PointIntersectionLL', { line1: dAD, line2: dCD, label: 'D' })\n figure.saveState()\n description.text = 'On peut cacher le segment et les droites.'\n sAB.hide()\n dBC.hide()\n dCD.hide()\n dAD.hide()\n figure.saveState()\n description.text = 'On peut tracer le quadrilatère $ABCD$. Comme il a 3 angles droits, c\\'est obligatoirement un rectangle.'\n figure.create('Polygon', { points: [A, B, C, D] })\n figure.saveState()\n return figure\n}\n"],"names":["titre","dateDePublication","interactifReady","interactifType","ref","uuid","ConstructionRectangleDimensions","Exercice","__publicField","resultat","feedback","divFeedback","isValid","message","isValid2","message2","isValid3","message3","isValid4","message4","isValid5","message5","_a","Figure","randint","enonce","emplacementPourFigure","figureApigeom","texteCorr","figureCorrection","createAnimationConstructionRectangle","emplacementPourFigureCorrection","L","l","figure","description","A","cAL","B","sAB","dBC","cBl","C","dCD","dAD","D"],"mappings":"kVAKO,MAAMA,EAAQ,4CACRC,EAAoB,YACpBC,EAAkB,GAClBC,EAAiB,SAQjBC,EAAM,aACNC,EAAO,QAEpB,MAAMC,UAAwCC,CAAS,CAMrD,aAAe,CACP,QALRC,EAAA,eACAA,EAAA,kBACAA,EAAA,UACAA,EAAA,UA8BAA,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,IAAK,OAAQ,IAAK,EAC/FJ,EAAA,KAAKG,EAAU,KAAO,IAAI,EAC/BC,IAAY,KAAMH,GAAYG,EAAU,QAC5C,KAAM,CAAE,QAASC,EAAU,QAASC,GAAa,KAAK,OAAO,WAAW,CAAE,MAAO,GAAI,OAAQ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