Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am looking for help with a Visual Basic project. I am trying to create a proje

ID: 3821855 • Letter: I

Question

I am looking for help with a Visual Basic project. I am trying to create a project that reads text files and then creates a text box and displays the contents of those text files in the created textbox. I have provided a picture that shows how the form will look originally. There are four radio buttons for what type of test you are trying to create(Multiple Choice, True/False, Fill in the Blank, and Short Answers). Depending on what test option is selecting, pressing the "Create Test" button will have the program read a text file that contains a question type and then reads and displays that question in a textbox that is created. The four .txt files that this is reading from are

FIB.txt(contents of file are as follows):

Moon is a _________________ and Earth is a _____________.

Satellite

Planet

MC.txt(contents are as follows):

Which of the following are continents?

5

2

Asia

Europe

Japan

Canada

China

SA.txt:

Describe what makes Earth a perfect planet to harbor life?

TF.txt

Asia and Europe are continents?

True

Question Format Multiple Choice e Fals O Fill in the Blank Short Answer

Explanation / Answer

Private Sub create_Click()

Dim intMsg As String
Dim StudentName   As String

Open "c:My Documentssample.txt" For Output As #1
intMsg = MsgBox("File sample.txt opened")
StudentName = InputBox("Enter the student Name")
Print #1, StudentName
intMsg = MsgBox("Writing a" & StudentName & " to sample.txt ")

Close #1

intMsg = MsgBox("File sample.txt closed")

End Sub
Reading file:
Private Sub Reading_Click()

Dim variable1 As String
Open "c:My Documentssample.txt" For Input As #1
Input #1, variable1
Text1.Text = variable1
Close #1

End Sub
Dim linetext As String
Private Sub open_Click()

CommonDialog1.Filter = "Text files{*.txt)|*.txt"
CommonDialog1.ShowOpen

If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Input As #1
Do
Input #1, linetext
Text1.Text = Text1.Text & linetext
Loop Until EOF(1)
End If
Close #1

End Sub

Private Sub save_Click()

CommonDialog1.Filter = "Text files{*.txt)|*.txt"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As #1
Print #1, Text1.Text
Close #1
End If

End Sub