Exemplo n.º 1
0
<?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";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/templates.php";
if (logged_in() && isset($_GET['questionName']) && isset($_GET['examID']) && isset($_GET['examCat']) && isset($_GET['questionID']) && isset($_GET['examName']) && isset($_GET['questionType'])) {
    $examCat = fix_string($_GET['examCat']);
    $examName = fix_string($_GET['examName']);
    $examID = fix_string($_GET['examID']);
    $questionName = fix_string($_GET['questionName']);
    $questionID = fix_string($_GET['questionID']);
    $questionType = fix_string($_GET['questionType']);
    if (!exam_exists($examID, $examName) || !question_exists($questionID, $examID) || !category_exists($examCat)) {
        go_home();
    }
    $get_script = "\$.getScript('javascript/question_edit.js');";
    $content = get_question_content($examID, $examName, $examCat, $questionID, $questionName, $questionType);
    get_main_template($content, $get_script);
} else {
    go_home();
}
Exemplo n.º 2
0
<?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";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/templates.php";
if (logged_in() && isset($_GET['examName']) && isset($_GET['examID']) && isset($_GET['examCat'])) {
    $examCat = fix_string($_GET['examCat']);
    $examID = fix_string($_GET['examID']);
    $examName = fix_string($_GET['examName']);
    if (!exam_exists($examID, $examName) || !category_exists($examCat)) {
        // checks if user has selected a real exam and category
        go_home();
    }
    $get_script = "\$.getScript('javascript/single_exam_edit.js');";
    $content = get_exam_content($examID, $examName, $examCat);
    get_main_template($content, $get_script);
} else {
    go_home();
}
Exemplo n.º 3
0
<?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";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/functions/templates.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/exam-simulator/private/classes/exam.php";
if (logged_in() && isset($_GET['catID']) && isset($_GET['examName']) && isset($_GET['examID'])) {
    $catID = fix_string($_GET['catID']);
    $examName = fix_string($_GET['examName']);
    $examID = fix_string($_GET['examID']);
    if (!category_exists($catID)) {
        go_home();
    }
    if (!exam_exists($examID, $examName)) {
        go_home();
    }
    $get_script = "\$.getScript('javascript/take_exam.js');";
    $exam = new Exam($catID, $examName, $examID);
    $content = $exam->get_form();
    get_main_template($content, $get_script);
} else {
    go_home();
}