locked
Multiple Choice Tests in Small Basic RRS feed

  • Question

  • I am brand new to Small Basic and would like to see some code in how to create a multiple choice test and evaluate the answer and textwindow.write correct or incorrect.
    Monday, October 8, 2012 11:56 AM

Answers

  • This code may help u a bit.

    TextWindow.BackgroundColor = "DarkBlue"
    TextWindow.Clear()
    TextWindow.ForegroundColor = "Magenta"
    TextWindow.WriteLine("Hello User!")
    
    TextWindow.WriteLine("Do you think that 2+2 = 4? (Yes or No)")
    answer = TextWindow.Read()
    If answer = "Yes" Then
      TextWindow.ForegroundColor = "Green"
      TextWindow.WriteLine("Correct")
      TextWindow.ForegroundColor = "Magenta"
    ElseIf answer = "No" Then
      TextWindow.ForegroundColor = "Red"
      TextWindow.WriteLine("Incorrect")
      TextWindow.ForegroundColor = "Magenta"
    EndIf



    Greetings Timo


    Monday, October 8, 2012 12:36 PM