'
' Created by SharpDevelop.
' User: Jano
' Date: 25.7.2017
' Time: 16:42
' trieda pre všetky testovania
' To change this template use Tools | Options | Coding | Edit Standard Headers.
'
Public Partial Class FNahTest
	Public t As Integer = 0 'cas v teste od nuly	
	Public ot As Integer = 1 'otazka na ktorej som je globalna
	Public nahTest As Short = 1 'nahodny test, ktory som prave vygeneroval je globalny
	Public celkBod As Short = 0 'celkovo bodov je globalne pre test
	Public nevedene As String = ""
	Public moodg As String = ""
	Public Sub New()
		' The Me.InitializeComponent call is required for Windows Forms designer support.
		Me.InitializeComponent()		
		'
		' TODO : Add constructor code after InitializeComponents
		'
	End Sub
	
	Public Sub New(mood As String) 'volam konstruktor podla moodu
		Me.InitializeComponent()
		timer1.Enabled=True
		timer1.Start()
		moodg=mood
		If mood = "nahtest" Then
			nahT()	
		End If
		If mood = "nevedenetest" Then
			nevT()	
		End If
		If mood = "zdravotnatest" Then
			ZdravT()	
		End If
		If mood = "zakonynahodne" Then
			ZakonyNahodneT()	
		End If
		
		If mood = "znackynahodne" Then
			ZnackyNahodneT()	
		End If
		
		If mood = "krizovatkynahodne" Then
			KrizovatkyNahodneT()	
		End If
		
		If mood = "zakonynevedel" Then
			ZakonyNevedelT()	
		End If
		
		If mood = "znackynevedel" Then
			ZnackyNevedelT()	
		End If
		
		If mood = "krizovatkynevedel" Then
			KrizovatkyNevedelT()	
		End If
		
	End Sub
	
	Public Sub vratOdpoved(klikol As String)
		
		If moodg="krizovatkynevedel" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
								
			End If
			
			If klikol = "B)" And o<>"b" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			If klikol = "C)" And o<>"c" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			
			If klikol = "B)" And o = "b" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "C)" And o = "c" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If ot = 28 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 4 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec krizovatky nevedel
		
		If moodg="krizovatkynahodne" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			If klikol = "B)" And o<>"b" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			If klikol = "C)" And o<>"c" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			
			If klikol = "B)" And o = "b" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "C)" And o = "c" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>23 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If ot = 28 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 4 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec krizovatky nahodne
		
		
		If moodg="znackynevedel" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			If klikol = "B)" And o<>"b" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			If klikol = "C)" And o<>"c" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
				
			End If
			
			
			If klikol = "B)" And o = "b" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "C)" And o = "c" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If ot = 24 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 8 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec znacky nevedel
		
		If moodg="znackynahodne" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				
			End If
			
			If klikol = "B)" And o<>"b" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
						
			End If
			
			If klikol = "C)" And o<>"c" And ot<24 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)	
				End If
							
			End If
			
			
			If klikol = "B)" And o = "b" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "C)" And o = "c" And ot<24 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>15 And ot<24 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If ot = 24 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 8 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec znacky nahodne
		
		If moodg="zakonynahodne" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			If klikol = "B)" And o<>"b" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			If klikol = "C)" And o<>"c" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			
			If klikol = "B)" And o = "b" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
								
			End If
			
			If klikol = "C)" And o = "c" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
								
			End If
			
			If ot = 16 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 15 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec zakony nahodne
		
		
		If moodg="zakonynevedel" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			If klikol = "B)" And o<>"b" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			If klikol = "C)" And o<>"c" And ot<16 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)				
				End If
								
			End If
			
			
			If klikol = "B)" And o = "b" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
								
			End If
			
			If klikol = "C)" And o = "c" And ot<16 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
								
			End If
			
			If ot = 16 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 15 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If 'koniec zakony nevedel
		
		
		If moodg = "nahtest" Or moodg="nevedenetest" Or moodg="zdravotnatest" Then
			Dim odp As New Module1
			Dim o As String = odp.citajOd(ot,nahTest)
			If klikol = "A)" And o = "a" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "A)" And o<>"a" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28  Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
							
			End If
			
			If klikol = "B)" And o<>"b" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
							
			End If
			
			If klikol = "C)" And o<>"c" And ot<28 Then
				nevedene += "t" & nahTest & "o" & ot & ","
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
							
			End If
			
			
			If klikol = "B)" And o = "b" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If klikol = "C)" And o = "c" And ot<28 Then
				celkBod = celkBod + 1
				ot += 1
				If ot<16 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				If ot>=16 And ot<28 Then
					PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t"& nahTest.ToString &"o"& ot.ToString &".jpg")
					PictureBox2.Load()
					richTextBox1.Text=odp.citajOt(ot,nahTest)
				End If
				
			End If
			
			If ot = 28 Then
				odp.pridajNevedene(nevedene,odp.readKtojeprihl) 'zapisem do suboru tie, ktore som nevedel
				odp.showMessage("End of the test. You have achieved from 27 questions these correct: " & celkBod)
				nevedene="" 'zmazem nevedene uz ich po teste netreba
				Me.Close
			End If
		End If
		
	End Sub
	
	Sub NahT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.GenRandomInt(1,35)
		ot = 1
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot<16 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub ZakonyNahodneT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.GenRandomInt(1,35)
		ot = 1
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot<16 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub ZakonyNevedelT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.zistiNajpocetnejsi(abc.citajNevedel(abc.readKtojeprihl).Split(New Char() {","c}))
		ot = 1
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot<16 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub ZnackyNevedelT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.zistiNajpocetnejsi(abc.citajNevedel(abc.readKtojeprihl).Split(New Char() {","c}))
		ot = 16
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot>15 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t" & nahTest & "o" & ot & ".jpg")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub ZnackyNahodneT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.GenRandomInt(1,35)
		ot = 16
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot>15 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t" & nahTest & "o" & ot & ".jpg")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub KrizovatkyNahodneT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.GenRandomInt(1,35)
		ot = 24
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot>23 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t" & nahTest & "o" & ot & ".jpg")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub KrizovatkyNevedelT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = abc.zistiNajpocetnejsi(abc.citajNevedel(abc.readKtojeprihl).Split(New Char() {","c}))
		ot = 24
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot>23 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/t" & nahTest & "o" & ot & ".jpg")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub ZdravT()
		Try
			Dim abc As New Module1
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu
		nahTest = 36
		ot = 1
		richTextBox1.Text = abc.citajOt(ot,nahTest)
		If ot<28 Then
			PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
        	PictureBox2.Load()
		End If
		Catch ex As Exception
			MsgBox(ex.Message)	
		End Try
	End Sub
	
	Sub nevT()
		'tu generujem nevedene otazky test
		Dim nevedene As String
		Dim nevedenep() As String
		Dim n As New Module1
		nevedene = n.citajNevedel(n.readKtojeprihl)		
		nevedenep=nevedene.Split(New Char() {","c})
		'MsgBox(nevedenep.Length) 'vrati n+1, lebo je aj za posledym ciarka, treba brat o 1 menej
		If nevedenep.Length < 28 Then
			MsgBox("You have not understood less than 27 questions for one test. Switching to random test.")
				NahT()
		Else
			'inak generujem test len z otazok, ktore nevedel
			'zistim najpocetnejsi test z otazok, ktore nevedel a ten spustim
			Dim modul As New Module1
			nahTest = modul.zistiNajpocetnejsi(nevedenep)
			celkBod = 0 'zacinam testovanie, tak si nastavim celkovo bodov na nulu		
			ot = 1
			richTextBox1.Text = modul.citajOt(ot,nahTest)
			If ot<16 Then
				PictureBox2.ImageLocation = (System.Windows.Forms.Application.StartupPath & "/data/znackyobr/nopicture.png")
	        	PictureBox2.Load()
			End If
			End If
		
	End Sub
	
	
	
	Sub FNahTestLoad(sender As Object, e As EventArgs)
				
	End Sub
	
	Sub Timer1Tick(sender As Object, e As EventArgs)
		t=t+1
		Label2.Text = t.ToString	& "s"
	End Sub
	
	Sub Label2Click(sender As Object, e As EventArgs)
		
	End Sub
	
	Sub Label3Click(sender As Object, e As EventArgs)
		Dim webAddress As String = "http://www.autoskola-free.szm.sk"
		Process.Start(webAddress)		
	End Sub
	
	Sub Button1Click(sender As Object, e As EventArgs)
		vratOdpoved("A)")		
	End Sub
	
	Sub Button2Click(sender As Object, e As EventArgs)
		vratOdpoved("B)")		
	End Sub
	
	Sub Button3Click(sender As Object, e As EventArgs)
		vratOdpoved("C)")		
	End Sub
	
	Sub Button4Click(sender As Object, e As EventArgs)
		'ukaz pravnu odpoved
		Dim odp As New Module1
		MsgBox("Correct answer for this question is " & odp.citajOd(ot, nahTest).ToString().ToUpper() & ")")
	End Sub
	
	Sub FNahTestFormClosing(sender As Object, e As FormClosingEventArgs)
		MainForm.okno = 0
	End Sub
End Class
