The Test Taker Code
Module1 Code
'Variable Declarations
Public A As Integer
Public B As Integer
Public X As Integer
Public Y As Integer
'End of Declarations
Sub Main()
Form1.Show
Form3.Option4.Value = True
X = 20
Form3.Label3.Caption = 20
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = True
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Text9.Visible = True
Form2.Text10.Visible = True
Form2.Text11.Visible = True
Form2.Text12.Visible = True
Form2.Text13.Visible = True
Form2.Text14.Visible = True
Form2.Text15.Visible = True
Form2.Text16.Visible = True
Form2.Text17.Visible = True
Form2.Text18.Visible = True
Form2.Text19.Visible = True
Form2.Text20.Visible = True
Form3.Option7.Value = True
Y = 4
Form3.Label4.Caption = 4
Form4.Text1.Text = 51
Form4.Text2.Text = 75
A = 51
B = 75
Form4.Label7.Caption = 51
Form4.Label8.Caption = 75
End Sub
Form1 Code
Private Sub Command1_Click()
Form2.Show
Form1.Hide
End Sub
Private Sub Command2_Click()
End
End Sub
Form2 Code
Private Sub Command1_Click()
Form3.Show
End Sub
Private Sub Command2_Click()
Form4.Show
End Sub
Private Sub Command4_Click()
Form3.Option4.Value = True
X = 20
Form3.Label3.Caption = 20
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = True
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Text9.Visible = True
Form2.Text10.Visible = True
Form2.Text11.Visible = True
Form2.Text12.Visible = True
Form2.Text13.Visible = True
Form2.Text14.Visible = True
Form2.Text15.Visible = True
Form2.Text16.Visible = True
Form2.Text17.Visible = True
Form2.Text18.Visible = True
Form2.Text19.Visible = True
Form2.Text20.Visible = True
Form3.Option7.Value = True
Y = 4
Form3.Label4.Caption = 4
Form4.Text1.Text = 51
Form4.Text2.Text = 75
A = 51
B = 75
Form4.Label7.Caption = 51
Form4.Label8.Caption = 75
End Sub
Private Sub Command7_Click()
Randomize
Dim N As Long
N = Text29.Text
Dim P As Single
Dim G As Single
P = A * X / 100
G = B * X / 100
Text21.Text = 0
Text22.Text = 0
Text23.Text = 0
Text24.Text = 0
For T = 1 To N
For Q = 1 To X
R = Int((Rnd * Y) + 1)
If R = 1 Then Text21.Text = Text21.Text + 1
If R > 1 Then Text22.Text = Text22.Text + 1
Next Q
Text23.Text = Text21.Text
Text24.Text = Text23.Text / X * 100
If Text23.Text >= P Then
Text25.Text = Text25.Text + 1
ElseIf Text23.Text < P Then
Text26.Text = Text26.Text + 1
End If
If Text23.Text >= G Then
Text27.Text = Text27.Text + 1
ElseIf Text23.Text < G Then
Text28.Text = Text28.Text + 1
End If
If Text23.Text = 0 Then
Text0.Text = Text0.Text + 1
ElseIf Text23.Text = 1 Then
Text1.Text = Text1.Text + 1
ElseIf Text23.Text = 2 Then
Text2.Text = Text2.Text + 1
ElseIf Text23.Text = 3 Then
Text3.Text = Text3.Text + 1
ElseIf Text23.Text = 4 Then
Text4.Text = Text4.Text + 1
ElseIf Text23.Text = 5 Then
Text5.Text = Text5.Text + 1
ElseIf Text23.Text = 6 Then
Text6.Text = Text6.Text + 1
ElseIf Text23.Text = 7 Then
Text7.Text = Text7.Text + 1
ElseIf Text23.Text = 8 Then
Text8.Text = Text8.Text + 1
ElseIf Text23.Text = 9 Then
Text9.Text = Text9.Text + 1
ElseIf Text23.Text = 10 Then
Text10.Text = Text10.Text + 1
ElseIf Text23.Text = 11 Then
Text11.Text = Text11.Text + 1
ElseIf Text23.Text = 12 Then
Text12.Text = Text12.Text + 1
ElseIf Text23.Text = 13 Then
Text13.Text = Text13.Text + 1
ElseIf Text23.Text = 14 Then
Text14.Text = Text14.Text + 1
ElseIf Text23.Text = 15 Then
Text15.Text = Text15.Text + 1
ElseIf Text23.Text = 16 Then
Text16.Text = Text16.Text + 1
ElseIf Text23.Text = 17 Then
Text17.Text = Text17.Text + 1
ElseIf Text23.Text = 18 Then
Text18.Text = Text18.Text + 1
ElseIf Text23.Text = 19 Then
Text19.Text = Text19.Text + 1
ElseIf Text23.Text = 20 Then
Text20.Text = Text20.Text + 1
End If
If Val(T) > Val(N) Then
Text21.Text = 0
Text22.Text = 0
Text23.Text = 0
Text24.Text = 0
End If
Next T
End Sub
Private Sub Command8_Click()
End
End Sub
Private Sub Command9_Click()
Form2.Hide
Form1.Show
End Sub
Private Sub Command5_Click()
Text0.Text = 0
Text1.Text = 0
Text2.Text = 0
Text3.Text = 0
Text4.Text = 0
Text5.Text = 0
Text6.Text = 0
Text7.Text = 0
Text8.Text = 0
Text9.Text = 0
Text10.Text = 0
Text11.Text = 0
Text12.Text = 0
Text13.Text = 0
Text14.Text = 0
Text15.Text = 0
Text16.Text = 0
Text17.Text = 0
Text18.Text = 0
Text19.Text = 0
Text20.Text = 0
Text21.Text = 0
Text22.Text = 0
Text23.Text = 0
Text24.Text = 0
Text25.Text = 0
Text26.Text = 0
Text27.Text = 0
Text28.Text = 0
End Sub
Private Sub Command6_Click()
Text29.Text = 0
End Sub
Private Sub Text29_Change()
10 If Text29.Text = "" Then Text29.Text = 0
20 If Text29.Text < 0 Or Text29.Text > 1000000 Then Text29.Text = 0
End Sub
Private Sub Text29_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii > 8 Then
KeyAscii = 0
End If
End Sub
Form3 Code
Private Sub Command1_Click()
If Option1.Value = True Then
X = 5
Label3.Caption = 5
End If
If Option2.Value = True Then
X = 10
Label3.Caption = 10
End If
If Option3.Value = True Then
X = 15
Label3.Caption = 15
End If
If Option4.Value = True Then
X = 20
Label3.Caption = 20
End If
If Option5.Value = True Then
Y = 2
Label4.Caption = 2
End If
If Option6.Value = True Then
Y = 3
Label4.Caption = 3
End If
If Option7.Value = True Then
Y = 4
Label4.Caption = 4
End If
If Option8.Value = True Then
Y = 5
Label4.Caption = 5
End If
If X = 5 Then
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = False
Form2.Text7.Visible = False
Form2.Text8.Visible = False
Form2.Text9.Visible = False
Form2.Text10.Visible = False
Form2.Text11.Visible = False
Form2.Text12.Visible = False
Form2.Text13.Visible = False
Form2.Text14.Visible = False
Form2.Text15.Visible = False
Form2.Text16.Visible = False
Form2.Text17.Visible = False
Form2.Text18.Visible = False
Form2.Text19.Visible = False
Form2.Text20.Visible = False
End If
If X = 10 Then
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = True
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Text9.Visible = True
Form2.Text10.Visible = True
Form2.Text11.Visible = False
Form2.Text12.Visible = False
Form2.Text13.Visible = False
Form2.Text14.Visible = False
Form2.Text15.Visible = False
Form2.Text16.Visible = False
Form2.Text17.Visible = False
Form2.Text18.Visible = False
Form2.Text19.Visible = False
Form2.Text20.Visible = False
End If
If X = 15 Then
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = True
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Text9.Visible = True
Form2.Text10.Visible = True
Form2.Text11.Visible = True
Form2.Text12.Visible = True
Form2.Text13.Visible = True
Form2.Text14.Visible = True
Form2.Text15.Visible = True
Form2.Text16.Visible = False
Form2.Text17.Visible = False
Form2.Text18.Visible = False
Form2.Text19.Visible = False
Form2.Text20.Visible = False
End If
If X = 20 Then
Form2.Text0.Visible = True
Form2.Text1.Visible = True
Form2.Text2.Visible = True
Form2.Text3.Visible = True
Form2.Text4.Visible = True
Form2.Text5.Visible = True
Form2.Text6.Visible = True
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Text9.Visible = True
Form2.Text10.Visible = True
Form2.Text11.Visible = True
Form2.Text12.Visible = True
Form2.Text13.Visible = True
Form2.Text14.Visible = True
Form2.Text15.Visible = True
Form2.Text16.Visible = True
Form2.Text17.Visible = True
Form2.Text18.Visible = True
Form2.Text19.Visible = True
Form2.Text20.Visible = True
End If
Form3.Hide
Form2.Show
End Sub
Private Sub Command2_Click()
If Label3.Caption = "" Then GoTo 100
If Label3.Caption = 5 Then Option1.Value = True
If Label3.Caption = 10 Then Option2.Value = True
If Label3.Caption = 15 Then Option3.Value = True
If Label3.Caption = 20 Then Option4.Value = True
If Label4.Caption = "" Then GoTo 100
If Label4.Caption = 2 Then Option5.Value = True
If Label4.Caption = 3 Then Option6.Value = True
If Label4.Caption = 4 Then Option7.Value = True
If Label4.Caption = 5 Then Option8.Value = True
100 Form3.Hide
110 Form2.Show
End Sub
Form4 Code
Private Sub Command1_Click()
A = Text1.Text
B = Text2.Text
Label7.Caption = Text1.Text
Label8.Caption = Text2.Text
Form4.Hide
Form2.Show
End Sub
Private Sub Command2_Click()
Text1.Text = Label7.Caption
Text2.Text = Label8.Caption
Form4.Hide
Form2.Show
End Sub
Private Sub Text1_Change()
If Text1.Text = "" Then Text1.Text = 51
If Text1.Text < 0 Or Text1.Text > 100 Then Text1.Text = 51
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii > 8 Then
KeyAscii = 0
End If
End Sub
Private Sub Text2_Change()
If Text2.Text = "" Then Text2.Text = 75
If Text2.Text < 0 Or Text2.Text > 100 Then Text2.Text = 75
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii > 8 Then
KeyAscii = 0
End If
End Sub