*set show 1
*echo
*use m,r
*if (r.eq.0) then
ERROR I read r as zero!
*stop
*endif
*let gright=m/r^2
*if (gright.eq.0) then
ERROR I read correct g as zero!
*stop
*endif
correct answer
*write gright web.2
number box
*use nb1,nb2,nbe1
!'+' is 43 in ascii
!see that twk does not easily handle character data--
!your only access is the first character of question-number
!variables which you can get from answer() and answer_()
*if (.not.((answer(1000).eq.43).or.(answer(1000).eq.45))) then
ERROR in number box +/- sign
*stop
*endif
*if (answer(1000).eq.43) then
*let gnb=(nb1+nb2/10)*10^nbe1
*let a=(nb1+(nb2-1)/10)*10^nbe1
*let b=(nb1+(nb2+1.01)/10)*10^nbe1
*if (window(gright).eq.1) then
your number box is correct!
*else
your number box is wrong!
*endif
*elseif (answer(1000).eq.45) then
*let gnb=(nb1+nb2/10)/10^nbe1
*let a=(nb1+(nb2-1)/10)/10^nbe1
*let b=(nb1+(nb2+1.01)/10)/10^nbe1
*if (window(gright).eq.1) then
your number box is correct!
*else
your number box is wrong!
*endif
*endif
g=
*write gnb web.2
select
*use g1
*if (abs(g1/gright-1).gt.0.001) then
your select is wrong!
*else
your select is right!
*endif
g=
*write g1 web.2
radio buttons
*use g2
*if (g2.eq.0) then
ERROR in radio buttons: nothing selected!
*stop
*endif
*if (abs(g2/gright-1).gt.0.001) then
your radio buttons are wrong!
*else
your radio buttons are right!
*endif
g=
*write g2 web.2
*show