Rev 16204 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !set methtit=Ajouter un nombre aux deux côtés d'une équation |
2 | !set methparmtype=number,parm equation |
||
3 | !set methhelp=Cette méthode transforme une équation \(a = b)\ |
||
4 | en l'équation équivalente \(a + n = b + n), où \(n) est un nombre. |
||
5 | |||
6 | !if $wims_read_parm iswordof form check |
||
16135 | bpr | 7 | !goto $wims_read_parm |
20 | reyssat | 8 | !endif |
9 | |||
10 | !exit |
||
11 | :form |
||
12 | Ajouter le nombre |
||
13 | !read deduc/methparm.phtml 1,15 |
||
14 | aux deux côtés de l'équation |
||
15 | !read deduc/methparm.phtml 2 |
||
16 | |||
17 | !exit |
||
18 | :check |
||
16204 | bpr | 19 | !distribute items $methparmobj2 into data,left,sign,right |
17063 | bpr | 20 | methexp=Ajouter \($methparm1) aux deux côtés de \($left $sign $right) |
20 | reyssat | 21 | |
16204 | bpr | 22 | !read deduc/sub/simplify ($left + ($methparm1)\ |
20 | reyssat | 23 | $right + ($methparm1) |
16204 | bpr | 24 | !distribute lines $out into newleft,newright |
25 | !if $newleft=$empty or $newright=$empty |
||
20 | reyssat | 26 | error=bad_data |
27 | !exit |
||
16204 | bpr | 28 | !endif |
29 | newsign=$sign |
||
30 | newobject2=$newleft $newsign $newright |
||
31 | oldobject=2 |
||
16135 | bpr | 32 | |
16204 | bpr | 33 | contextlist=$ct_Always,\ |
20 | reyssat | 34 | $ct_Onlywhen le nombre ajouté est de signe constant,\ |
35 | $ct_Onlywhen le nombre ajouté est positif |
||
36 | |||
16204 | bpr | 37 | !if $askresult>1 |
20 | reyssat | 38 | !read deduc/sub/simplify $left - ($methparm1)\ |
16204 | bpr | 39 | $right - ($methparm1) |
20 | reyssat | 40 | !distribute lines $out into badleft, badright |
41 | badsign=!translate internal <> to >< in $newsign |
||
16135 | bpr | 42 | |
20 | reyssat | 43 | resultlist=$newobject2,\ |
16204 | bpr | 44 | $newleft $newsign $badright,\ |
45 | $badleft $newsign $newright |
||
46 | !endif |
||
20 | reyssat | 47 | |
48 | !exit |