SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey guys,

    I'm really new to PHP/MySQL, but I've been through some tutorials on the net, including the one on this website. Anyway, I want to build a website to keep track of students grades. Without going into the details, I'll try to fill you in on what I want.

    Teachers login to the website. It then has a list of all their classes and then, they click on a class, and a list of students come up. Then, they fill in their grade they made that 9 weeks or midprogress (mid term (4.5 weeks)). Then, when the teacher fills in that students grade, it will automattically update another textfield for the GPA, and some classes are honors and AP, so GPA is different, but I can do this. And also here will be teacher comments. Then, the teacher submits this and also, it will figure out the class ranking for that nine weeks (or mid progress) and the class rank for the year in that class. Anyway, what will eventually happen is each teacher fills in this info for each class and then. Then, this will be compiled into a report card which will be printed out, containing all this info for each subject along with GPA that nine weeks for that whole grade, GPA for the whole year, and GPA for the highschool career. Also, class ranking for this 9 weeks, this year to date, and for this persons high school career. Got all that?

    Anyway, first, how would I calculate class ranking (in each class--then, I should be able to figure out the rest).

    Next, this is the question I really have. How do I do my database. Here's what I've figure out I could do so far.

    Have a table called Students
    Then, have columns with ID, LN (last name), and FN (first name)

    Have a table called Teachers
    Then, have columns with ID, UserName (this will just be their last name), and PassWord

    Have a table called Subjects
    Then, have columns with ID, SubjectName, and TID (TeacherID)


    Ok, I think that I could handle creating those tables and having the subjects assigned to a teacher and then, having the teacher login and select that class, but how would I assign students to a class? How would I assign grades to each student for each class? I have more questions, but let me atleast start from here.

    Also, most subjects last two semesters (4 nine weeks with 4 mid progresses in there), but some only last one semester (two nine weeks with two midprogresses). And some courses are honors, AP, and regular (that shouldn't be too hard). Also, you have to add exam grades in there for each semester unless they exempted. And then, based on that, you could have the semester grade filled, and also the yearly grade filled in at the end of the year.

    I hope I didn't confuse anyone--I tried to explaint he best I could, but I'm a newbie.

    aDog

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For a "newbie," you're definitely taking on a tough project. What you've described is a system that an experienced database designer would consider a challenge... You should consider implementing a simpler system first, then slowly add features one at a time until you build up to your ideal feature set.

    I'll give you a general answer to each of your questions, but anything more would be doing the work for you. Sorry, but people get paid very well for designing these types of systems... you'll have to gain the neccessary skills yourself. I am always willing to answer specific questions, though.

    Originally posted by Arielladog
    Anyway, first, how would I calculate class ranking (in each class--then, I should be able to figure out the rest).
    By class ranking, I assume you mean some sort of ordinal, where the best student in the class is ranked '1', the second best '2', and so on.

    This isn't the sort of thing you should store in the database, as it's what's called a derived property. That is to say, the class ranking is already stored in the database in the form of the students' marks. Storing the calculated ranking separately is only inviting syncronization issues (e.g. what if a teacher edits a student's mark -- if you code doesn't re-calculate every single student's ranking whenever this happens, the rankings will be left in an inconsistent state!).

    Instead, the script you write to produce the report card should calculate the ranking on the fly. This is fairly straightforward, and can be done using an ORDER BY in your SELECT statement.

    Next, this is the question I really have. How do I do my database. [...] but how would I assign students to a class? How would I assign grades to each student for each class? I have more questions, but let me atleast start from here.
    Consider creating a table called grades to store (studentID,classID,grade) triples. If you need to support more than one grade per student/class combination, you might need another column to identify the grade 'order' (so, for a particular class, the set of grades with order=1 would be the mid-semester grades, and the set of grades with order=2 would be the end of semester grades). The important thing to note is that they're all grades, so they should all be stored in a single table.

    Also, most subjects last two semesters ...
    If anyone wants to chime in on these, do feel free, but I think aDog will have his or her hands full implementing the above already.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I was in school I remember sometimes my classes would only last 1 semester. In these cases the table of my grades on the card would just be blank if I was no longer taking that class.

    What I would do is put 2 fields in the grade column, term id (4.5 week period) and semester ID. These could be date fields that list the starting date, or arbitrary IDs that you assign. But I think you'd have to store the grades like this, in the lowest common denominator.

    Now you don't really NEED to store the final grade for the class, the computer can do all the calculations for you.

    When the script is called up it can automatically access the 3 term grades for semester 1 for x class and average them and spit out a final grade for that semester for that class. Then it can do it for the next class and so on until all of the students grades are figured, then the finals are all inputted into an array and you get the GPA out of that.

    As far as AP classes go you could add a column called class weight which would indicate how to make the grading scale (I'm assuming AP Classes can give a student a 5.0 instead of a 4.0, as it was in my school).

    All in all the database portion of your project doesn't seem too complicated. Its all the calculations that will take you a lot of work.

    To do the class lists you'd want to run a script that calculates the GPA for every student, and then inputs that into a table. Calculating the GPA for one student is one thing, for all students is a lot of work and it'd be better if you just made a script that would do this and just ran it every semester.

    Anyways, do like Kevin said. Make it piece by piece and start simple. And if you ever need help on one particular portion you can always ask here.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  4. #4
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    I guess I was asking a lot, and I don't want someone to do the work for me, but just pointing in the right direction to get started, and y'all have helped. Got like two more hopefully more specif ones.

    When I would create a database for the grades, would I have to already assign a value of "0" to every students grade before a teacher can change that?

    And also, should I keep GPA for the class, average GPA for that grading period, average GPA for the year to date, average GPA for the HS career. ANd what about class ranks? And then, would I have the teachers fill in the data and then, I or someone else would have to tell PHP to fill in the other part of the database (understand?)?


    aDog

    P.S.-I heard that if you screw up design in database, it's a pain to go back. If I want to add features that require changing the database around and moving data from one column to another, would it be that bad?

  5. #5
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Arielladog
    When I would create a database for the grades, would I have to already assign a value of "0" to every students grade before a teacher can change that?
    Depends on your database design. Either way would work -- you decide which one you're most comfortable with.

    And also, should I keep GPA for the class, average GPA for that grading period, average GPA for the year to date, average GPA for the HS career. ANd what about class ranks?
    As we have suggested above, values that can be calculated based on data elsewhere in the database should not be stored in the DB unless there is a special reason to do so (e.g. it takes an hour to calculate them).

    P.S.-I heard that if you screw up design in database, it's a pain to go back. If I want to add features that require changing the database around and moving data from one column to another, would it be that bad?
    It's a pain to adjust a database layout once the system is already in use, because it's difficult to migrate data from one design to another. In development, you can change the system around as much as you like, since presumably you're testing with disposable data.

    If you've been contracted to do this work for someone (no offense intended, but I hope they're not paying you much) I don't recommend giving them the system to use until you're done adding features to it.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  6. #6
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Thanx. I just wasn't sure because I'd calculate the GPA, but then, based on that, I'd have to have it calculate the class ranking and average GPA. Maybe, if I store the GPA for each class, but not any of the average GPA's???

    How's this sound for grades:

    Have a table called GradeLookUp
    Have a column called CID (Class ID), SID (Student ID), GradingPeriod, Grade (student's grade), and GPA (GPA for that class). Would something like that work?

    And also, for username/passwords, that would just be a normal database, correct?

    Kevin,

    Trust me, I wouldn't try to make money with my meager skills. This is mroe of a hard task to help me learn PHP/MySQL that could be useful and maybe, I will show it to my school when I'm totally done, but no "real" (person I know in real life) knows about this

    aDog
    <Edited by Arielladog on 12-17-2000 at 12:17 PM>

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Arielladog
    Thanx. I just wasn't sure because I'd calculate the GPA, but then, based on that, I'd have to have it calculate the class ranking and average GPA. Maybe, if I store the GPA for each class, but not any of the average GPA's???
    Read up on temporary tables in MySQL. You can store temporary calculated results and then perform database operations on them (e.g. calculate the average) to get additional values. The tables disappear when the connection is closed, leaving a clean database with only the basic data.

    And also, for username/passwords, that would just be a normal database, correct?
    Yup.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #8
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why dont you work with someone and build this into a trun-key solution.

    Im sure there would be a market!.
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  9. #9
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    One thing at a time. aDog has a lot of learning to do before a system worthy of marketing will emerge...

    I'm sure he or she won't sit on it if it does become marketable, however.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  10. #10
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah,

    Right now, this is also a learning experience...

    One more question:

    You see above where I posted how I'd arrange the tables and below that, I posted how the grades would be arranged. Well, Igot a question:

    Should I do the grades like I was saying I'd do them, or should I do arrange each grading period in a seperate table?

    aDog

  11. #11
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to stay away from too many tables. If you did each grading period in a separate table then eventually you'd have alot of tables, its not very usable like that. Its better to just indicate the grading period in a column with the grades.

    Chris
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  12. #12
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Absolutely. As any good guide to database design will tell you, you should only create new tables when you want to represent a new entity. In your case, you're dealing with grades in both cases, so you should be able to store them in a single table and avoid the headaches involved in multiple tables later on.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •