# Variable calculations should be done in this file.
# It is read and interpreted by wims for all valid calls to the module.

!if $niv=4
  fcm1TF=!exec maxima ratsimp(ev($fcm,m=$c1)-($r1));
  !if $fcm1TF>=0
    mono=1
    vrep=1
    note=10
   !else
    mono=0
    vrep=0
    note=0
  !endif
!endif

!if $niv=5
  fcm1TF=!exec maxima ratsimp(ev($fcm,m=$c1)-($r1));\
   ratsimp(ev($fcm,m=$c1)-($r2));
  !distribute lines $fcm1TF into fcm1TF1,fcm1TF2
  
  !if $fcm1TF1>=0 and $fcm1TF2<0
    vrep=1
    mono=1
    note=10
  !endif
  
  !if $fcm1TF2>=0
    vrep=0
    mono=2
    note=0
  !endif
  
  !if $fcm1TF1<0
    vrep=0
    mono=0
    note=0
  !endif
!endif
  

module_score=$note
!read answer.phtml
status=done
!exit
