$index[$t] = $i; $i = $i + 1; } if (!isset($index[$term])) { // check if this is a valid term print ' EXIT - term is not valid.'; exitParameterError($term); } print ' Term valid.<br>'; // find the tables $evaluationsTable = 'Evaluations' . $term; //print " Evaluations from $evaluationsTable.<br>"; $assignmentsTable = 'Assignments' . $term; //print " Assignments from $assignmentsTable.<br>"; // find teacher and TA $teachers = findTeacherNames($link); if (!isset($teachers[$teacherEmail])) { // check if this is a valid teacher (Faculties table) print ' EXIT - teacher email is not valid.'; exitParameterError($teacherMail); } print ' Teacher valid.<br>'; $tas = findTaNames($link, $assignmentsTable); if (!isset($tas[$taEmail])) { print ' EXIT - ta email is not valid.'; exitParameterError($taMail); } print ' TA valid.<br>'; // test whether evaluation is valid if ($teacherEmail != "" && $taEmail != "" && $evaluation != "") { print '<p>Evaluation is valid.<br>';
function findTeacherName($link, $email) { $names = findTeacherNames($link); return $names[$email]; }