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