Tutorlms_Helpers::was_quiz_attempt_successful( $attempt )
Checks if a quiz attempt was successful.
Contents
Parameters Parameters
- $attempt
-
(Required) object.
Source Source
File: src/integrations/tutorlms/helpers/tutorlms-helpers.php
public function was_quiz_attempt_successful( $attempt ) { // if the earned grade is less than or equal to zero, they failed. if ( $attempt->earned_marks <= 0 ) { return false; } // return pass or fail based on whether the required score was met. return ( $this->get_percentage_scored( $attempt ) >= $this->get_percentage_required( $attempt ) ); }
Expand full source code Collapse full source code View on Github
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |