Beispiel #1
0
    $_SESSION['user']['quiz']['quiz_id'] = $_GET['quiz_id'];
}
if (isset($_SESSION['user']['quiz']['quiz_id']) && $_SESSION['user']['quiz']['quiz_id'] != "") {
    $quiz_id = $_SESSION['user']['quiz']['quiz_id'];
} else {
    redirect_to("take-quizzes.php");
}
?>
<style>
.correct{color:#008000;}
.your-ans{border:1px solid; padding-right:20px;}

</style>
<!-- Query database for all users -->
<?php 
$questions_list = get_quiz_questions($quiz_id);
$total = $questions_list->num_rows;
/*
parse_str($_SERVER["QUERY_STRING"], $output);
unset($output['page']);
$get_query = http_build_query($output, '', '&amp;');



$targetpage = "quiz.php?$get_query"; //your file name
$limit = 10; //how many items to show per page
$p = (isset($_GET['page']))? $_GET['page']:"";

if($p)
	$start = ($p - 1) * $limit; //first item to display on this page
else
}
if (!empty($message)) {
    print_r($message);
}
?>



      
      <div class="col-lg-12">

      
        <div class="panel tbp-panel-inverse">
          <div class="panel-heading">
            <?php 
$linked_questions = get_quiz_questions($id);
?>
            <h4><?php 
echo $quiz["quiz_name"];
?>
<span> - There are <?php 
echo mysqli_num_rows($linked_questions);
?>
 Questions Linked to this Quiz.</span></h4>
          </div>
          <div class="panel-body">

              <form id="edit-quiz-form"  role="form" action="edit-quiz.php?quiz_id=<?php 
echo $quiz["quiz_id"];
?>
" method="post">
Beispiel #3
0
    echo "numofQuestions=" . $numQuestions;
    if ($arrCount > $numQuestions) {
        unset($_SESSION['answer_array']);
        header("location: quizIndex.php");
        exit;
    }
    if ($arrCount >= $numQuestions) {
        echo 'finished|<p>There are no more questions. Please enter your first and last name and click next</p>
				<form action="userAnswers.php" method="post">
				<input type="hidden" name="complete" value="true">
				<input type="text" name="username">
				<input type="submit" value="Finish">
				</form>';
        exit;
    }
    get_quiz_questions($question, $answers);
    print "";
    print_r($_POST);
    print "";
    /* $singleSQL = mysql_query("SELECT * FROM questions WHERE id='$question' LIMIT 1");
    	while($row = mysql_fetch_array($singleSQL)){
    		$id = $row['id'];
    		$thisQuestion = $row['question'];
    		$type = $row['type'];
    		$question_id = $row['question_id'];
    		$q = '<h2>'.$thisQuestion.'</h2>';
    		$sql2 = mysql_query("SELECT * FROM answers WHERE question_id='$question' ORDER BY rand()");
    		while($row2 = mysql_fetch_array($sql2)){
    			$answer = $row2['answer'];
    			$correct = $row2['correct'];
    			$answers .= '<label style="cursor:pointer;"><input type="radio" name="rads" value="'.$correct.'">'.$answer.'</label> 
Beispiel #4
0
<?php

require 'includes/connect.php';
require 'includes/utils.php';
$data = get_quiz_questions();
do_output(true, $data);