LLMS_Quiz_Attempt
LLMS_Quiz_Attempt model class
Description Description
Source Source
File: includes/models/model.llms.quiz.attempt.php
Changelog Changelog
Version | Description |
---|---|
4.3.0 | Added $type property declaration. |
4.2.0 | Use strict type comparisons where possible. In the l10n() method, made sure the status key exists to avoid trying to access to array's undefined index. Added the public method get_siblings() . |
4.0.0 | Remove reliance on deprecated method LLMS_Quiz::get_passing_percent() & remove deprecated class method get_status() . Fix issue encountered when answering a question incorrectly after initially answering it correctly. |
3.9.2 | Added calculate_point_weight() , get_question_order() , is_passing() methods. |
3.9.0 | |
3.29.0 | Unknown. |
3.26.3 | Unknown. |
3.24.0 | Unknown. |
3.19.2 | Unknown. |
3.17.1 | Unknown. |
3.16.7 | Unknown. |
3.16.0 | Introduced. |
Methods Methods
- __construct — Constructor
- answer_question — Answer a question
- calculate_grade — Calculate and the grade for a completed quiz
- calculate_point_weight — Calculate the weight of each point
- delete — Delete the object from the database
- do_completion_actions — Run actions designating quiz completion
- end — End a quiz attempt
- get_count — Retrieve a count for various pieces of information related to the attempt
- get_date — Retrieve a formatted date
- get_first_question — Retrieve the first question for the attempt
- get_key — Get an encoded attempt key that can be passed in URLs and the like
- get_new_questions — Retrieve an array of blank questions for insertion into a new attempt during initialization
- get_next_question — Retrieve the next unanswered question in the attempt
- get_permalink — Retrieve a permalink for the attempt
- get_question_objects — Retrieve an array of attempt question objects
- get_question_order — Get the numeric order of a question in a given quiz
- get_questions — Get array of serialized questions
- get_quiz — Get an instance of the LLMS_Quiz for the attempt
- get_siblings — Get sibling attempts
- get_student — Get an LLMS_Student for the quiz
- get_time — Get the time spent on the quiz from start to end
- get_title — Retrieve a title-like string
- init — Initialize a new quiz attempt by quiz and lesson for a user
- is_auto_gradeable — Determine if the attempt can be autograded
- is_passing — Determine if the attempt was passing
- l10n — Translate attempt related strings
- set_questions — Setter for serialized questions array
- set_status — Set the status of the attempt
- start — Record the attempt as started
- to_array — Retrieve the private data array