File: common/dblibrary.php

Return to Documentation

Class: dblibrary
addStudent (2)
studentUserNameExists (3)
updateStudent (4)
deleteStudent (5)
addTeacher (6)
updateTeacher (7)
deleteTeacher (8)
teacherUserNameExists (9)
resetTeacherPassword (10)
addAdmin (11)
updateAdmin (12)
deleteAdmin (13)
getTeacherAdmin (14)
assignAdminToTeacher (15)
getTeacherQA (16)
verifyAnswer (17)
assignStudentsToTeacher (18)
getStudentHistory (19)

addStudent

Author: Brad
Version: 04.25.05

Description

Adds a student to the table "student_info".

Example

dblibrary::addStudent($tid, $username, $fname, $lname, $birthdate, $description, $aid)

Parameters

TidTeacher primary key
UsernameUsername of the student (does not have to be unique)
FnameStudent's first name
LnameStudent's last name
BirthdateStudent's birthdate (this should be a unix timestamp)
DescriptionDescription of student
AidAdmin primary key

Top

studentUserNameExists

Author: Brad
Version: 04.25.05

Description

Checks whether a student's username already exists.

Example

dblibrary::studentUserNameExists($username)

Parameters

UsernameUsername to check

Top

updateStudent

Author: Brad
Version: 04.25.05

Description

Updates a student entry in the table "student_info".

Example

dblibrary::updateStudent($sid, $username, $fname, $lname, $birthdate, $description)

Parameters

SidStudent's primary key
UsernameStudent's username
FnameStudent's first name
LnameStudent's last name
BirthdateStudent's birthdate (unix timestamp)
DescriptionStudent's description

Top

deleteStudent

Author: David
Version: 04.30.05

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.

Example

dblibrary::deleteStudent($sid)

Parameters

SidPrimary key of student to be deleted

Returns

True if student deletion successful, false otherwise


Top

addTeacher

Author: Brad
Version: 04.25.05

Description

Adds a teacher to the table "teacher_info".

Example

dblibrary::addTeacher($aid, $fname, $lname, $email, $question, $answer, $login, $password, $blackboards)

Parameters

AidTeacher's assigned admin (primary key of admin)
FnameTeacher's first name
LnameTeacher's last name
EmailTeacher's email address
QuestionTeacher's question (primary key of question in the table "question")
AnswerTeacher's answer to question
LoginTeacher's login name (must be unique.)
PasswordTeacher's password
BlackboardsTeacher's blackboard preference ('y' or 'n')

Top

updateTeacher

Author: Brad
Version: 04.25.05

Description

Updates the information in the table "teacher_info".

Example

dblibrary::updateTeacher($tid, $fname, $lname, $email, $question, $answer, $login, $password, $aid, $blackboards)

Parameters

TidTeacher's primary key
FnameTeacher's first name
LnameTeacher's last name
EmailTeacher's email address
QuestionTeacher's question (primary key of the question in the table "question")
AnswerTeacher's answer to question
LoginTeacher's login name
PasswordTeacher's password
AidTeacher's assigned administrator
BlackboardsTeacher's blackboard preference

Top

deleteTeacher

Author: David
Version: 04.30.05

Description

Deletes teacher from "teacher_info" table, deletes assignments from "teacher_assignment" table.

Example

dblibrary::deleteTeacher($-)

Parameters

-Tid - primary key of teacher to be deleted

Returns

True if teacher deletion successful, false otherwise


Top

teacherUserNameExists

Author: David
Version: 05.01.05

Description

Checks whether a teacher's username already exists.

Example

dblibrary::teacherUserNameExists($login)

Parameters

LoginLogin to check

Top

resetTeacherPassword

Author: Brad
Version: 04.25.05

Description

Resets a teacher's password to "alllink_default" in the table "teacher_info".

Example

dblibrary::resetTeacherPassword($tid)

Parameters

TidTeacher's primary key in the table "teacher_info"

Top

addAdmin

Author: Brad
Version: 04.25.05

Description

Adds an admin to the tables "teacher_info" (where their information is stored) and "admin_info".

Example

dblibrary::addAdmin($aid, $fname, $lname, $email, $question, $answer, $login, $password, $permissions, $blackboards)

Parameters

AidThe primary key of the admin (would be super admin)
FnameAdmin's first name
LnameAdmin's last name
EmailAdmin's email address
QuestionAdmin's question (primary key to question in table "question")
AnswerAdmin's answer to question
LoginAdmin's login name
PasswordAdmin's password
PermissionsAdmin's permissions ('manage_users', 'author_content')
BlackboardsAdmin's blackboard preference ('y' or 'n')

Top

updateAdmin

Author: Brad
Version: 04.25.05

Description

Updates an admin entry in the table "admin_info" and "teacher_info".

Example

dblibrary::updateAdmin($tid, $aid, $fname, $lname, $email, $question, $answer, $login, $password, $permissions, $blackboards)

Parameters

TidPrimary key of entry in table "teacher_info"
AidPrimary key of entry in table "admin_info"
FnameAdmin's first name
LnameAdmin's last name
EmailAdmin's email address
QuestionAdmin's question (primary key to question in table "question")
AnswerAdmin's answer to question
LoginAdmin's login name
PasswordAdmin's password
PermissionsAdmin's permissions ('manage_users', 'author_content')
BlackboardsAdmin's blackboard preference ('y' or 'n')

Top

deleteAdmin

Author: David
Version: 04.30.05

Description

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.

Example

dblibrary::deleteAdmin($aid)

Parameters

AidPrimary key of admin to be deleted

Returns

True if admin delete successful, false otherwise


Top

getTeacherAdmin

Author: Brad
Version: 04.25.05

Example

dblibrary::getTeacherAdmin($tid)

Parameters

TidGets an primary key of the admin (within the table "admin") assigned to the teacher.

Top

assignAdminToTeacher

Author: Brad
Version: 04.25.05

Description

Assigns an admin to a particular teacher.

Example

dblibrary::assignAdminToTeacher($tid, $aid)

Parameters

TidPrimary key of teacher to edit in table "teacher_info"
AidPrimary key of admin to assign to teacher in table "admin_info"

Top

getTeacherQA

Author: David
Version: 04.25.05

Description

Gets the question and answer for the teacher with a given login name.

Example

dblibrary::getTeacherQA($username)

Parameters

UsernameThe login name associated with a teacher in the table "teacher_info"

Top

verifyAnswer

Author: David
Version: 04.25.05

Description

Verifies that an answer matches that provided for a particular teacher and returnsemailInfo (address and password) for that user.

Example

dblibrary::verifyAnswer($teacher_id, $answer)

Parameters

Teacher_idPrimary key of the teacher in table "teacher_info"
AnswerAnswer (string)

Top

assignStudentsToTeacher

Author: Brad
Version: 04.25.05

Description

Creates entries in 'student_assignment' table to assign all students in user_id_array toteacher with p_key = tid.

Example

dblibrary::assignStudentsToTeacher($tid, $user_id_array)

Parameters

TidPrimary key (table "teacher_info") representing the teacher to assign the students to
User_id_arrayArray of primary keys (table "student_info") representing students to associate with teacher

Top

getStudentHistory

Author: Brad
Version: 04.25.05

Description

Gets an array of bookObjects (with timestamps) representing a student's reading activity.

Example

dblibrary::getStudentHistory($sid)

Parameters

SidPrimary key of a student (table "student_info")

Returns

Array of bookObjects (with timestamps) representing student's reading activity


Top