newguy99 — 2012-10-04T14:56:54-04:00 — #1
Its been a while since i visited Sitepoint... Since its old design thumbs up for the new design
Im working on a small system the system main job is registering students attendance
Im having some issues on how to go about it
so far i managed to code these models
Now im facing issues on how to make lecturers add students attendance with ease
I tried to make a page where the lecturer select his/her subjects from Select Box and the students list would be populated using AJAX
However i faced several issues with submitting multiple forms on the same page
(Every student name has his on form) and due to my limited knowledge in JS and AJAX.
Please how would you design such a model ?
Your expertise would be a great help
cups — 2012-10-05T03:32:18-04:00 — #2
Without seeing any code it is difficult to say, but it sounds as if your Models contain just 1:1 object to single database entities, and you need something with JOINS.
If I have completely misunderstood then can you show us what you mean by a Students Model? (just show the stubs of the methods if you like).
newguy99 — 2012-10-05T07:06:34-04:00 — #3
Cups thank you for the reply
My application is simpler then that i do not need join
All students model does is view all students based on their level (LEVEL)
Any students who miss 3% of the class total hours get 1st warning
If he she reaches 7% then a second warning and so on
Now im trying to achieve that so far by making a table called attendance
Where it will contain
Students ID, subject ID, total hours missed so far,
And maybe another table which will have the percentage allowed
Some issues im facing
How to make the input of attendance as easy as possible for the lecturer.
List all students and there will be a form for each student (similar to face book comments)
Lecturer look for that particular student from the list right his her hours missed and if there is a reason or not then submit form it will be updated using Ajax.
I faced so many problems with that due to my limitation with JS.
Another solution im working on is list all students click on the student a pop up will show with a form where a lecture can add the students hours missed and the reason then the 2nd …. So on[/B]
newguy99 — 2012-10-05T07:53:57-04:00 — #4
This link is very helpful well at list part of the issue
siteguru — 2012-10-05T10:11:02-04:00 — #5
How big do you expect this to get? (No. of students, no. of classes, etc.). Unless you're talking hundreds of thousands of records then it seems to me you'd be better having the 3%, 7% etc. checks configured as reports (perhaps PHP files run as a daily cron task), rather than configuring the results in the database. (Or perhaps just have a recording table that the cron task writes the results to).
The attendance table seems to me to need:
ID* | Student_ID | Class_ID** | Lecturer_ID
The Lecturer_ID should be known from the lecturer being logged in. He would then define the Class_ID by choosing the Class** from a list. (AJAX could then be used to define the list of students expected to attend that class - see next sentence). He could then multi-select the students attending (either via a combobox list, or checkboxes). All these items would be in a single form, so that when the form is submitted it has all the data ready to be processed.
*Autonumber type of thing
**I would have a table of Classes. And also a table of StudentsPerClass containing Class_ID | Student_ID
newguy99 — 2012-10-06T10:12:14-04:00 — #6
Siteguru Simply WOW
there are 9 subjects for every year
There are 4 years
currently there are an average of 25 student in every year
when a student reach 3% of the subject total hours then he gets a first warning
7% second warning
10% bard from the class
IF With reason then it get extended to 15%
Every Subject has different hours per week
each subject teached in 28 weeks
Each lecturer has 1 or more then 1 subject
each student has few subjects
I MANAGED TO DO ALL OF THE ABOVE except for the reports still working on it
Whats crun jobs
my skills of PHP is limited
however im googleing about it now
I got disconnected yesterday from the net so i did something on my own
its as follows
step one = the lecturer select attendance then a subjects will be listed (Subjects belong to this particular lecturer)
step two = The lecturer select the subject he want to add attendance from the list then the subject details get displayed and the list of student under it
step three = Lecturer Selects the student who missed the class or part of a class A new PAGE (my weakness with JS) will display with the student information and his total hours missed so far...etc and a FORM
step four = The lecturer fill in the form with ClassDate Missed, Hours Missed, and with Reason or not then submit. Lecturer close page and so on
Note that this process does not happen for all students only for the students who missed the class or particular hours of the class
Attendance Registration (PHP Side)
When the lecturer fill up the form and click add attendance for a particular student this what happen
Check this particular student if exist in the attendance table based on LecturerID, Student_ID, Subject_ID
then add new record
if Yes then continue
Select student attendance (It could be 0 or more)
Update the table based on the student previous attendance if 0 then 0+current hours missed (With reason OR without Reason)
I created new table called Attendance Details where i add the details for the student who missed the class
Promp the user that the record has been added Pleas close the window and go back to the list
siteguru — 2012-10-08T06:43:59-04:00 — #7