コード例 #1
0
function game_exmportjavame_getanswers_quiz($game, $context, $destdir, $files)
{
    global $CFG;
    $select = "quiz='{$game->quizid}' " . " AND qqi.question=q.id" . " AND q.hidden=0" . game_showanswers_appendselect($game);
    $table = "question q,{$CFG->prefix}quiz_question_instances qqi";
    return game_exmportjavame_getanswers_question_select($game, $context, $table, $select, "q.*", $game->course, $destdir, $files);
}
コード例 #2
0
function game_showanswers_question($game)
{
    global $DB;
    if ($game->gamekind != 'bookquiz') {
        $select = ' category=' . $game->questioncategoryid;
        if ($game->subcategories) {
            $cats = question_categorylist($game->questioncategoryid);
            if (strpos($cats, ',') > 0) {
                $select = ' category in (' . $cats . ')';
            }
        }
    } else {
        $context = get_context_instance(50, $COURSE->id);
        $select = " contextid in ({$context->id})";
        $select2 = '';
        if ($recs = $DB->get_records_select('question_categories', $select, null, 'id,id')) {
            foreach ($recs as $rec) {
                $select2 .= ',' . $rec->id;
            }
        }
        $select = ' AND category IN (' . substr($select2, 1) . ')';
    }
    $select .= ' AND hidden = 0 ';
    $select .= game_showanswers_appendselect($game);
    $showcategories = $game->gamekind == 'bookquiz';
    $order = $showcategories ? 'category,questiontext' : 'questiontext';
    game_showanswers_question_select($game, '{question} q', $select, '*', $order, $showcategories, $game->course);
}
コード例 #3
0
function game_showanswers_quiz($game, $context)
{
    global $CFG;
    if (game_get_moodle_version() < '02.07') {
        $select = "quiz='{$game->quizid}' " . ' AND qqi.question=q.id' . ' AND q.hidden=0' . game_showanswers_appendselect($game);
        $table = '{question} q,{quiz_question_instances} qqi';
    } else {
        $select = "qs.quizid='{$game->quizid}' " . " AND qs.questionid=q.id " . game_showanswers_appendselect($game);
        $table = "{question} q,{quiz_slots} qs";
    }
    game_showanswers_question_select($game, $table, $select, 'q.*', 'category,questiontext', false, $game->course, $context);
}
コード例 #4
0
function game_exmportjavame_getanswers_quiz($game)
{
    global $CFG;
    $select = "quiz='{$game->quizid}' " . " AND qzi.question=q.id" . " AND q.hidden=0" . game_showanswers_appendselect($game);
    $table = "{question} q,{quiz_question_instances} qqi";
    return game_exmportjavame_getanswers_question_select($game, $table, $select, "q.*", 'category,questiontext', true, $game->course);
}
コード例 #5
0
ファイル: showanswers.php プロジェクト: vinoth4891/clinique
function game_showanswers_quiz($game)
{
    global $CFG;
    $select = "quiz='{$game->quizid}' " . ' AND qqi.question=q.id' . ' AND q.hidden=0' . game_showanswers_appendselect($game);
    $table = '{question} q,{quiz_question_instances} qqi';
    game_showanswers_question_select($game, $table, $select, 'q.*', 'category,questiontext', false, $game->course);
}
コード例 #6
0
function game_exmportjavame_getanswers_quiz($game)
{
    global $CFG;
    $select = "quiz='{$game->quizid}' " . " AND {$CFG->prefix}quiz_question_instances.question={$CFG->prefix}question.id" . " AND {$CFG->prefix}question.hidden=0" . game_showanswers_appendselect($game);
    $table = "question,{$CFG->prefix}quiz_question_instances";
    return game_exmportjavame_getanswers_question_select($game, $table, $select, "{$CFG->prefix}question.*", 'category,questiontext', true, $game->course);
}