LLMS_Question::create_choice( array $data )
Create a new question choice
Parameters Parameters
- $data
-
(array) (Required) Array of question choice data.
Return Return
(string|boolean)
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; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.0 | Introduced. |