Tuesday, March 6, 2007

Code Changes

In our ★ journey (maybe a dream?) to make millions off of a program that will assist students in learning their words to prepare for the SAT, today we made some minor code change to the program. Firstly, we found out a way to display a message box that would show up if a wrong answer was chosen. If the correct one was chosen, then the player would be able to advance to the next problem.

But unfortunately, a problem that still exists is that at times, the program displays two options that have the same definition. Something hopefully that we'll be able to fix tomorrow.

To infinity, and beyond!
●○●○●○●○●○●○

Code Changes

2007 March 6th

I followed Mr. Phillip's instruction...
we are trying to make a COOL program to help hundreds of people in QMIS with the SAT vocab study.
Hope it would work someday...

It's a tough class..
we have to be smart, first of all.
Well, because we are smart enough, we are getting to the success line! :)


code changes

2007 March 6th

Today we worked on visual basics,
we tried to come up with a solution, matching words to the proper definition.
We upgraded our "Vocab Quiz Program, the Q3App1"
so that whenever the user selected a wrong answer,
a message box saying "wrong" would pop-up
and if the user selected the correct answer, and click"next" it would go on to the next question

code changes

Today,
we fixed the
vocabulary quiz program thing
in visual basics
to work in a right way
so the vocabularies would
match the definition.
If it matched, it would
pass to the next one
when we click the next button
and if the vocab. and def.
are mismatched, it would
give
a messagebox telling it is wrong
and not allowing it to go to the
nex stage
asdksldhsadasdr a

Code changes

Jacky Chen

I was trying to fix the problem of matching the words in the program with the definitions, and also uncheck the RadioButtons every time it changes to a new word. After that we went online and was tought how to post a post on a blog like this one.

Today's Code 14:46 2007-3-6

Public Class Form1
Private m_sAllRecords As String Private m_sCorrectDefinition As String Private m_sSelectCorrectDefinition As String Private m_aAllRecordsArray Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load m_sAllRecords = GetAllRecords() m_aAllRecordsArray = Split(m_sAllRecords, vbNewLine) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Static lIndex As Long Dim aFields
If m_sSelectCorrectDefinition <> m_sCorrectDefinition Then MsgBox("wrong") Exit Sub End If

If lIndex > UBound(m_aAllRecordsArray) Then lIndex = 0 End If

aFields = Split(GetRecord(lIndex), "") lIndex = lIndex + 1
If UBound(aFields) > 0 Then lblDef1.Text = aFields(0) m_sCorrectDefinition = aFields(1)
RadioButton1.Text = GetNewRandomDefinition() RadioButton2.Text = GetNewRandomDefinition() RadioButton3.Text = GetNewRandomDefinition() RadioButton4.Text = GetNewRandomDefinition() RadioButton5.Text = GetNewRandomDefinition()
WriteCorrectDefToRandomRadioButton()
RadioButton1.Checked = False RadioButton2.Checked = False RadioButton3.Checked = False RadioButton4.Checked = False RadioButton5.Checked = False

End If End Sub Private Sub WriteCorrectDefToRandomRadioButton() Dim i As Integer
i = CInt(GetRandomNumber(1, 5)) If Controls(i).Name Like "RadioButton*" Then Controls(i).Text = m_sCorrectDefinition Else WriteCorrectDefToRandomRadioButton() End If 'For i = 0 To Me.Controls.Count - 1 ' If Controls(i).Name Like "RadioButton*" Then ' Controls(i).Text = m_sCorrectDefinition ' End If
'Next End Sub Private Function GetNewRandomDefinition() As String Dim i As Integer Dim sRandomDefinition As String sRandomDefinition = "" sRandomDefinition = GetRandomDefinition() For i = 0 To Me.Controls.Count - 1 'Application.DoEvents() 'debug for duplicates If Controls(i).Name Like "RadioButton*" Then If sRandomDefinition = Me.Controls(i).Text Then GetNewRandomDefinition End If End If Next Return sRandomDefinition
End Function Private Function GetRandomDefinition() As String Dim lIndexDefinition As Long Dim aFields
lIndexDefinition = GetRandomNumber(LBound(m_aAllRecordsArray), UBound(m_aAllRecordsArray)) aFields = Split(GetRecord(lIndexDefinition), "") Return aFields(1) End Function Private Function GetRecord(ByVal lIndex As Long) As String If lIndex <= UBound(m_aAllRecordsArray) Then Return m_aAllRecordsArray(lIndex) Else Return "" End If End Function Private Function GetAllRecords() As String Return (System.IO.File.OpenText(Application.StartupPath & "\data1.txt").ReadToEnd) End Function
Private Function GetRandomNumber(ByVal lLowerBound As Long, ByVal lUpperBound As Long) As Long Dim RandomValue As Long
RandomValue = CInt(Int((lUpperBound - lLowerBound + 1) * Rnd() + lLowerBound))
Return RandomValue End Function
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged m_sSelectCorrectDefinition = RadioButton1.Text End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged m_sSelectCorrectDefinition = RadioButton2.Text End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged m_sSelectCorrectDefinition = RadioButton3.Text End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged m_sSelectCorrectDefinition = RadioButton4.Text End Sub
Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged m_sSelectCorrectDefinition = RadioButton5.Text End SubEnd Class

The Q3App1 Project

Application will be used to help people increase their vocabulary.
Future app use will be to help people learn new spoken and written languages.

Stage 1.
Write simple functional code.
Get vocab words from SAT word list.