$load_editor = true; include_once "module_surveys.php"; } elseif ($ctg == 'statistics') { if (isset($_GET['show_solved_test']) && eF_checkParameter($_GET['show_solved_test'], 'id') && isset($_GET['lesson']) && eF_checkParameter($_GET['lesson'], 'id')) { try { //pr($_GET['lesson']);pr($currentUser -> getLessons()); if (in_array($_GET['lesson'], array_keys($currentUser->getLessons()))) { $result = eF_getTableData("done_tests, tests, content", "done_tests.tests_ID, done_tests.users_LOGIN", "content.id=tests.content_ID and content.lessons_ID=" . $_GET['lesson'] . " and tests.id = done_tests.tests_ID and done_tests.users_LOGIN = '******'login'] . "' and done_tests.id=" . $_GET['show_solved_test']); if (sizeof($result) > 0) { $showTest = new EfrontTest($result[0]['tests_ID']); //Set "show answers" and "show given answers" to true, since if it is not the student that sees the test if ($currentUser->user['user_type'] != 'student') { $showTest->options['answers'] = 1; $showTest->options['given_answers'] = 1; } $showTest->setDone($result[0]['users_LOGIN']); $smarty->assign("T_CURRENT_TEST", $showTest->test); $smarty->assign("T_SOLVED_TEST_DATA", $showTest->doneInfo); $smarty->assign("T_TEST_SOLVED", $showTest->toHTMLQuickForm(new HTML_Quickform(), false, true)); } else { $message = _USERHASNOTDONETEST; $message_type = 'failure'; } } else { $message = _USERHASNOTTHISLESSON; $message_type = 'failure'; } } catch (Exception $e) { $smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString()); $message = $e->getMessage() . ' (' . $e->getCode() . ') <a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>'; $message_type = 'failure';