LLMS_Question::create_choice( array $data )

Create a new question choice


Parameters Parameters

$data

(array) (Required) Array of question choice data.


Top ↑

Return Return

(string|boolean)


Top ↑

Source Source

File: includes/models/model.llms.question.php

	public function create_choice( $data ) {

		$data = wp_parse_args(
			$data,
			array(
				'choice'      => '',
				'choice_type' => 'text',
				'correct'     => false,
				'marker'      => $this->get_next_choice_marker(),
				'question_id' => $this->get( 'id' ),
			)
		);

		$choice = new LLMS_Question_Choice( $this->get( 'id' ) );
		if ( $choice->create( $data ) ) {
			return $choice->get( 'id' );
		}

		return false;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.