LLMS_Quiz_Attempt::end( boolean $silent = false )
End a quiz attempt Sets end date, unsets the quiz as the current quiz, and records a grade
Description Description
Parameters Parameters
- $silent
-
(boolean) (Optional) if true, will not trigger actions or mark related lesson as complete
Default value: false
Return Return
($this)
Source Source
File: includes/models/model.llms.quiz.attempt.php
public function end( $silent = false ) { $this->set( 'end_date', current_time( 'mysql' ) ); $this->calculate_grade()->save(); if ( ! $silent ) { $this->do_completion_actions(); } // clear "cached" grade so it's recalculated next time it's requested $this->get_student()->set( 'overall_grade', '' ); return $this; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.9.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: