vendredi 18 mars 2016

Performing calculations with random numbers

I am trying to make a maths practice powerpoint where students are presented with random addition problems using numbers 1 – 20. I have been working through tutorials by David Marcovtiz and was using his code as a starting point. As my audience is young students, I would like the maths problems to not be in a message box but in something like text boxes or shapes that I can customise and make large and visually appealing for young students. I have managed to produce the random numbers in shapes (but not the input answer) and I have sourced other code to input an answer into an activex text box but can’t ‘make them talk to each other.’

I have done many searches on this but can't find, or tweak (with my limited but growing knowledge) what I need. Some great info on this site already about random numbers but still over my head I'm afraid.

I feel this is something that other educators could use and am happy to post my finished show if someone is willing and able to assist with the coding. I really appreciate the tolerance and patience of contributors shown to people like myself who have jumped in head first, excited and giving it a go but struggling.

So, what I'm wanting to do... In a powerpoint show 1. Student can click a ‘get started’ button that takes them to next slide

  1. Next slide automatically generates 2 random numbers that student must add together.

  2. Student enters the answer

  3. If answer is correct – I would like something to signify the answer was correct but not something they have to click on to close. Ideally, a little star flashes in the corner then disappears

  4. If the answer is incorrect, a message or picture flashes then disappears.

  5. A new addition problem is automatically/randomly generated I would like to set the number of addition problems to e.g. 20, then have the slide move to a scoring slide that shows their score.

Not sure if it’s possible but for young students, I would like the score to be represented by pictures e.g. you gathered 17 stars (and have 17 stars show) (I’m assuming I can easily change the operation from addition to multiplication – not sure how it would work for subtraction and division – maybe best for another time when I am more skilled)

David's original code that started me on this journey:

Sub GetStarted()
Initialize
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Initialize()
Randomize
End Sub


Sub RandomQuestion()
Dim first As Integer
Dim second As Integer
first = Int(10 * Rnd)
second = Int(10 * Rnd)
answer = InputBox("What is " & first & " + " & second & "?")
If answer = first + second Then
DoingWell
Else
DoingPoorly
End If
End Sub
Sub DoingWell()
MsgBox ("Good job")
End Sub
Sub DoingPoorly()




Aucun commentaire:

Enregistrer un commentaire