J
Jason Potter
Beklow is acopy of my code that plays a sound and
advances to another slide when to select an answer
CheckBox.
However; I need it a tally the correct and the wrong
answers.
Is there any Help?
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Slide1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Private Sub CheckBox1_Click()
Dim temp As Variant
If CheckBox1.Value = True Then 'turns backcolor to
red'
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox1
.BackColor = &HFF&
End With
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox1.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox1
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox2_Click()
Dim temp As Variant
If CheckBox2.Value = True Then 'turns backcolor to
red'
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox2
.BackColor = &HFF&
End With
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox2.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox2
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox3_Click()
Dim temp As Variant
If CheckBox3.Value = True Then
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "You are Correct"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\RAIN.WAV", &H1)
With CheckBox3
.BackColor = &HFF00& 'turns backcolor to
green'
End With
pause = 2 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox3.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox3
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox4_Click()
Dim temp As Variant
If CheckBox4.Value = True Then 'turns backcolor to
red'
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox4
.BackColor = &HFF&
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End With
End If
If CheckBox4.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox4
.BackColor = &HFFFFFF
End With
End If
End Sub
'Private Sub CheckBox4_Click()
'
' If CheckBox4.Value = True Then
' value.
'End Sub
advances to another slide when to select an answer
CheckBox.
However; I need it a tally the correct and the wrong
answers.
Is there any Help?
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Slide1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Private Sub CheckBox1_Click()
Dim temp As Variant
If CheckBox1.Value = True Then 'turns backcolor to
red'
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox1
.BackColor = &HFF&
End With
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox1.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox1
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox2_Click()
Dim temp As Variant
If CheckBox2.Value = True Then 'turns backcolor to
red'
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox2
.BackColor = &HFF&
End With
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox2.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox2
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox3_Click()
Dim temp As Variant
If CheckBox3.Value = True Then
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox4
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "You are Correct"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\RAIN.WAV", &H1)
With CheckBox3
.BackColor = &HFF00& 'turns backcolor to
green'
End With
pause = 2 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End If
If CheckBox3.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox3
.BackColor = &HFFFFFF
End With
End If
End Sub
Private Sub CheckBox4_Click()
Dim temp As Variant
If CheckBox4.Value = True Then 'turns backcolor to
red'
With CheckBox1
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox2
.Value = False
.BackColor = &HFFFFFF
End With
With CheckBox3
.Value = False
.BackColor = &HFFFFFF
End With
MsgBox "This is the wrong Answer"
temp = sndPlaySound
("S:\Organizations\COMM\OPS\COQ\OPS\TRAINING\Admin\sounds
2\doh.wav", &H1)
With CheckBox4
.BackColor = &HFF&
pause = 1 'pause time in seconds
Start = Timer 'Timer is system timer,
counts seconds from midnight
Do While Timer < (Start + pause)
DoEvents ' Yield to other processes
while waiting
Loop
Application.SlideShowWindows(1).View.Next
End With
End If
If CheckBox4.Value = False Then 'keeps backcolor
white if not selected'
With CheckBox4
.BackColor = &HFFFFFF
End With
End If
End Sub
'Private Sub CheckBox4_Click()
'
' If CheckBox4.Value = True Then
' value.
'End Sub