public static function get_quiz_required_qtypes($quizid) {
        global $DB, $USER;

        $warnings = array();

        $params = array(
            'quizid' => $quizid
        );
        $params = self::validate_parameters(self::get_quiz_required_qtypes_parameters(), $params);

        list($quiz, $course, $cm, $context) = self::validate_quiz($params['quizid']);

        $quizobj = quiz::create($cm->instance, $USER->id);
        $quizobj->preload_questions();
        $quizobj->load_questions();

        // Question types used.
        $result = array();
        $result['questiontypes'] = $quizobj->get_all_question_types_used(true);
        $result['warnings'] = $warnings;
        return $result;
    }
public static function get_quiz_required_qtypes($quizid) {
        global $DB, $USER;

        $warnings = array();

        $params = array(
            'quizid' => $quizid
        );
        $params = self::validate_parameters(self::get_quiz_required_qtypes_parameters(), $params);

        list($quiz, $course, $cm, $context) = self::validate_quiz($params['quizid']);

        $quizobj = quiz::create($cm->instance, $USER->id);
        $quizobj->preload_questions();
        $quizobj->load_questions();

        // Question types used.
        $result = array();
        $result['questiontypes'] = $quizobj->get_all_question_types_used(true);
        $result['warnings'] = $warnings;
        return $result;
    }
public static function get_quiz_required_qtypes ( $ quizid ) { global $ DB , $ USER ; $ warnings = array ( ) ; $ params = array ( 'quizid' => $ quizid ) ; $ params = self :: validate_parameters ( self :: get_quiz_required_qtypes_parameters ( ) , $ params ) ; list ( $ quiz , $ course , $ cm , $ context ) = self :: validate_quiz ( $ params [ 'quizid' ] ) ; $ quizobj = quiz :: create ( $ cm -> instance , $ USER -> id ) ; $ quizobj -> preload_questions ( ) ; $ quizobj -> load_questions ( ) ; // Question types used. $ result = array ( ) ; $ result [ 'questiontypes' ] = $ quizobj -> get_all_question_types_used ( true ) ; $ result [ 'warnings' ] = $ warnings ; return $ result ; }
Return the potential question types that would be required for a given quiz.
Please note that for random question types we return the potential question types in the category choosen.

@param int $quizid quiz instance id
@return array of warnings and the access information
@since Moodle 3.1
@throws  moodle_quiz_exception
Return the potential question types that would be required for a given quiz . Please note that for random question types we return the potential question types in the category choosen .