dozent_get_question_types( string $question_type = null )

Get all available quiz question types


Description

Pass question tipe as parameter to get specific quesiton type info


Parameters

$question_type

(string) (Optional)

Default value: null


Return

(mixed|string|void)


Source

File: includes/quiz-functions.php

	function dozent_get_question_types( $question_type = null ) {

		$types = [
			'true_false' => [
				'label' => __( 'True False', 'dozent' ),
				'icon'  => 'dicon-true-false',
			],
			'radio'      => [
				'label' => __( 'Single Choice', 'dozent' ),
				'icon'  => 'dicon-radio-checked',
			],
			'checkbox'   => [
				'label' => __( 'Multiple Choice', 'dozent' ),
				'icon'  => 'dicon-checkbox-checked',
			],
			'text'       => [
				'label' => __( 'Single Text', 'dozent' ),
				'icon'  => 'dicon-pencil-alt',
			],
			'textarea'   => [
				'label' => __( 'Multi Text', 'dozent' ),
				'icon'  => 'dicon-file-document',
			],
		];


		/**
		 * Filter the dozent_get_question_types() return
		 *
		 * @since DozentLMS 1.0.0
		 *
		 * @param  string  $icon_name
		 * @param  string  $question_type
		 */

		$types = apply_filters( 'dozent_get_question_types', $types, $question_type );

		if ( $question_type ) {
			$single_type = dozent_array_get( $question_type, $types );

			/**
			 * Filter single question type returns by dozent_get_question_types();
			 *
			 * @since DozentLMS 1.0.0
			 *
			 * @param  string  $single_type  Specific Question Type as array
			 * @param  string  $question_type
			 */

			return apply_filters( 'dozent_get_single_question_type', $single_type, $question_type );
		}

		return $types;
	}