none
Quiz RRS feed

  • Question

  • Okay so I am creating a small quiz on small basic, what do I type in the script if its a wrong answer, I have to correct answer, but I need to know how to script it so if its anything but the answer that it shows as incorrect, here is the script.

    If q1 = "Five" Or "five" Or "5" Then
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Green"
      TextWindow.WriteLine("Correct")
    EndIf

    After this I need have something like this

    If q1 = *then here I need to know what to put so if its anything but five it'll show up as incorrect* Then
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Red"
      TextWindow.WriteLine("Incorrect")
    EndIf


    Tuesday, June 3, 2014 9:30 PM

Answers

  • Hi KallanW and Welcome.

    2 points

    1] When doing an If with multiple choices (Or or And) you need each one to be a full test

    If q1 = "Five" Or "five" Or "5" Then

    should be

    If q1 = "Five" Or q1 = "five" Or q1 = "5" Then

    2] This is an excellent time to use an If Then Else EndIf

    If (q1 = "Five" Or q1 = "five" Or q1 = "5") Then
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Green"
      TextWindow.WriteLine("Correct")
    Else
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Red"
      TextWindow.WriteLine("Incorrect")
    EndIf 

    Tuesday, June 3, 2014 9:50 PM
    Moderator

All replies

  • Hi KallanW and Welcome.

    2 points

    1] When doing an If with multiple choices (Or or And) you need each one to be a full test

    If q1 = "Five" Or "five" Or "5" Then

    should be

    If q1 = "Five" Or q1 = "five" Or q1 = "5" Then

    2] This is an excellent time to use an If Then Else EndIf

    If (q1 = "Five" Or q1 = "five" Or q1 = "5") Then
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Green"
      TextWindow.WriteLine("Correct")
    Else
      TextWindow.BackgroundColor = "Yellow"
      TextWindow.ForegroundColor = "Red"
      TextWindow.WriteLine("Incorrect")
    EndIf 

    Tuesday, June 3, 2014 9:50 PM
    Moderator
  • Thanks

    Wednesday, June 4, 2014 4:00 PM