Documentation

CourseProgress
in package

CourseProgress Object

Represents a user's progress through a course in Canvas LMS. This is a read-only object that is embedded within Course responses when requested.

Table of Contents

Properties

$completedAt  : string|null
Date the course was completed Null if the course has not been completed by this user
$nextRequirementUrl  : string|null
URL to next module item that has an unmet requirement Null if the user has completed the course or the current module does not require sequential progress
$requirementCompletedCount  : int|null
Total number of requirements the user has completed from all modules
$requirementCount  : int|null
Total number of requirements from all modules

Methods

__construct()  : mixed
Constructor
getCompletedAt()  : string|null
Get the completion date
getCompletionPercentage()  : float
Get the completion percentage
getNextRequirementUrl()  : string|null
Get the next requirement URL
getRemainingRequirements()  : int
Get remaining requirements count
getRequirementCompletedCount()  : int|null
Get the completed requirement count
getRequirementCount()  : int|null
Get the total requirement count
hasMoreRequirements()  : bool
Check if there are more requirements to complete
isCompleted()  : bool
Check if the course is completed
setCompletedAt()  : void
Set the completion date
setNextRequirementUrl()  : void
Set the next requirement URL
setRequirementCompletedCount()  : void
Set the completed requirement count
setRequirementCount()  : void
Set the total requirement count
toArray()  : array<string|int, mixed>
Convert to array

Properties

$completedAt

Date the course was completed Null if the course has not been completed by this user

public string|null $completedAt = null

$nextRequirementUrl

URL to next module item that has an unmet requirement Null if the user has completed the course or the current module does not require sequential progress

public string|null $nextRequirementUrl = null

$requirementCompletedCount

Total number of requirements the user has completed from all modules

public int|null $requirementCompletedCount = null

$requirementCount

Total number of requirements from all modules

public int|null $requirementCount = null

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

getCompletedAt()

Get the completion date

public getCompletedAt() : string|null
Return values
string|null

getCompletionPercentage()

Get the completion percentage

public getCompletionPercentage() : float
Return values
float

getNextRequirementUrl()

Get the next requirement URL

public getNextRequirementUrl() : string|null
Return values
string|null

getRemainingRequirements()

Get remaining requirements count

public getRemainingRequirements() : int
Return values
int

getRequirementCompletedCount()

Get the completed requirement count

public getRequirementCompletedCount() : int|null
Return values
int|null

getRequirementCount()

Get the total requirement count

public getRequirementCount() : int|null
Return values
int|null

hasMoreRequirements()

Check if there are more requirements to complete

public hasMoreRequirements() : bool
Return values
bool

isCompleted()

Check if the course is completed

public isCompleted() : bool
Return values
bool

setCompletedAt()

Set the completion date

public setCompletedAt(string|null $completedAt) : void
Parameters
$completedAt : string|null

setNextRequirementUrl()

Set the next requirement URL

public setNextRequirementUrl(string|null $nextRequirementUrl) : void
Parameters
$nextRequirementUrl : string|null

setRequirementCompletedCount()

Set the completed requirement count

public setRequirementCompletedCount(int|null $requirementCompletedCount) : void
Parameters
$requirementCompletedCount : int|null

setRequirementCount()

Set the total requirement count

public setRequirementCount(int|null $requirementCount) : void
Parameters
$requirementCount : int|null

toArray()

Convert to array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results