P
Preschool Mike
I thought I had it all worked out, but I was wrong. I'm having trouble with
my keeping score. As I said the student has to arrange 3 shapes (stars) in
the order of largest to smallest. If they do so correctly I only want it to
score it a 1 correct (e.g., question/problem 1). Presently it scores it as 3
correct. Wasn't sure if I needed to change my RightAnswer procedure or
something in the MoveStarsTo procedure, which I've tried with no luck.
Here the code I'm using:
Dim MyAnswers As Shape
Dim numCorrect As Integer
Dim numIncorrect As Integer
Sub Initialize()
MoveStarsHome
numCorrect = 0
numIncorrect = 0
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub MoveShape(theShape As Shape)
theShape.Fill.ForeColor.RGB = vbBlue
Set MyAnswers = theShape
End Sub
Sub MoveStarsTo(theAnswerBox As Shape)
MyAnswers.Fill.ForeColor.RGB = vbYellow
MyAnswers.Top = theAnswerBox.Top + 15
MyAnswers.Left = theAnswerBox.Left + 15
If MyAnswers.Name = "LargeStar" And theAnswerBox.Name = "LargeStarBox" Then
RightAnswer
ElseIf MyAnswers.Name = "MediumStar" And theAnswerBox.Name = "MediumStarBox"
Then
RightAnswer
ElseIf MyAnswers.Name = "SmallStar" And theAnswerBox.Name = "SmallStarBox"
Then
RightAnswer
Else
WrongAnswer
End If
End Sub
Sub RightAnswer()
numCorrect = numCorrect + 1
End Sub
Sub WrongAnswer()
numIncorrect = numIncorrect + 1
End Sub
Sub MoveStarsHome()
ActivePresentation.Slides(2).Shapes("LargeStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("LargeStar").Top = 50
ActivePresentation.Slides(2).Shapes("LargeStar").Left = 320
ActivePresentation.Slides(2).Shapes("MediumStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("MediumStar").Top = 75
ActivePresentation.Slides(2).Shapes("MediumStar").Left = 150
ActivePresentation.Slides(2).Shapes("SmallStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("SmallStar").Top = 90
ActivePresentation.Slides(2).Shapes("SmallStar").Left = 500
End Sub
Sub CheckAnswer()
MsgBox ("You got " & numCorrect & " correct")
End Sub
Thanks,
Mike
my keeping score. As I said the student has to arrange 3 shapes (stars) in
the order of largest to smallest. If they do so correctly I only want it to
score it a 1 correct (e.g., question/problem 1). Presently it scores it as 3
correct. Wasn't sure if I needed to change my RightAnswer procedure or
something in the MoveStarsTo procedure, which I've tried with no luck.
Here the code I'm using:
Dim MyAnswers As Shape
Dim numCorrect As Integer
Dim numIncorrect As Integer
Sub Initialize()
MoveStarsHome
numCorrect = 0
numIncorrect = 0
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub MoveShape(theShape As Shape)
theShape.Fill.ForeColor.RGB = vbBlue
Set MyAnswers = theShape
End Sub
Sub MoveStarsTo(theAnswerBox As Shape)
MyAnswers.Fill.ForeColor.RGB = vbYellow
MyAnswers.Top = theAnswerBox.Top + 15
MyAnswers.Left = theAnswerBox.Left + 15
If MyAnswers.Name = "LargeStar" And theAnswerBox.Name = "LargeStarBox" Then
RightAnswer
ElseIf MyAnswers.Name = "MediumStar" And theAnswerBox.Name = "MediumStarBox"
Then
RightAnswer
ElseIf MyAnswers.Name = "SmallStar" And theAnswerBox.Name = "SmallStarBox"
Then
RightAnswer
Else
WrongAnswer
End If
End Sub
Sub RightAnswer()
numCorrect = numCorrect + 1
End Sub
Sub WrongAnswer()
numIncorrect = numIncorrect + 1
End Sub
Sub MoveStarsHome()
ActivePresentation.Slides(2).Shapes("LargeStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("LargeStar").Top = 50
ActivePresentation.Slides(2).Shapes("LargeStar").Left = 320
ActivePresentation.Slides(2).Shapes("MediumStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("MediumStar").Top = 75
ActivePresentation.Slides(2).Shapes("MediumStar").Left = 150
ActivePresentation.Slides(2).Shapes("SmallStar").Fill.ForeColor.RGB =
vbYellow
ActivePresentation.Slides(2).Shapes("SmallStar").Top = 90
ActivePresentation.Slides(2).Shapes("SmallStar").Left = 500
End Sub
Sub CheckAnswer()
MsgBox ("You got " & numCorrect & " correct")
End Sub
Thanks,
Mike