Abstract xAPI result class.
More...
|
| __construct (stdClass $data, int $duration=null, item_score $score=null) |
| Function to create a result from part of the xAPI statement. More...
|
|
|
stdClass | $data |
| the item structure.
|
|
int | $duration |
| The second of duration if present.
|
|
item_score | $score |
| the result score if present.
|
|
Abstract xAPI result class.
- Copyright
- 2020 Ferran Recio
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __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 | $data | the original xAPI element |
int | $duration | duration in seconds |
item_score | $score | the provided score |
◆ 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 | $data | the original xAPI element |
- Return values
-
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
-
stdClass | the original data structure |
◆ get_duration()
core_xapi\local\statement\item_result::get_duration |
( |
| ) |
|
Returns the duration in seconds (if present).
- Return values
-
int|null | duration in seconds |
◆ get_score()
core_xapi\local\statement\item_result::get_score |
( |
| ) |
|
Returns the score.
- Return values
-
item_score|null | the score item |
◆ jsonSerialize()
core_xapi\local\statement\item::jsonSerialize |
( |
| ) |
|
|
inherited |
Return the data to serialize in case JSON statement is needed.
- Return values
-
stdClass | the original data structure |
The documentation for this class was generated from the following file: