Exemplo n.º 1
0
    echo $e;
}
//Delete subject
if (isset($_POST['deleteID'])) {
    delete_subject($_POST['deleteID']);
}
##Questions code:
//Get topic list from subjects:
if (isset($_POST['subjID'])) {
    //Get the subjects and echo them so we can grab the DATA
    $topics = showTopics($_POST['subjID']);
    echo json_encode($topics);
}
//Show questions if the topic ID has been set
if (isset($_POST['topicID'])) {
    $questions = showQuestions($_POST['topicID']);
    echo json_encode($questions);
}
//Insert question if a request has been made
if (isset($_POST['addQ'])) {
    //GET POST VARS
    $topic_ID = $_POST['topic_ID'];
    $quest = $_POST['quest'];
    $diff = $_POST['diff'];
    $isMultiple = $_POST['isMultiple'];
    //Grab the arrays made from input fields and decode
    $correct = json_decode($_POST['correct']);
    $options = json_decode($_POST['options']);
    if ($quest == "") {
        echo 1;
        return;
Exemplo n.º 2
0
    }
    echo mysql_num_rows($data) . " questions<br />";
    foreach ($out as $o) {
        echo "<div>(" . $o["id"] . ") " . $o["content"] . "</div>";
        //print_r($o);
    }
}
//root@ns368978.ovh.net
//http://ns368978.ovh.net:3306
$handle = mysql_connect("ns368978.ovh.net", "ws_users_preprod", "tat-preprod") or die("Connection error");
mysql_select_db("admin_tour-a-tour_preprod") or die("Selection error");
echo "<br /><div>DB = admin_tour-a-tour_preprod</div>";
showQuestions();
mysql_close($handle);
$handle = mysql_connect("ns368978.ovh.net", "ws_user", "concert") or die("Connection error");
mysql_select_db("dring93_tour-a-tour") or die("Selection error");
echo "<br /><div>DB = dring93_tour-a-tour</div>";
showQuestions();
mysql_close($handle);
?>
    
    <?php 
include "analytics.php";
?>
    <?php 
include "text-to-speech-toggle.php";
?>
  </body>

</html>