Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core_xapi\local\statement\item_result Class Reference

Abstract xAPI result class. More...

Inheritance diagram for core_xapi\local\statement\item_result:
core_xapi\local\statement\item

Public Member Functions

 get_data ()
 Return the original data from this item. More...
 
 get_duration ()
 Returns the duration in seconds (if present). More...
 
 get_score ()
 Returns the score. More...
 
 jsonSerialize ()
 Return the data to serialize in case JSON statement is needed. More...
 

Static Public Member Functions

static create_from_data (stdClass $data)
 Function to create an item from part of the xAPI statement. More...
 

Protected Member Functions

 __construct (stdClass $data, int $duration=null, item_score $score=null)
 Function to create a result from part of the xAPI statement. More...
 

Protected Attributes

stdClass $data
 the item structure.
 
int $duration
 The second of duration if present.
 
item_score $score
 the result score if present.
 

Detailed Description

Abstract xAPI result class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_xapi\local\statement\item_result::__construct ( stdClass  $data,
int  $duration = null,
item_score  $score = null 
)
protected

Function to create a result from part of the xAPI statement.

Parameters
stdClass$datathe original xAPI element
int$durationduration in seconds
item_score$scorethe provided score

Member Function Documentation

◆ create_from_data()

static core_xapi\local\statement\item_result::create_from_data ( stdClass  $data)
static

Function to create an item from part of the xAPI statement.

Parameters
stdClass$datathe original xAPI element
Return values
itemitem_result xAPI generated

Reimplemented from core_xapi\local\statement\item.

◆ get_data()

core_xapi\local\statement\item::get_data ( )
inherited

Return the original data from this item.

Return values
stdClassthe original data structure

◆ get_duration()

core_xapi\local\statement\item_result::get_duration ( )

Returns the duration in seconds (if present).

Return values
int|nullduration in seconds

◆ get_score()

core_xapi\local\statement\item_result::get_score ( )

Returns the score.

Return values
item_score|nullthe score item

◆ jsonSerialize()

core_xapi\local\statement\item::jsonSerialize ( )
inherited

Return the data to serialize in case JSON statement is needed.

Return values
stdClassthe original data structure

The documentation for this class was generated from the following file: