Exemplo n.º 1
0
    $content_base_href = 'get.php/';
} else {
    $course_base_href = 'content/' . $_SESSION['course_id'] . '/';
}
require AT_INCLUDE_PATH . 'header.inc.php';
/* Retrieve the content_id of this test */
$num_questions = $test_row['num_questions'];
$content_id = $test_row['content_id'];
$anonymous = $test_row['anonymous'];
$instructions = $test_row['instructions'];
$title = $test_row['title'];
$_letters = array(_AT('A'), _AT('B'), _AT('C'), _AT('D'), _AT('E'), _AT('F'), _AT('G'), _AT('H'), _AT('I'), _AT('J'));
// this is a kludge to get the question number incremented.
// a diff approach could be to pass the position to the display() method.
for ($i = 0; $i < $pos; $i++) {
    TestQuestionCounter(true);
}
// retrieve the test questions that were saved to `tests_answers`
if ($test_row['random']) {
    $sql = "SELECT R.*, A.*, Q.* FROM " . TABLE_PREFIX . "tests_answers R INNER JOIN " . TABLE_PREFIX . "tests_questions_assoc A USING (question_id) INNER JOIN " . TABLE_PREFIX . "tests_questions Q USING (question_id) WHERE R.result_id={$result_id} AND A.test_id={$tid} ORDER BY Q.question_id LIMIT {$pos}, 1";
} else {
    $sql = "SELECT R.*, A.*, Q.* FROM " . TABLE_PREFIX . "tests_answers R INNER JOIN " . TABLE_PREFIX . "tests_questions_assoc A USING (question_id) INNER JOIN " . TABLE_PREFIX . "tests_questions Q USING (question_id) WHERE R.result_id={$result_id} AND A.test_id={$tid} ORDER BY A.ordering, Q.question_id LIMIT {$pos}, 1";
}
$result = mysql_query($sql, $db);
$question_row = mysql_fetch_assoc($result);
if (!$result || !$question_row) {
    echo '<p>' . _AT('no_questions') . '</p>';
    require AT_INCLUDE_PATH . 'footer.inc.php';
    exit;
}
?>
Exemplo n.º 2
0
 function displayHeader($weight, $score = FALSE, $question_id = FALSE)
 {
     TestQuestionCounter(TRUE);
     if ($score) {
         $score = intval($score);
     }
     $this->savant->assign('question_id', $question_id);
     $this->savant->assign('score', $score);
     $this->savant->assign('weight', $weight);
     $this->savant->assign('type', _AT($this->sNameVar));
     $this->savant->assign('number', TestQuestionCounter());
     $this->savant->display('test_questions/header.tmpl.php');
 }