skinner927
03-21-2007, 03:26 AM
Alright, I'm making a web test for the English department at school. Currently it works with each student being able to login by using their first and last name, teacher's last name and a unique pin (to help with duplicate names, less chance of overlap)
This way it can run without having to create user names and passwords. I also choose this style because I don't have access to any database. Each student's records are saved in a text file with the format: teacher_lastname.firstname_pin.txt
I'm rambeling. I have no problem creating the test, I've already done it.
What I'm doing now is trying to create an Administrator's login so the tests can be administered once i'm gone.
I'm having problems trying to figure out a way to store all students in a teachers class. It would be easy if I knew the teachers last name but I can't hard code it as it may change.
This is what I'm doing now (outlined)
I'm able to read the directory with all the students files in it. Strip the data from them, and be able to get the teacher's name, last name, and first name (and pin if I wanted but no reason for that)
I'm storing all of it in a 3D array.
$students["$teacher"]["$lname"]["$fname"]
It works great when I know the teachers name and students full name. But the problem is I dont know how to list all of the students with on teacher.
Is there a way I can do this? I'm able to use other forms of storage (meaning other arrays, i guess) But I can't really change the use of text-files. I'm currently seeing if I can get a mySQL DB to use, because then this would all be easier.
Thanks for all the help, any input would be much appreciated, sorry for the long winded story.
This way it can run without having to create user names and passwords. I also choose this style because I don't have access to any database. Each student's records are saved in a text file with the format: teacher_lastname.firstname_pin.txt
I'm rambeling. I have no problem creating the test, I've already done it.
What I'm doing now is trying to create an Administrator's login so the tests can be administered once i'm gone.
I'm having problems trying to figure out a way to store all students in a teachers class. It would be easy if I knew the teachers last name but I can't hard code it as it may change.
This is what I'm doing now (outlined)
I'm able to read the directory with all the students files in it. Strip the data from them, and be able to get the teacher's name, last name, and first name (and pin if I wanted but no reason for that)
I'm storing all of it in a 3D array.
$students["$teacher"]["$lname"]["$fname"]
It works great when I know the teachers name and students full name. But the problem is I dont know how to list all of the students with on teacher.
Is there a way I can do this? I'm able to use other forms of storage (meaning other arrays, i guess) But I can't really change the use of text-files. I'm currently seeing if I can get a mySQL DB to use, because then this would all be easier.
Thanks for all the help, any input would be much appreciated, sorry for the long winded story.