$test_id = eF_getTableData("tests", "id", "content_ID=" . $currentUnit['id']);
     $smarty->assign("T_UNIT_TEST_ID", $test_id[0]['id']);
 }
 $smarty->assign("T_UNIT", $currentUnit);
 $info = array('student_name' => $currentUser->user['name'], 'student_surname' => $currentUser->user['surname'], 'student_login' => $currentUser->user['login'], 'student_email' => $currentUser->user['email'] . "'", 'student_formatted_login' => formatLogin($currentUser->user['login']), 'lesson_name' => $currentLesson->lesson['name'], 'lesson_id' => $currentLesson->lesson['id'], 'course_name' => $currentCourse->course['name'], 'course_id' => $currentCourse->course['id'], 'timestamp' => time(), 'date' => formatTimestamp(time()));
 array_walk($info, create_function('&$v', '$v=htmlentities($v, ENT_QUOTES);'));
 $smarty->assign("T_INFORMATION_JSON", json_encode($info));
 if ($currentUnit['options']['complete_unit_setting'] == EfrontUnit::COMPLETION_OPTIONS_COMPLETEAFTERSECONDS) {
     $smarty->assign("T_REQUIRED_TIME_IN_UNIT", $currentUnit['options']['complete_time']);
 }
 //Next and previous units are needed for navigation buttons
 //package_ID denotes that a SCORM 2004 unit is active.
 if (!isset($_GET['package_ID'])) {
     $nextUnit = $currentContent->getNextNode($currentUnit, $visitableIterator);
     $smarty->assign("T_NEXT_UNIT", $nextUnit);
     $previousUnit = $currentContent->getPreviousNode($currentUnit, $visitableIterator);
     $smarty->assign("T_PREVIOUS_UNIT", $previousUnit);
     //Parents are needed for printing the titles
     $smarty->assign("T_PARENT_LIST", $currentContent->getNodeAncestors($currentUnit));
 } else {
     //SCORM 2004 content handles navigation on its own, so it's illegal to have additional navigation handles
     $smarty->assign("T_PARENT_LIST", $currentContent->getNodeAncestors($_GET['package_ID']));
     $smarty->assign("T_SCORM_2004_TITLE", true);
 }
 $comments = array();
 $result = array_merge(comments::getComments($currentLesson->lesson['id'], false, $currentUnit['id']), comments::getComments($currentLesson->lesson['id'], $currentUser, $currentUnit['id'], false, false));
 foreach ($result as $value) {
     if (!isset($comments[$value['id']])) {
         $comments[$value['id']] = $value;
     }
 }
         if (!$_change_) {
             throw new EfrontUserException(_UNAUTHORIZEDACCESS, EfrontUserException::RESTRICTED_USER_TYPE);
         }
         $currentQuestion = QuestionFactory::factory($_GET['delete_question']);
         $currentQuestion->delete();
     } catch (Exception $e) {
         header("HTTP/1.0 500 ");
         echo $e->getMessage() . ' (' . $e->getCode() . ')';
     }
     exit;
 } elseif (isset($_GET['show_test']) && in_array($_GET['show_test'], $legalValues) && eF_checkParameter($_GET['show_test'], 'id') || isset($_GET['view_unit']) && in_array($_GET['view_unit'], $legalUnits) && eF_checkParameter($_GET['view_unit'], 'id')) {
     if (isset($_GET['view_unit'])) {
         $showTest = new EfrontTest($_GET['view_unit'], true);
         $smarty->assign("T_UNIT", $currentUnit);
         $smarty->assign("T_NEXT_UNIT", $currentContent->getNextNode($currentUnit, $visitableIterator));
         $smarty->assign("T_PREVIOUS_UNIT", $currentContent->getPreviousNode($currentUnit, $visitableIterator));
         //Next and previous units are needed for navigation buttons
         $smarty->assign("T_PARENT_LIST", $currentContent->getNodeAncestors($currentUnit));
         //Parents are needed for printing the title
         $smarty->assign("T_SHOW_TOOLS", true);
         //Tools is the right upper corner table box, that lists tools such as 'upload files', 'copy content' etc
         if (EfrontUser::isOptionVisible('comments')) {
             $smarty->assign("T_COMMENTS", comments::getComments($_SESSION['s_lessons_ID'], false, $currentUnit['id']));
             //Retrieve any comments regarding this unit
         }
         $smarty->assign("T_SHOW_TOOLS", true);
         //Tools is the right upper corner table box, that lists tools such as 'upload files', 'copy content' etc
     } else {
         $showTest = new EfrontTest($_GET['show_test']);
     }
     $smarty->assign("T_CURRENT_TEST", $showTest);