<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/sql_functions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/session_functions.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/input.php";
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $examID = fix_string($_POST['examID']);
    $examCat = fix_string($_POST['examCat']);
    delete_exam_contents($examID);
    delete_exam($examID);
    deincrement_exam($examCat);
} else {
    go_home();
}
Exemplo n.º 2
0
<?php

include "designtemplate.php";
include "database.php";
include "functions.php";
include "validation.php";
verify_authorization("admin");
connect();
?>

<?php 
if (isset($_POST['delete_exam'])) {
    delete_exam($_POST['exam_id']);
    header("Location: examinations.php");
}
?>

<?php 
$exam_name = $_GET['exam_name'];
$exam_id = $_GET['exam_id'];
$in_exam = array();
$questions = get_questions();
$exam_questions = get_exam_questions($exam_id);
foreach ($exam_questions as $i => $quest) {
    $in_exam[$quest['ID']] = true;
}
foreach ($questions as $i => $quest) {
    if (!isset($in_exam[$quest['ID']])) {
        $in_exam[$quest['ID']] = false;
    }
}