I present... my first original script
View Single Post
12-27-2007, 06:29 PM
Join Date: Oct 2007
Originally Posted by
The following is only my own opinion, so feel free to openly disagree! An essential starting point with OOP is starting to think about 'things' as discrete objects (which can interact with other objects, but that's not important here). The main point of this post is to 'correct' (in my eyes) your class naming. The object being created in your code is not a Quiz (class zlQuiz) but a single Question. The Question will have your properties of question, answer, etc.
Then, thinking logically, a Quiz class would contain a series of Questions within it. At the moment, every question is a Quiz and the quiz itself isn't structured and certainly isn't flexible -- an essential concept for reuse.
Finally, here's an idea. Sometimes more than one answer might want to be accepted, for example "PHP" might be the correct answer but someone might enter "php" which would be wrong according to your code. Someone could answer "C#.NET", "C#", "c sharp", "C# .net" all being correct (assuming the question has that answer!) but how would you allow all of those variants to be correct? That's just a point for obolus to think about.
It's great to see you sharing your thoughts, code, ideas and progression with us and I'm looking forward to see things moving along for you.
For sure, for sure. Like I said earlier, the idea/concept/philosophy/principles of OOP are new to me and this is a starting point for me. I value all the feedback I've gotten so far though.
The next version of this script will evolve into something much more in-depth, secure, and grasp the concept of OOP better as well. I enjoy it so far enough that I want to start working on it now! =P
View Public Profile
Send a private message to obolus
Visit obolus's homepage!
Find More Posts by obolus