%Declare GUI
import GUI
%Opening Page Graphics
drawfillbox (0, 0, 639, 399, blue)
drawfillbox (10, 10, 629, 389, white)
Pic.ScreenLoad ("math.bmp", 325, 40, picCopy)
var font1, font2 : int
font1 := Font.New ("serif:60:italic")
assert font1 > 0
font2 := Font.New ("serif:30:italic")
assert font2 > 0
Font.Draw ("Quiz", 30, 250, font1, red)
Font.Draw ("Time!!!", 50, 170, font1, red)
delay (2000)
cls
%Quiz question 1.
drawfillbox (0, 0, 639, 399, blue)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("What's the method", 20, 320, font2, green)
Font.Draw ("used for multiplying", 20, 280, font2, green)
Font.Draw ("binomials?", 20, 240, font2, green)
Pic.ScreenLoad ("question.bmp", 340, 20, picCopy)
%Create procedures for question 1.
procedure right1
cls
drawfillbox (0, 0, 639, 399, blue)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("You're Right!!!", 65, 200, font1, blue)
end right1
procedure question1Choice1
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("Wrong!", 165, 200, font1, red)
Music.PlayFile ("buzz.wav")
end question1Choice1
procedure question1Choice2
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("Nope!", 165, 200, font1, red)
Music.PlayFile ("buzz.wav")
end question1Choice2
procedure question1Choice3
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("NOOOOOOOOOOO!", 65, 200, font1, red)
end question1Choice3
%Buttons for question 1 along with their parameters.
var question1Button1 : int := GUI.CreateButton (30, 50, 20, "BOIL", question1Choice1)
var question1Button2 : int := GUI.CreateButton (30, 70, 20, "FOIL", right1)
var question1Button3 : int := GUI.CreateButton (30, 90, 20, "BOOM", question1Choice2)
var question1Button4 : int := GUI.CreateButton (30, 110, 20, "SOIL", question1Choice3)
loop
exit when GUI.ProcessEvent
end loop
GUI.Dispose (question1Button1)
GUI.Dispose (question1Button2)
GUI.Dispose (question1Button3)
GUI.Dispose (question1Button4)
%Quiz question 2.
drawfillbox (0, 0, 639, 399, blue)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("What is a polynomial", 20, 320, font2, green)
Font.Draw ("with only one term?", 20, 285, font2, green)
%Create procedures for question 2.
procedure right2
cls
drawfillbox (0, 0, 639, 399, blue)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("Nice!", 65, 200, font1, blue)
end right2
procedure question2Choice1
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("Keep trying!", 165, 200, font1, red)
Music.PlayFile ("buzz.wav")
end question2Choice1
procedure question2Choice2
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("Nope!", 165, 200, font1, red)
Music.PlayFile ("buzz.wav")
end question2Choice2
procedure question2Choice3
cls
drawfillbox (0, 0, 639, 399, red)
drawfillbox (10, 10, 629, 389, white)
Font.Draw ("NOOOOOOOOOOO!", 65, 200, font1, red)
Music.PlayFile ("buzz.wav")
end question2Choice3
%Buttons for question 2 along with their parameters.
var question2Button1 : int := GUI.CreateButton (30, 50, 20, "Trinomial", question2Choice1)
var question2Button2 : int := GUI.CreateButton (30, 70, 20, "Constant", question2Choice2)
var question2Button3 : int := GUI.CreateButton (30, 90, 20, "Monomial", right2)
var question2Button4 : int := GUI.CreateButton (30, 110, 20, "Binomial", question2Choice3)
|