Ejemplo n.º 1
0
     $message_type = 'success';
     if (isset($messageString)) {
         $message = implode("<br/>", $messageString);
         $message_type = 'failure';
     }
 }
 // Optionally ajaxed request - if not ajaxed then it should show the tests list
 if (isset($_GET['delete_solved_test']) && eF_checkParameter($_GET['delete_solved_test'], 'id')) {
     if (isset($currentUser->coreAccess['skillgaptests']) && $currentUser->coreAccess['skillgaptests'] != 'change') {
         eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
         exit;
     }
     try {
         //eF_deleteTableData("completed_tests", "id = " . $_GET['delete_solved_test']);
         $currentTest = new EfrontTest($_GET['test_id']);
         $currentTest->undo($_GET['users_login'], $_GET['delete_solved_test']);
         if ($skillgap_tests) {
             // Remove a solved test from the users_to_skillgap list
             eF_updateTableData("users_to_skillgap_tests", array("solved" => 0), "tests_id = " . $_GET['test_id'] . " AND users_login = '******'users_login'] . "'");
         }
     } catch (Exception $e) {
         if ($_GET['postAjaxRequest']) {
             header("HTTP/1.0 500 ");
             echo $e->getMessage() . ' (' . $e->getCode() . ')';
         } else {
             throw $e;
         }
     }
     if ($_GET['postAjaxRequest']) {
         exit;
     }