Upcoming SlideShare
×

Documentation for a Visual Basic Mathematics Program

1,618 views

Published on

Documentation for a Mathematics Program written in Visual Basic for the AQA A2 Computing course.

Published in: Technology, News & Politics
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
1,618
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
81
0
Likes
1
Embeds 0
No embeds

No notes for slide

Documentation for a Visual Basic Mathematics Program

1. 1. June 2012 RACHEL MCGREEVY MATHEMATICS TESTING PROGRAM
2. 2. 2 Contents Analysis...................................................................................................................... 8 Background to and identification of problem...........................................................8 Analysis of current system......................................................................................9 Identification of the prospective user(s) ................................................................18 Identification of user needs and acceptable limitations.........................................19 initial user requirements........................................................................................22 Data dictionary (from perspective of end user)......................................................23 Data source(s) and destination(s).........................................................................25 Data flow diagrams (DFDs)...................................................................................26 Volumetrics........................................................................................................... 28 Realistic appraisal of the feasibility of potential solutions......................................28 Justification of chosen solution .............................................................................29 Obviously a bespoke solution is the best option for my program, as it can be made exactly to the needs of the user and their specifications, without unnecessary addons. Creating the program myself, means it will be an original piece of work and so will be unlike any other program that already exists. A self-created piece of software means that it can be updated and re-worked if the user feels that it does not fulfil all of the requirements or have found problems or other improvements that can be made to the system. Creating the program directly from the user’s specification means that the program will run in the most efficient way for them. I have decided to create a program using a Visual Basic front end, with file handling to store data. This is the simplest solution, and although the amount of information the program will need to store is large, it does not require any extra software installed. This solution also does not require any complex front end programming, due to the front end creation tool of Visual Basic. Using the Visual Basic front end creation tool will provide the most user-friendly and effective front end, and therefore is the most efficient solution as I am able to tailor it to the needs of the user....................................................................................................................... 29 Prototype ............................................................................................................. 30 Final user requirements........................................................................................40 Design...................................................................................................................... 42 Overall system design ..........................................................................................42 Description of modular structure of system ..........................................................42 Data dictionary......................................................................................................44 Description of record structure .............................................................................49 Validation required ...............................................................................................50 Identification of processes & suitable algorithms for data transformation..............54 User interface design (HCI) rationale ...................................................................58 Sample of planned data capture and entry designs .............................................60 Sample of planned valid output designs ...............................................................61 Description of measures planned for security and integrity of data.......................63 Description of measures planned for system security...........................................63 Overall test strategy .............................................................................................64 Implementation......................................................................................................... 65 Program listing & Screen shots of working program..............................................65 New Student User...................................................................................................101 New Teacher User..................................................................................................102 Admin Login Page..................................................................................................104 Admin Homepage...................................................................................................105 Edit Student User....................................................................................................109 Search Teacher User..............................................................................................111 Edit Teacher User...................................................................................................113 Global Variables.....................................................................................................115
3. 3. 3 Public Functions.....................................................................................................115 Structures Module...................................................................................................118 Test Data............................................................................................................ 120 Test Plan............................................................................................................. 122 Hard copy evidence............................................................................................129 1.1 ........................................................................................................................ 129 1.5.......................................................................................................................... 129 2.1.......................................................................................................................... 130 4.1.......................................................................................................................... 130 5.1.......................................................................................................................... 131 5.2.......................................................................................................................... 131 6.5, 6.3 .................................................................................................................. 131 6.4.......................................................................................................................... 132 7.1.......................................................................................................................... 132 9............................................................................................................................. 132 17.1........................................................................................................................ 133 18 .......................................................................................................................... 133 19.5........................................................................................................................ 134 20.1........................................................................................................................ 134 22.4........................................................................................................................ 134 23........................................................................................................................... 136 25.1........................................................................................................................ 136 25.4........................................................................................................................ 136 25.5........................................................................................................................ 137 26.2........................................................................................................................ 137 27.1........................................................................................................................ 137 .............................................................................................................................. 137 28.4........................................................................................................................ 138 29.2........................................................................................................................ 138 30.3, 31.3................................................................................................................ 138 32.1........................................................................................................................ 139 32.2........................................................................................................................ 139 33.1........................................................................................................................ 139 34.3........................................................................................................................ 140 36.1........................................................................................................................ 140 37.3........................................................................................................................ 140 39.1........................................................................................................................ 141 42.3........................................................................................................................ 141 ............................................................................................................................. 141 Code Amendment...................................................................................................142 End If.............................................................................................................. 142 Revised Code;........................................................................................................142 Test 5.1 Original Code;.........................................................................................................142 Revised Code;........................................................................................................142 Revised Code;........................................................................................................143 End If.............................................................................................................. 143 Revised Code;........................................................................................................143 Test 23 Original Code;.........................................................................................................144 Revised Code;........................................................................................................144
5. 5. 5 Public Sub FindStudentUser...................................................................................148 Location.................................................................................................................. 148 Page 103................................................................................................................ 148 Input Parameters....................................................................................................148 Byval Username As String......................................................................................148 Output Parameters.................................................................................................148 -.............................................................................................................................. 148 Local Variables.......................................................................................................148 Student as StudentRecord......................................................................................148 Description.............................................................................................................. 148 Finds the student user from the student file by matching the username the user entered whilst logging in, to the saved usernames in each of the individual student records in the student file. Once the username has found a match, the global variable RecordLocation will then be changed to equal the location number of this student record..................................................................................................................... 148 Name...................................................................................................................... 148 Public Sub FindTeacherUser..................................................................................148 Location.................................................................................................................. 148 Page 103................................................................................................................ 148 Input Parameters....................................................................................................148 Byval Username As String......................................................................................148 Output Parameters.................................................................................................148 -.............................................................................................................................. 148 Local Variables.......................................................................................................148 Teacher as TeacherRecord....................................................................................148 Description.............................................................................................................. 149 Finds the teacher user from the teacher file by matching the username the user entered whilst logging in, to the saved usernames in each of the individual teacher records in the teacher file. Once the username has found a match, the global variable RecordLocation will then be changed to equal the location number of this teacher record..................................................................................................................... 149 Name...................................................................................................................... 149 Public Sub ListClassesInComboBox.......................................................................149 Location.................................................................................................................. 149 Page 104................................................................................................................ 149 Input Parameters....................................................................................................149 Byval ComboBox as object.....................................................................................149 Output Parameters.................................................................................................149 -.............................................................................................................................. 149 Local Variables.......................................................................................................149 ClassR as ClassRecord..........................................................................................149 Description.............................................................................................................. 149 This procedure will read the saved classes from the class file, and will list each of the class names into the combo box that has been passed into the procedure............149 Name...................................................................................................................... 149 Public Function ValidateTextBox............................................................................149 Location.................................................................................................................. 149 Page 104................................................................................................................ 149 Input Parameters....................................................................................................149 ByVal Text As String, ByVal SaveLength As Integer, ByVal MsgText As String, ByVal RegexPattern As String, ByRef ValidInput As Boolean...........................................149 Output Parameters.................................................................................................149 ByRef ValidInput As Boolean..................................................................................149 Local Variables.......................................................................................................149 MyRegex As New System.Text.RegularExpressions.Regex(RegexPattern)..........149 Description.............................................................................................................. 149
6. 6. 6 This function checks that the text entered into a textbox is of the right format using a RegEx pattern that is passed into the function, and checks the text is less than or equal to the save length limit. The global variable ValidInput is then returned false if the text is not valid, and will then display an error message if so............................149 Name...................................................................................................................... 149 Public Function ValidateComboBox........................................................................149 Location.................................................................................................................. 150 Page 104................................................................................................................ 150 Input Parameters....................................................................................................150 Byval Text As String, ByVal MsgText As String, ByRef ValidInput As Boolean.......150 Output Parameters.................................................................................................150 ByRef ValidInput As Boolean..................................................................................150 Local Variables.......................................................................................................150 -.............................................................................................................................. 150 Description.............................................................................................................. 150 This function checks that the user has not left the combo box that is being checked has not been left empty, and that one of the choices has been selected. The global variable ValidInput is then returned false if the and option has not been chosen, and will then display an error message if so..................................................................150 Name...................................................................................................................... 150 Public Sub ShowDataInTable.................................................................................150 Location.................................................................................................................. 150 Page 104 ............................................................................................................... 150 Input Parameters....................................................................................................150 ByVal QuizList As Object, ByVal NoQuizzesLbl As Object.....................................150 Output Parameters.................................................................................................150 -.............................................................................................................................. 150 Local Variables.......................................................................................................150 StudentQuiz As StudentQuizRecord, Quiz As QuizRecord, y, NewQuizId, Exists, QuizInformation(4), QuizItem As ListViewItem........................................................150 Description.............................................................................................................. 150 This procedure is used to fill the quiz information table on the student homepage as well as on the student grade breakdown form. Columns are created in the list box that is passed in and fills them with the students results for each quiz that has been created in the system, from reading the student quiz file, matching the quiz ID and the student ID fields................................................................................................150 Name...................................................................................................................... 157 Public Sub DrawScoreGraph..................................................................................157 Location.................................................................................................................. 157 Page 105................................................................................................................ 157 Input Parameters....................................................................................................157 Byval Scores() As String, Byval k As Integer, Byval GraphPanel As Object ..........157 Output Parameters.................................................................................................157 Local Variables.......................................................................................................157 Description.............................................................................................................. 157 This procedure uses the results saved that are passed in using the Scores array to map co-ordinates between each quiz. A line is then drawn using the graphics tools, which is done for each quiz that have been created in the system. This then creates a full graph that is then displayed to the user..........................................................157 Name...................................................................................................................... 157 Public Function ValidateAlterPasswordInputs.........................................................157 Location.................................................................................................................. 157 Page 106................................................................................................................ 157 Input Parameters....................................................................................................157 ByVal OldPassword As String, ByVal NewPassword As String, ByVal ReEnteredNewPassword As String........................................................................157
9. 9. 9 Analysis of current system Students currently pay £1 for a pack of around 36 past papers, 16 calculator papers, and 16 non-calculator pages. An example of a calculator past paper and the kinds of questions asked at GCSE level is pictured below, along with the mark scheme. November 2010 Past Paper
10. 10. 10
11. 11. 11
12. 12. 12
13. 13. 13
14. 14. November 2010 Mark Scheme 14
15. 15. 15
16. 16. 16
26. 26. 26 Data flow diagrams (DFDs) Existing System High Level Low Level
27. 27. 27 Proposed System High Level Low Level
29. 29. 29 Visual Basic linked to spreadsheet Java front end with database - Visual Basic GUI creator - Spreadsheet software has many functions and is flexible - Spreadsheet can hold large amounts of data - Text can be manipulated easily - Bespoke front end due to no GUI creator - As front end is tailored to user, the program will be more efficient. can be expensive. - A large amount of data may need to be stored in more than one sheet so may become complex - the solution will have constraints - No GUI creator means there will be a lot more work going into the creation of the program. - More time and effort is needed to create the program I will not be able to create an effective solution for the program using this approach More complicated to design the front end of the program and more time will need to be spent on that part, meaning the core of the program will not be as developed as needed in the time limit I have, so is not the best solution Justification of chosen solution Obviously a bespoke solution is the best option for my program, as it can be made exactly to the needs of the user and their specifications, without unnecessary add-ons. Creating the program myself, means it will be an original piece of work and so will be unlike any other program that already exists. A self-created piece of software means that it can be updated and re-worked if the user feels that it does not fulfil all of the requirements or have found problems or other improvements that can be made to the system. Creating the program directly from the user’s specification means that the program will run in the most efficient way for them. I have decided to create a program using a Visual Basic front end, with file handling to store data. This is the simplest solution, and although the amount of information the program will need to store is large, it does not require any extra software installed. This solution also does not require any complex front end programming, due to the front end creation tool of Visual Basic. Using the Visual Basic front end creation tool will provide the most user-friendly and effective front end, and therefore is the most efficient solution as I am able to tailor it to the needs of the user.
30. 30. 30 Prototype I drew out a diagram to help me decide what pages I’ll need to create a prototype for in my program. User Feedback: Well instead of having to make the teacher create a new user each time, you could put that on the original login page, so the user themselves can create an account. There could also be a page that enables the user to change their password, or a reminder if they have forgotten their password or username. I have made the necessary changes below, which has given me a final idea of the layout of the pages for the program.
32. 32. 32 This is the page that allows the creation of new accounts to access the program. If the type of user selected is ‘student’, then they will be redirected to another page below that asks them to enter their class. If the type of user selected is ‘teacher’ then they will be directed to a page where they enter any classes that they teach. User Feedback: This is great, but there needs to be some kind of protection against students creating fake teacher accounts to access other users’ information. Solution On the page that the user is directed to once they have selected the type of account as ‘teacher’, the user will have to supply a security word, previously agreed upon by the teachers. For the purposes of this project the security word will be ‘circle’.
33. 33. This is the student’s homepage, 33 which is the first page they see after they have logged onto the system. The students name is shown in the top right hand corner. The page shows each quiz that is available, whether they have taken it and the grade they achieved if they have, and also the quiz deadline. User Feedback: The information is set out nice and clearly for the student to see what they’ve already done. There could be a notification at the top showing how many days there are left until the final exams. Solution I have created a countdown timer in days to alert the user as to how long they have left until their two exams. When the amount is red in colour, there is less than two weeks until the exam. If the amount is green in colour there is more than two weeks until the exam date. This is the page where the user is able to change their password, by entering their old one first as a security measure and then entering a new password twice. User Feedback: This page is good and it has all of the necessary security requirements.
34. 34. Solution This is the screen the student sees after they have selected ‘Take Quiz’ from their homepage, which lists all of the quizzes for the student to take. User Feedback: The quizzes that the student has already taken don’t need to be listed as they shouldn’t be able to take them more than once. 34 Only the quizzes that have not been taken, or those with deadline dates that have not yet passed are available to select from the list, as stated in the user requirements. This is the screen the student sees after they have selected the quiz they wish to take from the take quiz page. It has the question number, question text and question choices on. Once the student selects their answer, the answer page will appear. User Feedback: You could create it so the user clicks an option before pressing to go onto the next page in case the student accidentally clicks one of these options. You also should show the user on the question page the time they have left from the original 1 hour 45 minutes to finish the quiz in. Solution With the use of radio buttons, the user can now select an option, and then change their answer without automatically being sent to the answer page if they change their minds. The remaining time the user has left from the starting time of 1:45 is now shown in the top right of the form, which counts down in real time.