Tutorlms_Helpers::get_percentage_scored( object $attempt )

Calculates percentage scored.


Parameters Parameters

$attempt

(object) (Required) The quiz attempt object.


Top ↑

Return Return

(int)


Source Source

File: src/integrations/tutorlms/helpers/tutorlms-helpers.php

	public function get_percentage_scored( $attempt ) {
		return number_format( ( $attempt->earned_marks * 100 ) / $attempt->total_marks );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.