AssignmentsReportsGenerator::getAssignmentScore( $activity )

Return the assignment score if available

Description

Source

File: bp-integrations/learndash/buddypress/generators/AssignmentsReportsGenerator.php

	protected function getAssignmentScore($activity)
	{
		$postId = $activity->assignment_id;

		if (! get_post_meta($postId, 'approval_status', true)) {
			return '-';
		}

		$assignmentSettingId = intval( get_post_meta( $postId, 'lesson_id', true ) );

		if (empty($assignmentSettingId)) {
			return '-';
		}

		$maxPoints = learndash_get_setting($assignmentSettingId, 'lesson_assignment_points_amount');

		return sprintf(
			_x(
				'%1$s / %2$s',
				'placeholders: current points / maximum point',
				'buddyboss'
			),
			get_post_meta($postId, 'points', true),
			$maxPoints
		);
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.