Subversion Repositories wimsdev

Rev

Rev 5763 | Blame | Compare with Previous | Last modification | View Log | RSS feed

!set methtit=·½³ÌµÄ¼ÓȨºÍʽ
!set methparmtype=parm equation >,parm equation >,\
    number, number, choice 2
!set methparmrelax=5
!set methhelp=Õâ¸ö·½·¨¼ÆËãÁ½¸ö·½³ÌµÄ¼ÓȨºÍʽ.\
    ËùµÃ½á¹û»òÕß¿ÉÒÔ¼Óµ½¼ÙÉèÖÐ,\
    »òÕßÈ¡´úÁ½¸ö³õʼ·½³ÌÖеÄÒ»¸ö.

!if $wims_read_parm iswordof form check
 !goto $wims_read_parm
!endif

!exit
:form
 ÒýÈëÒ»¸öз½³Ì, ËüÊÇ <br>
 !default methparm3=1
 !default methparm4=1
 !read deduc/methparm.phtml 3,5
 ³Ë·½³Ì
 !read deduc/methparm.phtml 1
 <br>¼ÓÉÏ
 !read deduc/methparm.phtml 4,5
 ³Ë·½³Ì
 !read deduc/methparm.phtml 2
 <br>
 Ðµķ½³Ì
 !formselect methparm5 list 0,1,2 prompt \
    ±»¼Óµ½¼ÙÉèÖÐ,\
    Ìæ»»µÚÒ»¸ö·½³Ì,\
    Ìæ»»µÚ¶þ¸ö·½³Ì
!exit
:check
 !ifval $methparm3=0 and $methparm4=0
  error=ϵÊýÊÇÁã!
  !exit
 !endif
 !ifval ($methparm=1 and $methparm3=0) or \
    ($methparm=2 and $methparm4=0)
  error=ÄãÒªÓÃÒ»¸öϵÊýȫΪÁãµÄ·½³ÌÈ¥Ìæ»»Âð?\
   Õâ»á¶ªÊ§ÐÅÏ¢µÄ!
  !advance penalty
  !exit
 !endif
 !distribute items $methparmobj1 into data1,left1,sign1,right1
 !distribute items $methparmobj2 into data2,left2,sign2,right2
 !if $data1 issametext $data2
  error=Õâ¸ö·½·¨½ûÖ¹Ò»¸ö·½³ÌÓë×Ô¼ºÏà¼Ó.
  !exit
 !endif
 methexp=\(($methparm3)*($left1 $sign1 $right1) + ($methparm4)*($left2 $sign2 $right2))

 !read deduc/sub/simplify ($methparm3)*($left1) + ($methparm4)*($left2)\
    ($methparm3)*($right1) + ($methparm4)*($right2)
 !distribute lines $out into newleft, newright
 !if $newleft=$empty or $newright=$empty
  error=bad_data
  !exit
 !endif

 newobject$methparm5=$newleft = $newright
 oldobject=$methparm5
 forcereplace=$methparm5

!exit