Répondre à : Remplacement des réponses analysées automatiquement type coord

Accueil Forums Programmation WIMS Programmation d’exercices OEF Remplacement des réponses analysées automatiquement type coord Répondre à : Remplacement des réponses analysées automatiquement type coord

#2625
Julien
Modérateur
Up
0
Down
::

Bonjour,

Le code proposé devrait fonctionner. La variable graphique2 n’est pas rechargée dans le \answer alors qu’on affiche très facilement le graphique à la deuxième étape en ajoutant : <img src="\graphique2" />

J’ai testé avec jsxgraphcurve et c’est le même constat l’image ne recharge pas même en utilisant le nexstep.

Par conséquent je te propose 2 solutions. Une facile mais qui ne correspond pas vraiment à ce que tu veux et une plus difficile qui te permettra de configurer l’exo aux petits oignons
facile

\title{WimsAnalysejsxgraphDroite}
\language{fr}
\range{-5..5}
\computeanswer{no}
\format{html}
\precision{10000}

\real{a=randint(-5..5)}
\real{b=randint(-5..5)}

\function{f=\a x+ \b}
\function{f=pari(\f)}

\real{yA=evalue(\f,x=5)}
\real{yB=evalue(\f,x=-5)}
\real{yApixel=600/2-\yA*600/16-2}
\real{yBpixel=600/2-\yB*600/16-2}

\text{point=slib(graphpaper/millimetre 10,8,5,4,1,2,[255,255,255],[190,190,190],,,)}
\text{urlpoint = draw(0,0
\point)}

\statement{
Tracer la droite (d) d'équation : \(y=\f)
\embed{reply1, 800 x 600}
}
\answer{}{\urlpoint;line,4,\yBpixel,804,\yApixel}{type=jsxgraphcurve}{option= precision=2 color1=blue color2=green}

difficile

\title{Exemple de jsxgraph}
\precision{100}

\text{ nstep=reply1 }
\nextstep{\nstep}  

\text{a=randint(1..5), randint(1..5)}
\text{b=randint(1..5), randint(1..5)}
\text{script= var brd1 = JXG.JSXGraph.initBoard('jsxbox', {
 axis:true,boundingbox: [-6, 6, 6, -6], grid:true});
;}

\text{script1= var brd2 = JXG.JSXGraph.initBoard('jsxbox', {
 axis:true,boundingbox: [-6, 6, 6, -6], grid:true});
;}

\statement{Mettre le point A en (\a).
Mettre le point C sur la droite AB.
\if{\step=1}{ \embed{r1,400x400
jsxbox
\script
}}
\if{\step=2}{\embed{r2,400x400
jsxbox
\script1
}}
\reply1
}

\text{script1= var brd2 = JXG.JSXGraph.initBoard('jsxbox', {
 axis:true,boundingbox: [-6, 6, 6, -6], grid:true});
brd2.create('point',[\c]);
;
}

\answer{}{\c}{type=jsxgraph}{option= freepoint nonstop noanalyzeprint}
\answer{}{\e}{type=jsxgraph}{option= freepoint}

\matrix{rep=\reply1}
\real{test=abs(\rep[1;1]-1)}
\condition{premier sur la droite d'équation x=1}{ \test < 0.1}
\text{nstep = (\step = 2)?reply2}

Un lien vers les différentes commandes de jsxgraph:
http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph_refcard.pdf

@+

  • Cette réponse a été modifiée le il y a 9 années et 12 mois par Julien.
  • Cette réponse a été modifiée le il y a 9 années et 12 mois par Julien.
  • Cette réponse a été modifiée le il y a 9 années et 12 mois par Julien.
  • Cette réponse a été modifiée le il y a 9 années et 12 mois par Julien.