<?php

//----------------------------------------
// Publish the quiz
//----------------------------------------
require "../modules/quiz.php";
if (isset($_GET['id'])) {
    $quiz = new Quiz($_GET['id']);
    if ($quiz->exists()) {
        $quiz_exist = true;
        // check if member is owner of the quiz
        if ($quiz->isOwner($member->id)) {
            // set the quiz as published
            $quiz->republish($member->id);
        }
    } else {
        $quiz_exist = false;
    }
} else {
    $quiz_exist = false;
}
if ($quiz_exist) {
    ?>
<div class="framePanel rounded">
<h2 id="title_quiz_result">Quiz Updated!</h2>
<div class="content-container"><p>
You have successfully updated your quiz. Your quiz will now be available under the topic <?php 
    echo $quiz->category();
    ?>
. It will also turn up in search queries. You will continue to receive points when users take your quiz! Good luck!</p>
</div></div>