Wednesday, August 26

Test maker + Test Watcher

Test Maker
_________________________________________________
Public Class testmaker

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer
Dim f As String
a = NumericUpDown1.Value
f = "D:\Exam\" & ComboBox1.Text & "\" & a & "\" & a & ".txt"
My.Computer.FileSystem.CopyFile("D:\Exam\1.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\" & a & ".txt", True)
My.Computer.FileSystem.CopyFile("D:\Exam\a.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\a.txt", True)
My.Computer.FileSystem.CopyFile("D:\Exam\b.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\b.txt", True)
My.Computer.FileSystem.CopyFile("D:\Exam\c.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\c.txt", True)
My.Computer.FileSystem.CopyFile("D:\Exam\d.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\d.txt", True)
My.Computer.FileSystem.CopyFile("D:\Exam\e.txt", "D:\Exam\" & ComboBox1.Text & "\" & a & "\e.txt", True)
'Deleting section
My.Computer.FileSystem.DeleteFile(f)
My.Computer.FileSystem.DeleteFile("D:\Exam\" & ComboBox1.Text & "\" & a & "\a.txt")
My.Computer.FileSystem.DeleteFile("D:\Exam\" & ComboBox1.Text & "\" & a & "\b.txt")
My.Computer.FileSystem.DeleteFile("D:\Exam\" & ComboBox1.Text & "\" & a & "\c.txt")
My.Computer.FileSystem.DeleteFile("D:\Exam\" & ComboBox1.Text & "\" & a & "\d.txt")
My.Computer.FileSystem.DeleteFile("D:\Exam\" & ComboBox1.Text & "\" & a & "\e.txt")

'Writing Section
My.Computer.FileSystem.WriteAllText(f, TextBox1.Text, True)
My.Computer.FileSystem.WriteAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\a.txt", TextBox2.Text, True)
My.Computer.FileSystem.WriteAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\b.txt", TextBox3.Text, True)
My.Computer.FileSystem.WriteAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\c.txt", TextBox4.Text, True)
My.Computer.FileSystem.WriteAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\d.txt", TextBox5.Text, True)
My.Computer.FileSystem.WriteAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\e.txt", TextBox6.Text, True)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
NumericUpDown1.Value = NumericUpDown1.Value + 1
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
NumericUpDown1.Value = NumericUpDown1.Value - 1
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
testwatcher.Show()
End Sub

Private Sub testmaker_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("atomic structure")
ComboBox1.Items.Add("solid state")
ComboBox1.Items.Add("thermodynamics")
ComboBox1.Items.Add("equilibrium")
ComboBox1.Items.Add("chemical bonding")
ComboBox1.Items.Add("p block")
ComboBox1.Items.Add("d block")
ComboBox1.Items.Add("s block")
ComboBox1.Items.Add("biomolecules")
ComboBox1.Items.Add("chemical kinetics")
ComboBox1.Items.Add("mole concept")
ComboBox1.Items.Add("hydrogen")
ComboBox1.Items.Add("chemistry in everyday life")
ComboBox1.Items.Add("hydrocarbon")
ComboBox1.Items.Add("states of matter")

End Sub
End Class
___________________________________________________________

TEST WATCHER
___________________________________________________________

Public Class testwatcher

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Me.Close()
End Sub
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
Me.WindowState = FormWindowState.Minimized
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If RadioButton1.Checked Then
If RadioButton1.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\e.txt") Then
TextBox3.Text += 1
Else
wa.Text += 1
End If
End If
If RadioButton2.Checked Then
If RadioButton2.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\e.txt") Then
TextBox3.Text += 1
Else
wa.Text += 1
End If
End If
If RadioButton3.Checked Then
If RadioButton3.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\e.txt") Then
TextBox3.Text += 1
Else
wa.Text += 1
End If
End If
If RadioButton4.Checked Then
If RadioButton4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\e.txt") Then
TextBox3.Text += 1
Else
wa.Text += 1
End If
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim a As Integer
Page.Text += 1
a = Page.Text
TextBox4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\" & a & ".txt")
GroupBox1.Text = a
RadioButton1.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\a.txt")
RadioButton2.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\b.txt")
RadioButton3.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\c.txt")
RadioButton4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\d.txt")
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

Dim a As Integer
Page.Text -= 1
a = Page.Text
GroupBox1.Text = a
TextBox4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\" & a & ".txt")
RadioButton1.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\a.txt")
RadioButton2.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\b.txt")
RadioButton3.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\c.txt")
RadioButton4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\" & a & "\d.txt")
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
TextBox4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\1.txt")
GroupBox1.Text = 1
RadioButton1.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\a.txt")
RadioButton2.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\b.txt")
RadioButton3.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\c.txt")
RadioButton4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\d.txt")
End Sub

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("atomic structure")
ComboBox1.Items.Add("solid state")
ComboBox1.Items.Add("thermodynamics")
ComboBox1.Items.Add("equilibrium")
ComboBox1.Items.Add("chemical bonding")
ComboBox1.Items.Add("p block")
ComboBox1.Items.Add("d block")
ComboBox1.Items.Add("s block")
ComboBox1.Items.Add("biomolecules")
ComboBox1.Items.Add("chemical kinetics")
ComboBox1.Items.Add("mole concept")
ComboBox1.Items.Add("hydrogen")
ComboBox1.Items.Add("chemistry in everyday life")
ComboBox1.Items.Add("hydrocarbon")
ComboBox1.Items.Add("states of matter")

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\1.txt")
GroupBox1.Text = 1
RadioButton1.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\a.txt")
RadioButton2.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\b.txt")
RadioButton3.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\c.txt")
RadioButton4.Text = My.Computer.FileSystem.ReadAllText("D:\Exam\" & ComboBox1.Text & "\1\d.txt")
End Sub
End Class

No comments: