LLMS_Question
LLMS Quiz Question Model class
Description Description
Source Source
File: includes/models/model.llms.question.php
Changelog Changelog
Version | Description |
---|---|
4.0.0 | Remove deprecated class methods. |
3.38.2 | When getting the 'not raw' question_type, made sure to always return a valid value. |
3.35.0 | Escape LIKE clause when retrieving choices. |
3.30.1 | Fixed choice sorting issues. |
1.0.0 | Introduced. |
Methods Methods
- create_choice — Create a new question choice
- delete_choice — Delete a choice by ID
- get — Getter
- get_auto_grade_type — Retrieve the type of automatic grading that can be performed on the question
- get_choice — Retrieve a choice by id
- get_choices — Retrieve the question's choices
- get_conditional_correct_value — Retrieve the correct values for a conditionally graded question
- get_correct_choice — Retrieve correct choices for a given question
- get_creation_args — An array of default arguments to pass to $this->create() when creating a new post
- get_description — Retrieve the question description (post_content)
- get_image — Retrieve URL for an image associated with the question if it's enabled
- get_next_choice_marker — Retrieve the next marker for question choices
- get_question — Get the question text (title)
- get_question_type — Retrieve question type data for the given question
- get_questions — Retrieve child questions (for question group)
- get_quiz — Retrieve an instance of the questions parent LLMS_Quiz
- get_quizzes — Retrieve quizzes this quiz is assigned to
- get_video — Retrieve video embed for question featured video
- grade — Attempt to grade a question
- has_description — Determine if a description is enabled and not empty
- has_image — Determine if a featured image is enabled and not empty
- has_video — Determine if a featured video is enabled & not empty
- is_orphan — Determine if the question is an orphan
- questions — Access question manager (used for question groups)
- sort_choices — Sort choices by marker.
- supports — Determine if the question supports a question feature
- toArrayAfter — Called before data is sorted and returned by $this->toArray()
- toArrayCustom — Don't add custom fields during toArray()
- update_choice — Update a question choice