if (isset($_REQUEST['testlogid']) and $_REQUEST['testlogid'] > 0) { $testlog_id = intval($_REQUEST['testlogid']); } if (isset($_REQUEST['answerid']) and $_REQUEST['answerid'] > 0) { $answer_id = $_REQUEST['answerid']; } if (isset($_REQUEST['answertext']) and !empty($_REQUEST['answertext'])) { $answer_text = $_REQUEST['answertext']; } if (isset($_REQUEST['reaction_time']) and $_REQUEST['reaction_time'] > 0) { $reaction_time = intval($_REQUEST['reaction_time']); } else { $reaction_time = 0; } // check for test password $tph = F_getTestPassword($test_id); if (!empty($tph) and $_SESSION['session_test_login'] != getPasswordHash($tph . $test_id . $_SESSION['session_user_id'] . $_SESSION['session_user_ip'])) { // display login page require_once '../code/tce_page_header.php'; echo F_testLoginForm($_SERVER['SCRIPT_NAME'], 'form_test_login', 'post', 'multipart/form-data', $test_id); require_once '../code/tce_page_footer.php'; exit; //break page here } if (F_executeTest($test_id)) { if (isset($_REQUEST['forceterminate']) and !empty($_REQUEST['forceterminate'])) { if ($_REQUEST['forceterminate'] == 'lasttimedquestion') { // update last question F_updateQuestionLog($test_id, $testlog_id, $answer_id, $answer_text, $reaction_time); } // terminate the test (lock the test to status=4)
case 2: // absolute redirect header('Location: ' . K_PATH_HOST . $_SERVER['SCRIPT_NAME']); break; case 3: // html redirect echo $htmlredir; break; case 4: default: // full redirect header('Location: ' . K_PATH_HOST . $_SERVER['SCRIPT_NAME']); echo $htmlredir; break; } exit; } // check for test password if (isset($_POST['testpswaction']) and $_POST['testpswaction'] == 'login' and isset($_POST['xtest_password']) and isset($_POST['testid'])) { require_once '../../shared/code/tce_functions_test.php'; $tph = F_getTestPassword($_POST['testid']); if (getPasswordHash($_POST['xtest_password']) == $tph) { // test password is correct, save status on a session variable $_SESSION['session_test_login'] = getPasswordHash($tph . $_POST['testid'] . $_SESSION['session_user_id'] . $_SESSION['session_user_ip']); } else { F_print_error('WARNING', $l['m_wrong_test_password']); } } //============================================================+ // END OF FILE //============================================================+