Subversion Repositories wimsdev

Rev

Rev 20 | Rev 16135 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 16120
Line 4... Line 4...
4
!set methparmtype=number,parm equation
4
!set methparmtype=number,parm equation
5
!set methhelp=This method transforms an equation \(A = B)\
5
!set methhelp=This method transforms an equation \(A = B)\
6
 into the equivalent equation \(A/n = B/n), where \(n) is a non-zero number.
6
 into the equivalent equation \(A/n = B/n), where \(n) is a non-zero number.
7
 
7
 
8
!if $wims_read_parm iswordof form check
8
!if $wims_read_parm iswordof form check
9
 !goto $wims_read_parm
9
  !goto $wims_read_parm
10
!endif
10
!endif
11
 
11
 
12
!exit
12
!exit
13
:form
13
:form
14
 Divide the equation
14
 Divide the equation
Line 16... Line 16...
16
 by a number
16
 by a number
17
 !read deduc/methparm.phtml 1,10
17
 !read deduc/methparm.phtml 1,10
18
 
18
 
19
!exit
19
!exit
20
:check
20
:check
21
 !distribute items $methparmobj2 into data,left,sign,right
21
!distribute items $methparmobj2 into data,left,sign,right
22
 !ifval $methparm1=0
22
!ifval $methparm1=0
23
  error=Division by zero!
23
  error=Division by zero!
24
  !advance penalty
24
  !advance penalty
25
  !exit
25
  !exit
26
 !endif
26
!endif
27
 methexp=Divide \($left $sign $right) by \($methparm1)
27
 methexp=Divide \($left $sign $right) by \($methparm1)
28
 
28
 
29
 !read deduc/sub/simplify ($left) / ($methparm1)\
29
!read deduc/sub/simplify ($left) / ($methparm1)\
30
	($right) / ($methparm1)
30
	($right) / ($methparm1)
31
 !distribute lines $out into newleft, newright
31
!distribute lines $out into newleft, newright
32
 !if $newleft=$empty or $newright=$empty
32
!if $newleft=$empty or $newright=$empty
33
  error=bad_data
33
  error=bad_data
34
  !exit
34
  !exit
35
 !endif
35
!endif
36
 newsign=$sign
36
newsign=$sign
37
 newobject2=$newleft $newsign $newright
37
newobject2=$newleft $newsign $newright
38
 oldobject=2
38
oldobject=2
39
 
39
 
40
 contextlist=$ct_Onlywhen the divisor is non-zero,\
40
 contextlist=$ct_Onlywhen the divisor is non-zero,\
41
	$ct_Onlywhen the divisor is positive,\
41
	$ct_Onlywhen the divisor is positive,\
42
	$ct_Always,\
42
	$ct_Always,\
43
	$ct_Onlywhen the two sides are positive,\
43
	$ct_Onlywhen the two sides are positive,\
44
	$ct_Onlywhen the two sides are of the same sign
44
	$ct_Onlywhen the two sides are of the same sign
45
 
-
 
46
!exit
-
 
47
 
45
 
-
 
46
!exit