public function get_questions_from_categories($categoryids, $extraconditions,
            $extraparams = array()) {
        global $DB;

        list($qcsql, $qcparams) = $DB->get_in_or_equal($categoryids, SQL_PARAMS_NAMED, 'qc');

        if ($extraconditions) {
            $extraconditions = ' AND (' . $extraconditions . ')';
        }

        return $DB->get_records_select_menu('question',
                "category {$qcsql}
                 AND parent = 0
                 AND hidden = 0
                 {$extraconditions}", $qcparams + $extraparams, '', 'id,id AS id2');
    }
public function get_questions_from_categories($categoryids, $extraconditions,
            $extraparams = array()) {
        global $DB;

        list($qcsql, $qcparams) = $DB->get_in_or_equal($categoryids, SQL_PARAMS_NAMED, 'qc');

        if ($extraconditions) {
            $extraconditions = ' AND (' . $extraconditions . ')';
        }

        return $DB->get_records_select_menu('question',
                "category {$qcsql}
                 AND parent = 0
                 AND hidden = 0
                 {$extraconditions}", $qcparams + $extraparams, '', 'id,id AS id2');
    }
public function get_questions_from_categories ( $ categoryids , $ extraconditions , $ extraparams = array ( ) ) { global $ DB ; list ( $ qcsql , $ qcparams ) = $ DB -> get_in_or_equal ( $ categoryids , SQL_PARAMS_NAMED , 'qc' ) ; if ( $ extraconditions ) { $ extraconditions = ' AND (' . $ extraconditions . ')' ; } return $ DB -> get_records_select_menu ( 'question' , "category {$qcsql}
                 AND parent = 0
                 AND hidden = 0
                 {$extraconditions}" , $ qcparams + $ extraparams , '' , 'id,id AS id2' ) ; }
Get the ids of all the questions in a list of categories.
@param array $categoryids either a categoryid, or a comma-separated list
category ids, or an array of them.
@param string $extraconditions extra conditions to AND with the rest of
the where clause. Must use named parameters.
@param array $extraparams any parameters used by $extraconditions.
@return array questionid => questionid.
Get the ids of all the questions in a list of categories .