Jump to content


This topic is now archived and is closed to further replies.


Advanced OOP??

Recommended Posts

Ok this isn't really a question necessarily, well sort of, it's more of a preporatory discussion to help me make sure I am on the right track.  I ran across a client, who needed something done, I wasn't sure what all it entailed, so I priced him up to around 615.00 actually for just 7 custom created php functions.  The functions themselves are no big deal, in fact with my current level they are easy.  Just some basic user authentification, and some other simple stuff, not that big of a deal, not that hard.  There is only one that concerns me, it'll require putting forth quite a good chunk of programming logic behind the code to make it do what he is wanting.  As far as what he's wanting, let me give you some foreground information before I ask what I was going to ask.  Here are the functions he asked me to create, all pretty simple except for one.

By the way I have full server, and database access, and permission to change the database some if I find it necessary.  This will all be pretty simple.

Well actually I can't get my damn email open for some reason so I won't be able to post the functions he wanted.  But obviously there all basic functions, like he wanted a user authentification.  He said something about he's not using sessions or cookies, so I am just  pulling it from the database, and checking to make sure the username and password are correct, some basic stuff.  he had a lot of ones based on logic, like he is a tutor, so it's going ot have a lot of classroom related stuff, some of it simple, some of it advanced calculations, but I Doubt anythign I couldn't handle as far as creating, and preparing the functions.  It doesn't seem like anything advanced, but some are based on heavy stuff, like an integer, 1-3 based on the type which is math, english or science, or something, then an integer 1-3 for problems 1 for correct, 2 for incorrect, and 3 for something, and at the end it tallies result's it's all pretty deep programming, when I get to the deeper programs.  I have until like friday of this week or monday of next to get all of htis done, so the timeline isn't exactly heavenly.  As for the part that I am afraid of, that I am wondering about is, he is using flash for the site.  He is a programmer like me, he is good in flash/actionscript, I know little to nothing about it "yet", and he is beginner with php it seems at best.  Now this is where I have to ask some questions.  The thing he is wanting to use is called PHPObject
That is the website, and I don't know how well it's going to go, i have been looking at it, it seems I just need to create these functions in php, to return the results or the results as an array so he can handle, and do whatever with the data in flash.  Now am I heading down the right track
I create these functions like normal php functions, and save them all in a file, then he should be able to do the rest, or do I have to keep something else in mind, or do I have to use classes, or objects or what, I am a little confused on where to go, if it was just functions I could just jump on it and get it started.  I just don't understand how I can help him get it to work with this phpObject or whatever, is this phpObject something I could do myself without a problem, I normally do everything from scratch, or will my lack of knowledge in flash keep me from achieving this??

Share this post

Link to post
Share on other sites
Here is the database information and functions he asked me to create to give you a better idea of what he wants


·        userID: (key) a unique integer that identifies each user

·        position: an integer that determines the user's position (1 = student, 2 = parent, 3 = tutor, 4 = admin)

·        firstName: user's first name

·        lastName: user's last name

·        login: user's login

·        password: user's password

·        email: user's email address

students_tutors: this table assigns a tutor to each student

·        studentID:  userID of the student

·        tutorID: userID of the tutor


·        assignmentID:  (key) a unique integer that identifies each homework assignment

·        studentID:  the userID of the student to whom the assignment was assigned

·        tutorID:  the userID of the tutor who assigned the assignment

·        assignmentDate: the date and time when the tutor assigned the homework

·        dueDate:  the date and time when the assignment is due

·        complete:  a Boolean to keep track of whether the assignment has been completed

·        score: (null until the student submits the assignment)


·        problemID:  (key) a unique integer that identifies each problem

·        subjectID:  an integer that represents the subject (1 = math, 2 = reading, 3 = writing)

·        answer:  the correct answer to the problem

·        difficulty:  and integer representing the difficulty of the problem (0-9)

assignments_problems:  this table associates each assignment with multiple problems

·        assignmentID: The assignmentID of the assignment in which the problem is being included

·        problemID:  The problemID of the problem that is being included in the assignment

·        order:  and integer that represents the position of the problem within the assignment

·        answerChosen: the answer that the student chooses (remains null until the student submits the completed assignment)


·        keywordID: (key) a unique integer that identifies each of the keywords that will be used to classify (and search for) the problems.

·        Keyword: the actual keywords that will appear in the search strings


·        problemID: a problemID from the problems table

·        keywordID: a keywordID from the keywords table

Below are the functions that I need written in php so I can call them from flash.  I've included the parameters that I'd like them to take, the actions they need to perform, and the data they need to return.

getMatchingProblems( )

I think this is going to be the most complicated of the functions.  The idea is to get a ranked list of problems (like search results from a search engine).  Ideally, the ranking would be based on how many of the keywords in the search string (passed as a perameter) match keywords associated with each problem.  The more matches – the higher the ranking.


·        Some standard search string (like you would enter into a search engine)

·        SubjectID (must match the SubjectID of a problem for the problem to be included in the results)

·        A minimum problem difficulty level (an integer 0-9)

·        A maximum problem difficulty level (an integer 0-9)

·        A boolean that would indicate whether or not to include problems in the results that have already been assigned to the student on a previous homework assignment.

·        A userID number so the Boolean above references the correct student

·        The number of results to return (an integer)

Ideally, the function could return a multidimensional array as follows:

[ 0 ][0] = problemID

[ 0 ][1] = section

[ 0 ][2] = difficulty

[ 0 ][3] = been used?

[ 0 ][4][0] = first keyword

[ 0 ][4][1] = second keyword …etc.

[ 1 ][0] = problemID (of the next problem)

newAssignment( )


Student's user id

Tutor's user id

timeAllowed:Integer (I'll pass it minutes)

problemIdNumbers:Array (I'll pass an array of all the problemID numbers in the order I want them)

due date


Record all the information in the database


Something to tell me that the assignment was successfully recorded

getAssignment( )



Returns an Array:

[0][0] = first problemID

[0][1] = second problemID…

[1] = time allowed

[2] = assignment date

[3] = due date

getAssignments( )



Returns an Array:

[0][0] = assignmentID

[0][1] = assignmentDate

[0][3] = due date

[0][4] = Is Completed? (Boolean)

[0][5] = Number answered correctly (0 if not completed yet)

[0][6] = total number of problems

[0][7] = time allowed


[1][0] = assignmentID

submitAssignment(  )



array of students answers (any unanswered question will be null)


Record the students answers in the database

Record the students score in the database

Return and array:

[0] = result of the first problem (1 if answered correctly, 0 if answered incorrectly, null if not answered)

[1] = result of the second problem…

newUser( )





first name

last name

email address


Adds the user to the users table


The user's userID number if the user was added correctly

False if the user was not added correctly

verifyUser( )





The user's userID if the login and pw are correct

False if they aren't correct

getUser( )




[0] first name

[1] last name

[2] position

[3] email[/quote]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.