本文整理汇总了PHP中quiz::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz::getAll方法的具体用法?PHP quiz::getAll怎么用?PHP quiz::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz
的用法示例。
在下文中一共展示了quiz::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quiz
<?php
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['list']);
$cms = new quiz();
if (isset($_GET['up']) || isset($_GET['down'])) {
$cms->tableName = 'quiz';
$cms->idColumn = 'id';
if (isset($_GET['up']) && is_numeric($_GET['up'])) {
$cms->moveUp($_GET['up']);
} elseif (isset($_GET['down']) && is_numeric($_GET['down'])) {
$cms->moveDown($_GET['down']);
}
}
$data = $cms->getAll(START, LIMIT);
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=list&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
示例2: refresh
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
if (!check_login_bool()) {
refresh('/' . $languageURL . 'sign_in/');
}
$quizClass = new quiz();
$answersClass = new answers();
$questions = $quizClass->getAll(0, 0, '', 'RAND()');
abr('questions', $questions);
$answers = $answersClass->getAll(0, 0, '', true);
abr('answers', $answers);
if ($_SESSION['user']['quiz'] != 'false') {
refresh('/' . $languageURL . 'author_dashboard/');
}
#检查测验
if (isset($_POST['submit'])) {
$rightAnswers = 0;
if (isset($_POST['answers']) && is_array($_POST['answers'])) {
foreach ($_POST['answers'] as $question => $answer) {
if (isset($answers[$question][$answer]) && $answers[$question][$answer]['right'] == 'true') {
$rightAnswers++;
}
}