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); }
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); }
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); }
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); }
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); }
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); }