mirror of
https://github.com/TheUltimateHacker/shiftos-next.git
synced 2025-01-22 09:02:00 -05:00
Fix math quiz
Not tested
This commit is contained in:
parent
57e6eec1bc
commit
5dd935e56b
1 changed files with 11 additions and 28 deletions
|
@ -5,41 +5,24 @@
|
||||||
|
|
||||||
Public Sub MQInterpret(question As String, answer As Integer)
|
Public Sub MQInterpret(question As String, answer As Integer)
|
||||||
Dim random As New Random()
|
Dim random As New Random()
|
||||||
|
Private correct As Boolean = False
|
||||||
Dim args() As String = question.Replace("What is ", "").Split(" ")
|
Dim args() As String = question.Replace("What is ", "").Split(" ")
|
||||||
Select Case args(1)
|
Select Case args(1)
|
||||||
Case "+"
|
Case "+"
|
||||||
If answer = args(0) + args(2) Then
|
correct = (answer = CInt(args(0)) + CInt(args(2)))
|
||||||
Dim cptoadd As Integer = random.Next(1, 5)
|
|
||||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
|
||||||
AddCP(cptoadd)
|
|
||||||
Else
|
|
||||||
AddLine("Incorrect! Better luck next time...")
|
|
||||||
End If
|
|
||||||
Case "-"
|
Case "-"
|
||||||
If answer = args(0) - args(2) Then
|
correct = (answer = args(0) - args(2))
|
||||||
Dim cptoadd As Integer = random.Next(1, 5)
|
|
||||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
|
||||||
AddCP(cptoadd)
|
|
||||||
Else
|
|
||||||
AddLine("Incorrect! Better luck next time...")
|
|
||||||
End If
|
|
||||||
Case "*"
|
Case "*"
|
||||||
If answer = args(0) * args(2) Then
|
correct = (answer = args(0) * args(2))
|
||||||
Dim cptoadd As Integer = random.Next(1, 5)
|
|
||||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
|
||||||
AddCP(cptoadd)
|
|
||||||
Else
|
|
||||||
AddLine("Incorrect! Better luck next time...")
|
|
||||||
End If
|
|
||||||
Case "/"
|
Case "/"
|
||||||
If answer = args(0) / args(2) Then
|
correct = (answer = args(0) / args(2))
|
||||||
Dim cptoadd As Integer = random.Next(1, 5)
|
|
||||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
|
||||||
AddCP(cptoadd)
|
|
||||||
Else
|
|
||||||
AddLine("Incorrect! Better luck next time...")
|
|
||||||
End If
|
|
||||||
End Select
|
End Select
|
||||||
|
If (correct) Then
|
||||||
|
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
||||||
|
AddCP(cptoadd)
|
||||||
|
Else
|
||||||
|
AddLine("Incorrect! Better luck next time...")
|
||||||
|
End If
|
||||||
MQCreateQuestion()
|
MQCreateQuestion()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue