Valhalla Legends Forums Archive | General Programming | How programmers study for a multiple-choice final exam

AuthorMessageTime
Spht
Our final exam in strategic management is worth 60% of our final mark and consists entirely of multiple choice questions. our teacher gave us a booklet of 115 multiple choice questions to study, along with the answers

Sitting down and reading through all the questions seemed like a highly boring and inefficient way of studying, so instead i made a program to help me

I started by scanning the 25-page document in microsoft word with an OCR scanner.  i then was able to quickly create a database that contains the answer, along with the questions & choices, which looks like this:

[code]A
Research suggests that strategic management evolves through four sequential phases in organizations. The first phase is
A) basic financial planning.
B) forecast-based planning.
C) internally-oriented planning.
D) externally-oriented planning.
E) strategic management.

D
Under the phase of strategic management, strategic information is available to
A) operational personnel.
B) middle management.
C) the top management responsible for decision making.
D) people throughout the organization.
E) none of the above

B
Organizational performance can be indicated by:
A) lack of labor unions
B) outcomes, processes and capabilities.
C) dividends declared and paid.
D) assets, liabilities and equity.
E) an organization's size.[/code]

Next, I put together a quick VB application that consists of a text box containing the current question and choices, and 5 buttons to select the answer.  It will pull out a random question from the database and randomize the order the choices are listed in each time

[img]http://www.valhallalegends.com/spht/images/studysm.gif[/img]

[code]Option Explicit

Private Questions As Collection
Private Answers As New Collection
Private CurrentAnswer As String
Private CurrentAnswerEx As String
Private Streak As Long

Private Sub cmdAnswer_Click(Index As Integer)
    If CurrentAnswer = cmdAnswer(Index).Caption Then
        Streak = Streak + 1
        MsgBox "Good job!" & vbCrLf & vbCrLf & _
            "The answer was: " & CurrentAnswer & vbCrLf & _
            "Streak: " & Streak, vbInformation, "Correct!"
    Else
        Streak = 0
        MsgBox "The answer was: " & CurrentAnswer & CurrentAnswerEx, vbExclamation, "Incorrect!"
    End If
   
    GetNextQuestion
End Sub

Private Sub ReadQuestions()
    Dim FreeNum As Long
    Dim s As String
    Dim adds As String
   
    Set Questions = Nothing
    Set Questions = New Collection
   
    If Len(Dir(App.Path & "\smquestions.txt")) Then
        FreeNum = FreeFile
        Open App.Path & "\smquestions.txt" For Input As #FreeNum
            Do While Not EOF(FreeNum)
                Line Input #FreeNum, s
                If Len(s) = 0 Then
                    adds = Replace(adds, vbCrLf & "A)", vbCrLf & vbTab & "A)")
                    adds = Replace(adds, vbCrLf & "B)", vbCrLf & vbTab & "B)")
                    adds = Replace(adds, vbCrLf & "C)", vbCrLf & vbTab & "C)")
                    adds = Replace(adds, vbCrLf & "D)", vbCrLf & vbTab & "D)")
                    adds = Replace(adds, vbCrLf & "E)", vbCrLf & vbTab & "E)")
                    Questions.Add adds
                    adds = ""
                Else
                    adds = adds & s & vbCrLf
                End If
            Loop
        Close #FreeNum
    End If
End Sub

Private Sub GetNextQuestion()
    Dim NextQuestion As String
    Dim s
    Dim i As Long
    Dim n As Long
   
    NextQuestion = Questions.Item(Int((Questions.Count * Rnd) + 1))
    s = Split(NextQuestion, vbCrLf & vbTab)
    s(5) = Left(s(5), Len(s(5)) - 2) ' remove trailing vbCrLf
    For i = 1 To 5
        Answers.Add s(i)
    Next i
    For i = 1 To 5
        n = Int((Answers.Count * Rnd) + 1)
        s(i) = Answers.Item(n)
        If Left(s(i), 1) = Left(NextQuestion, 1) Then
            CurrentAnswer = cmdAnswer(i - 1).Caption
            CurrentAnswerEx = Mid(s(i), 2)
        End If
        Mid(s(i), 1, 1) = cmdAnswer(i - 1).Caption
        Answers.Remove n
    Next i
   
    txtQuestion.Text = Mid(NextQuestion, 4, InStr(NextQuestion, vbCrLf & vbTab) - 4) & vbCrLf & _
        vbTab & s(1) & vbCrLf & _
        vbTab & s(2) & vbCrLf & _
        vbTab & s(3) & vbCrLf & _
        vbTab & s(4) & vbCrLf & _
        vbTab & s(5) & vbCrLf
End Sub

Private Sub Form_Load()
    Randomize
    ReadQuestions
    GetNextQuestion
End Sub[/code]

Well, i must get back to studying now
December 4, 2007, 10:46 PM
Myndfyr
Turn that into your teacher.  Maybe (s)he'll give you full credit for the exam! :D
December 4, 2007, 10:55 PM
warz
i wish my exams still had questions that easy.
December 4, 2007, 10:57 PM
Barabajagal
Just a suggestion, but you really should make the answer choices random. Otherwise, your mind will most likely associate the questions with the letter value (A, B, C, D, or E) instead of the actual answer.
December 4, 2007, 11:38 PM
BreW
[quote author=MyndFyre[vL] link=topic=17207.msg175249#msg175249 date=1196808954]
Turn that into your teacher.  Maybe (s)he'll give you full credit for the exam! :D
[/quote]
I'm sure strategic management teachers will be in shock and awe when one of their students used VB6 to script a quick random multiple choice question-er. IMO what you should've done instead of scanning it, is typing them in. Typing a 25 page document isn't too impractical, and it'd help you actually remember the questions/answers.
December 5, 2007, 12:05 AM
Spht
[quote author=Andy link=topic=17207.msg175254#msg175254 date=1196811511]
Just a suggestion, but you really should make the answer choices random. Otherwise, your mind will most likely associate the questions with the letter value (A, B, C, D, or E) instead of the actual answer.
[/quote]

Yeah, i realized that, and it does do that. see getnextquestion()

[quote author=brew link=topic=17207.msg175256#msg175256 date=1196813116]
IMO what you should've done instead of scanning it, is typing them in. Typing a 25 page document isn't too impractical, and it'd help you actually remember the questions/answers.
[/quote]

I considered that, but i'm not the fastest nor accurate typer (especially if i have to study it while typing).  i figure i'd learn at a lot faster pace using the program in the time it would've taken to type it all up rather than scan it
December 5, 2007, 12:27 AM
dlStevens
Good job, I did the same thing back in 7th grade for the periodic table and the elements.
December 5, 2007, 1:59 AM

Search