You are on page 1of 21


PAT Phase 2
By Gorden-Dean Staats.

Glossary3 TOE Chart3 Components & Data Structures6 Data Structures6 Variables6 Arrays...8 Text File8 Components8 Data Base8 Text File9 Delphi 79 Input, Processing, Output14 Error catching17 Data Validation17 Test Data17 GUI18 Data Base19 ERD 21

P.N= possible name. TOE= Task, Object and Task (acronym). DB= Data Base. IPO= Input, Process, Output. GUI= Graphics user interface (Pronounced gooey). ERD= Entity Relationship Diagram.

TOE Chart:
Form1 (login, welcome and link to sign-up and password reset form (form2)). TASK Containing the following objects. Welcoming Users. OBJECT Form1. frmWelcom(P.N) Show message procedure Image. imgBackground1(P.N) Button. btnSignup(P.N) Button. btnLoggon(P.N) BitButton. bitbtnExit(P.N) Button. btnHelp EVENT OnActivation. ( as the program starts) OnFormActivate. (as the form is created) OnFormActivate. click click click click

Background of form. Allow user to sign-up. Allow user to log-in Exit program

Provide user with a useful guide. Form2 (sign-up, reset password). TASK Contain the following objects.

OBJECT Form2. frmSignup(P.N)

EVENT OnActivation.

4 Inform users of current location. Allow users to input data regarding required fields. Allow users to input data regarding required fields. Allow users to input data regarding required fields. Allow users to input data regarding required fields. Show message procedure Edit1. edtName(P.N) Edit2. edtSurName(P.N) OnFormActivate. OnFormActivate. OnFormActivate.

Edit3. edtUserName(P.N) OnFormActivate.

Edit4 + 5. OnFormActivate. edtPassword(P.N) 2x edits to confirm password Allow users to input data Edit6. edtSQAnswer(P.N) OnFormActivate. regarding required fields. (security question answer) Allow users to input data Edit7. edtAnswerSQ(P.N) OnFormActivate. regarding required fields. Allow users to input data Edit8. edtNewPass(P.N) OnFormActivate. regarding required fields. To create account Button. btnCreate(P.N) click To reset password Button. btnRecover(P.N) click Background for form Image. OnFormActivate. imgBackground2(P.N)

Form 3 continues on next page please continue downwards!!! XD Form 3 (Main form, where users can take part in predictions and mange (by manage meaning view.)).

TASK Contains the following objects. To allow users to change users or log out To allow users to make predictions

OBJECT Form3. frmMain. Button. btnLogout(P.N) Button. btnPredict(P.N)

EVENT OnActivation. click click

5 To allow users to manage predictions Stores all predictions made. Button. btnManage(P.N) Rich edit1. redPredictions(P.N) click

OnFormActivation. Vertical and Horizontal scrolling (enabled). Stores all the predictions Rich edit2. redNews(P.N) OnFormActivation. user can take part in. Vertical and Horizontal scrolling (enabled). Stores the entire users Rich edit3. redStats(P.N) OnFormActivation.Vertical and horizontal scrolling statistics. (enabled). ** Important to note** The objects mentioned and tasks mentioned may change or vary from the program itself due to Inexperienced programmer Restrictions due to program used New ideas by programmer More efficient ways to handle tasks More tasks required to increase user friendliness

That is all.

Components & Data Structures:

The components and data structures bellow are subject to change, as I have not given my project much thought at this point. This is simply a rough idea of what will be needed based on my ideas and research done into other peoples tasks (simply asking them what they used and why).

Data Structures:

sName: To store the users name and input it into the DB. sSurName: To store the users surname and input it into the DB. sUserName: To store users user name and input it into the DB, the user name will be the name that all other users will see for example: KillerDuck9981. sDateOfBirth: To store users date of birth and input into the DB, as well as confirming if the mentioned user is old enough to take part in the game. As it will consist of interaction between adults anonymously (people tend to swear a lot in these occasions). sPassword: To store users password and input it into DB, as well as using it to confirm if his password is correct. sEmail; To store users email and input it into DB, this will be used to contact user if anything has gone wrong or a complaint has been made against the user.

iPredMade: This is to store all the predictions the user has made. iPredCorrect: This is to store all the predictions that were correct. iPredMiss: This is to store all the predictions that were incorrect. **Above mentions is user specific. This means that this will be stored in another DB that will save the data**

iPoints: This will store points the user has accumulated through correct predictions and taking part in predictions. iBonus: This is bonuses points that will be calculated by factoring in users accuracy. Important to note that participation points will not factor into this. It is also important to note that the amount will be rounded off, example: 1.9 = 2 and 1.3= 1. iPartPoints: These are points the user will receive with respect to their level, for example a user ranked A will receive maximum participation points where a ranked B user will receive less than a ranked A user, maxed rank users will receive no Participation points. iXpPoints: These points will received at the end of every prediction, as well as being purchased using your points. The higher the rank of the user the less XP they will receive.

rAccuracy: this will store the users accuracy by dividing the predictions that are correct by the predictions incorrect.


8 cRank: Will display the rank of the user with a symbol ranging from A to SS as most games follow this ranking system.

aPredictions: This array will hold the predictions the user may take part in by randomly selecting one. As there is no online connection and this seems to be the easiest way to control the predictions and events.

Text File:
tPredictions: Since every event will contain a lot of information it would be easier to create numerous text files contain information on each event. This text file will be linked to the above mentioned array.

Date Base:
There will be 2 databases that will be connected to the program (if this possible).

Data Base 1 Account details.

This data base will contain data on all the users that will create accounts in the program. The importance of this data base is to control users and act as a log in server. By controlling users I mean limiting the amount of accounts a user can create, reasons behind this is so that the user does not take advantage of the system, by making 2 or more predictions on one event. An example of this is User A creates 2 accounts A and B he then sets account A predictions that team A will lose, he then re-logs and sets account B that team A will win. This wont affect or better his stats but he will earn points. What a user can do with these points is yet to be decided.

Data Base 2 User details.

With this data base the users statistics will be recorded. For example: User has created account, account name is KillerDuck8199. KillerDuck8199 takes part in a few events and his accuracy is being recorded. This data will be stored in this data base and will be displayed in the statistics section of his/her statistics tab (I am currently uncertain as to add a 4th form and create a proper statistics page or a so called profile page where other users can see it or access, basically user A can check out user B success in his predictions and other information regarding user B).

Text File:
As this also fall under data structures I wont go into so much detail but I feel as it also fall under component/components that the program will need to successfully entertain the user (as mentioned above) and ultimately solve the problem.

Delphi 7:
The main component is Delphi 7 as it will act as the program and is also the main part of the solution. It is further divided below. **The Delphi 7 components and their P.N and numbers were mentioned above in the TOE chart, this is simply a listing and the reasons for their existence (so to speak) **



Form 1 Welcome, log in.

Below I will be mentioning some of the components that will be found on this form (Components of the form which eventually form part of the whole solution).

For the solution I will need a few buttons to do the following tasks: Allow the user to log-in. Allow user to sign-in. Reset password. Create a help function. Exit the programme.

Show message Procedure, reason to welcome users as the program starts.

Image, too enhance the GUI of the programme.

Form 2 Sign-up, Password reset.

11 Below I will be mentioning some of the components that will be found on this form (Components of the form which eventually form part of the whole solution).

On this form I will need 3 (the amount I think I can make it work with) One to reset password. One to proceed after account creation. One to reset or reload page (form).

Edit boxes and accompanying labels:

Under sign-up section of this form 2 will be need a few edits that accompany the fields in the DB 1 Account details. Let me list roughly their names (just so that maam can get a rough idea, at this point I am yet to create my DBs): Users Name. Account Name (possible primary field). Users Surname. Email address (possible primary field). Password. Password re-type (to make sure that is the users desired password and that they know it). Security question answer.

Under the password reset section of form 2 the following edits and accompanying labels will be found: Account name. New password. New password re-types. Security question answer (proof that is truly the original user that wants to change the following details.


Please not there will be labels accompanying all of the above mentioned edits.

Image, too enhance the GUI of the programme.

Form 3 Predictions and or statistics.

I am currently not sure how many buttons I want on this form so I am going to list a few tasks that I will need buttons for as these are the only tasks I can see that I will require being for filled: Manage predictions (basically view predictions made and track them). Logout. Create prediction. View stats.

On these I will display the users rank and points gathered.

Rich edit/Rich edits:

There will be 2 so far on these 2 the following will be displayed: Stats. Predictions made.

Image, too enhance the GUI of the programme.

Form 4 Stats or User profile

13 Please note that this form is under discussion, management is currently uncertain whether to include it or not, they are currently disputing the fact that it will make the program better and grant more features to the program and user and make up for the programing teams lack of programing knowledge and skill however it will also mean more work and management is quiet lazy. If however it is created the following can be expected:

These are just a few ideas brought forward by the creation team. Purchase or Buy, this button will allow users to buy what they have selected on the buy form (5th form just came to me or a radio group however that will look sloppy while viewing another persons profile). Change avatar (considering creating an avatar image list or importing function to increase personalisation of accounts). Edit. This will allow users to edit there profiles (highly improbable, extremely lazy).

Depending on the most suitable method of displaying the following I will consider either or a label or a panel. Rank. Details about user (name, age, predictions). Accuracy. Predictions taken part in. Experience points. Points.

This will consist of the Avatar and a background (possibly) each to achieve the own goal. Increase account personalisation.

14 Image, too enhance the GUI of the programme.

Input, Processing, Output:

This is a rough description of IPO, meaning in my processing it will simply cover the solution or the processing without any pseudo coding

I- User inputs account name. P- Account name is verified by determining whether the name is taken or not. O- Users account name is valid, account name = to that account name. I- User inputs account password (2*). P-The 2 inputted passwords must be matched or matching if they are matching that the user may proceed. O-The user may proceed in account creation. I-User selects a security question and answers it. P-The answer is unique to each user and is saved on the DB. O-Used to determine whether or not the user is authentic

The above mentioned is simply based on account creation and account altering. Below I will go into detail on inputs that require a algorithms to get the output.


IPO, Input, Process, Output

I-Users prediction, team A will win. P-To determine whether or not the prediction is correct or not is simple: did team A win T/F, if T then users prediction is correct, if F then user prediction incorrect. O- Amount of predictions correct = 1 or Amount of predictions correct = 0. I- The Output above is an input in calculating the Accuracy of the user. P- To calculate the Accuracy the Amount of predictions made will be divided number of predictions correct. O- The users accuracy rating which will be displayed in the users stats. I- Prediction correct = true. P- Bonus points = points gained from prediction * accuracy. O- Bonus points which will be added to the users end results of their prediction. I- Prediction correct = true P- The amount of points will be equal to the odds if the odds are 10 to 1 that the team you choose to win will lose then your points received are multiplied by 10 if the odds are 4 to 1 then it will be multiplied by 4. O-Points received will be displayed in stats page. I- prediction correct = true

16 P- The amount of experience gained will be more than if the prediction correct was false, this will also decrease as your level increase, for example if prediction correct = true then xp gained is x10 if your rand is S then xp gained is then divided by 9. O- This is added to your existing amount of xp.

I- Xp points = max then rank up. P- Once the users xp points reach a certain point it will activate the rank up process. Basically xp points gained is = 100 and the max is 100 then they will rank up to next rank and xp cap will increase. O- Rank up.

I-Purchase item X. P- This will be controlled by a radio group; the item will have a price and if the user has enough points collected to cover the price then he/she can purchase the item. Points collected price >= 0. O-Then user now owns item X.

This concludes all the IPO data I can think about at the moment and I will be sure to add more in the actual program as I am unsatisfied with what I have at the moment and the further I get into my PAT phase 2 the more ideas that flow into my head and make it hard to concentrate on one simple topic.


Error Catching:
Bellow I will be explaining how data will be validated in terms of the IPO.

Data Validation:
How to will the inputted data be validated? Simply by using test data, by test data pre-set sure to work data that I have proven that will work. To make sure that no mistakes are made when the user is creating his or her account or mistakes are made while inputting data error messages will be displayed. For example while the user is creating an account and a certain field has been left open then a message will be displayed indicating the error the user has made, let us say that they forgot to input there account name an error message will be displayed saying You have forgot to input account name, please go back and make sure you have filled everything in.

Test Data:
This is data I will use to make sure the program is functioning properly. User Name/Account name: KillerDuck Password: g0rd3n123145 Users name: gorden Users Surname: Staats Users Email address: Security question: What was/is your first pets name? Security question answer: Rexie When this data is inputted then the users account will look like this: Profile name: KillerDuck (the name other users will see). Password: g0rd3n123145 And thats it.




Data Base:
The role of the database is to act as a database by this I mean it much hold all of the data and this will then be displayed as information, as well as holding data it will act as a login in server so to speak by verifying inputted data by users. For example checking whether or not the inputted password is the same as the one in the DB itself. My choice of fields so far is as follows: Account Name: field size 30. Type: text. (Primary Key). Users Name: Field size 30. Type: text. Users Surname: Field size 30. Type: text. Email Address: Field size 30. Type: text. Password: Field size 10. Type: text. Security question: Field size 30. Type: text. Security question answer: Field size 30. Type: text.


This is what the DB looks like.