Adds a student to the table "student_info".
dblibrary::addStudent($tid, $username, $fname, $lname, $birthdate, $description, $aid)
Parameters | |
| Tid | Teacher primary key |
| Username | Username of the student (does not have to be unique) |
| Fname | Student's first name |
| Lname | Student's last name |
| Birthdate | Student's birthdate (this should be a unix timestamp) |
| Description | Description of student |
| Aid | Admin primary key |
Checks whether a student's username already exists.
dblibrary::studentUserNameExists($username)
Parameters | |
| Username | Username to check |
Updates a student entry in the table "student_info".
dblibrary::updateStudent($sid, $username, $fname, $lname, $birthdate, $description)
Parameters | |
| Sid | Student's primary key |
| Username | Student's username |
| Fname | Student's first name |
| Lname | Student's last name |
| Birthdate | Student's birthdate (unix timestamp) |
| Description | Student's description |
Deletes a student from the table "student_info", deletes that student's historyfrom "student_activity" table, deletes student's assignment from "teacher_assignment" table.
dblibrary::deleteStudent($sid)
Parameters | |
| Sid | Primary key of student to be deleted |
True if student deletion successful, false otherwise
Adds a teacher to the table "teacher_info".
dblibrary::addTeacher($aid, $fname, $lname, $email, $question, $answer, $login, $password, $blackboards)
Parameters | |
| Aid | Teacher's assigned admin (primary key of admin) |
| Fname | Teacher's first name |
| Lname | Teacher's last name |
| Teacher's email address | |
| Question | Teacher's question (primary key of question in the table "question") |
| Answer | Teacher's answer to question |
| Login | Teacher's login name (must be unique.) |
| Password | Teacher's password |
| Blackboards | Teacher's blackboard preference ('y' or 'n') |
Updates the information in the table "teacher_info".
dblibrary::updateTeacher($tid, $fname, $lname, $email, $question, $answer, $login, $password, $aid, $blackboards)
Parameters | |
| Tid | Teacher's primary key |
| Fname | Teacher's first name |
| Lname | Teacher's last name |
| Teacher's email address | |
| Question | Teacher's question (primary key of the question in the table "question") |
| Answer | Teacher's answer to question |
| Login | Teacher's login name |
| Password | Teacher's password |
| Aid | Teacher's assigned administrator |
| Blackboards | Teacher's blackboard preference |
Deletes teacher from "teacher_info" table, deletes assignments from "teacher_assignment" table.
dblibrary::deleteTeacher($-)
Parameters | |
| - | Tid - primary key of teacher to be deleted |
True if teacher deletion successful, false otherwise
Checks whether a teacher's username already exists.
dblibrary::teacherUserNameExists($login)
Parameters | |
| Login | Login to check |
Resets a teacher's password to "alllink_default" in the table "teacher_info".
dblibrary::resetTeacherPassword($tid)
Parameters | |
| Tid | Teacher's primary key in the table "teacher_info" |
Adds an admin to the tables "teacher_info" (where their information is stored) and "admin_info".
dblibrary::addAdmin($aid, $fname, $lname, $email, $question, $answer, $login, $password, $permissions, $blackboards)
Parameters | |
| Aid | The primary key of the admin (would be super admin) |
| Fname | Admin's first name |
| Lname | Admin's last name |
| Admin's email address | |
| Question | Admin's question (primary key to question in table "question") |
| Answer | Admin's answer to question |
| Login | Admin's login name |
| Password | Admin's password |
| Permissions | Admin's permissions ('manage_users', 'author_content') |
| Blackboards | Admin's blackboard preference ('y' or 'n') |
Updates an admin entry in the table "admin_info" and "teacher_info".
dblibrary::updateAdmin($tid, $aid, $fname, $lname, $email, $question, $answer, $login, $password, $permissions, $blackboards)
Parameters | |
| Tid | Primary key of entry in table "teacher_info" |
| Aid | Primary key of entry in table "admin_info" |
| Fname | Admin's first name |
| Lname | Admin's last name |
| Admin's email address | |
| Question | Admin's question (primary key to question in table "question") |
| Answer | Admin's answer to question |
| Login | Admin's login name |
| Password | Admin's password |
| Permissions | Admin's permissions ('manage_users', 'author_content') |
| Blackboards | Admin's blackboard preference ('y' or 'n') |
Deletes the admin with primary key aid, all teachers under this admin, all students under this admin,all 'student_activity' entries associated with teachers/students under this admin, and all 'teacher_assignment' entries associated with teachers/students under this admin.
dblibrary::deleteAdmin($aid)
Parameters | |
| Aid | Primary key of admin to be deleted |
True if admin delete successful, false otherwise
dblibrary::getTeacherAdmin($tid)
Parameters | |
| Tid | Gets an primary key of the admin (within the table "admin") assigned to the teacher. |
Assigns an admin to a particular teacher.
dblibrary::assignAdminToTeacher($tid, $aid)
Parameters | |
| Tid | Primary key of teacher to edit in table "teacher_info" |
| Aid | Primary key of admin to assign to teacher in table "admin_info" |
Gets the question and answer for the teacher with a given login name.
dblibrary::getTeacherQA($username)
Parameters | |
| Username | The login name associated with a teacher in the table "teacher_info" |
Verifies that an answer matches that provided for a particular teacher and returnsemailInfo (address and password) for that user.
dblibrary::verifyAnswer($teacher_id, $answer)
Parameters | |
| Teacher_id | Primary key of the teacher in table "teacher_info" |
| Answer | Answer (string) |
Creates entries in 'student_assignment' table to assign all students in user_id_array toteacher with p_key = tid.
dblibrary::assignStudentsToTeacher($tid, $user_id_array)
Parameters | |
| Tid | Primary key (table "teacher_info") representing the teacher to assign the students to |
| User_id_array | Array of primary keys (table "student_info") representing students to associate with teacher |
Gets an array of bookObjects (with timestamps) representing a student's reading activity.
dblibrary::getStudentHistory($sid)
Parameters | |
| Sid | Primary key of a student (table "student_info") |
Array of bookObjects (with timestamps) representing student's reading activity