class grade_support

internal  
 

Utility functions for Moodle grades.

Methods

static mixed
get_grade(int $courseid, int $userid, string $fields = '*', string|null $itemtype = null, bool $unique = false)

Retrieves grade data for a user in a specific course.

Details

at line 42
static mixed get_grade(int $courseid, int $userid, string $fields = '*', string|null $itemtype = null, bool $unique = false)

Retrieves grade data for a user in a specific course.

Parameters

int $courseid

Course ID

int $userid

User ID

string $fields

fields to select (default: '*')

string|null $itemtype

optional grade item type filter

bool $unique

if true, returns a single field value; otherwise returns an array of records

Return Value

mixed

scalar value|null if $unique is true, or array of stdClass records otherwise