Ejemplo n.º 1
0
<?php

//$handle=new mysqli('localhost','root','','sygma');
require "class.quiz.php";
$q = new quiz();
$q->createQuiz($_POST);
header('create_question.php');
Ejemplo n.º 2
0
 */
if ($_SESSION['username'] != "") {
    require_once 'web/core/navigation.php';
    if ($_SESSION['utype'] >= '5') {
        // get and initiate the course class to access the functions
        require_once 'src/core/controller/classes.php';
        $ObjClass = new classes();
        require_once 'src/core/controller/quiz.php';
        $ObjQuiz = new quiz();
        // set class id for form and links
        if ($_POST['classid'] != "") {
            $classid = $_POST['classid'];
        } else {
            $classid = $d;
        }
        if ($_POST['y'] == 'quiz' && $_POST['z'] == 'create' && $_POST['action'] == "save") {
            $createContent = $ObjQuiz->createQuiz($_POST['quizTitle'], $_POST['quizState'], $_POST['quizDescription'], $ObjClass->convertUUIDToClassID($_POST['classid']));
            if ($createContent !== false) {
                $responseMsg = "Your quiz has been created successfully";
            } else {
                $responseMsg = "Could not create your quiz at this time - something went wrong, sorry";
            }
        }
        // create the view for coursek information
        require_once 'web/core/quiz/create.php';
    } else {
        require_once 'web/core/security/insufficientrights.php';
    }
} else {
    require_once 'web/core/login/index.php';
}