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/geoRectangle1-IX3A3yOF.js.map
{"version":3,"file":"geoRectangle1-IX3A3yOF.js","sources":["../../src/exercices/geodyn/geoRectangle1.ts"],"sourcesContent":["import Exercice from '../Exercice'\nimport Figure from 'apigeom'\nimport figureApigeom from '../../lib/figureApigeom'\n\nexport const titre = 'Tracer un rectangle'\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 geoRectangle1\n */\n\nexport const ref = 'rectangle1'\nexport const uuid = '95526'\n\nclass ConstructionRectangle 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  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\n    const enonce = 'Tracer un rectangle $ABCD$.'\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    const figureCorrection = createAnimationConstructionRectangle()\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.checkAngle({ angle: 90, label1: 'D', label2: 'A', label3: 'B' })\n    resultat.push(isValid4 ? 'OK' : 'KO')\n    if (message4 !== '') { feedback += message4 + '<br>' }\n    if (isValid && isValid2 && isValid3 && isValid4) {\n      resultat.push('OK')\n      feedback += 'Bravo !'\n    } else {\n      resultat.push('KO')\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 ConstructionRectangle\n\nfunction createAnimationConstructionRectangle () : 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  const A = figure.create('Point', { x: 3, y: 3, label: 'A' })\n  const B = figure.create('Point', { x: 12, y: 4, 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 $B$.'\n  const dBC = figure.create('LinePerpendicular', { line: sAB, point: B })\n  figure.saveState()\n  description.text = 'On place un point $C$ sur cette droite en utilisant le bouton « Point sur » et non « Point libre ».'\n  const C = figure.create('PointOnLine', { line: dBC, k: -0.5, 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","ConstructionRectangle","Exercice","__publicField","resultat","feedback","divFeedback","isValid","message","isValid2","message2","isValid3","message3","isValid4","message4","_a","Figure","enonce","emplacementPourFigure","figureApigeom","texteCorr","figureCorrection","createAnimationConstructionRectangle","emplacementPourFigureCorrection","figure","description","A","B","sAB","dBC","C","dCD","dAD","D"],"mappings":"sUAIO,MAAMA,EAAQ,sBACRC,EAAoB,YACpBC,EAAkB,GAClBC,EAAiB,SAQjBC,EAAM,aACNC,EAAO,QAEpB,MAAMC,UAA8BC,CAAS,CAI3C,aAAe,CACP,QAHRC,EAAA,eACAA,EAAA,kBA4BAA,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,IAAK,OAAQ,IAAK,OAAQ,IAAK,EACnHN,EAAA,KAAKK,EAAW,KAAO,IAAI,EAChCC,IAAa,KAAML,GAAYK,EAAW,QAC9C,KAAM,CAAE,QAASC,EAAU,QAASC,GAAa,KAAK,OAAO,WAAW,CAAE,MAAO,GAAI,OAAQ,IAAK,OAAQ,IAAK,OAAQ,IAAK,EACnHR,EAAA,KAAKO,EAAW,KAAO,IAAI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