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
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 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. |