Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_analytics\prediction Class Reference

Representation of a prediction. More...

Public Member Functions

 __construct ($prediction, $sampledata)
 Constructor.
 
 action_executed ($actionname, core_analytics\local\target\base $target)
 Stores the executed action.
 
 get_calculations ()
 Gets the prediction calculations.
 
 get_executed_actions (array $actionnamefilter=null, int $userid=0)
 Get the executed actions.
 
 get_prediction_data ()
 Get prediction object data.
 
 get_sample_data ()
 Get prediction sample data.
 

Public Attributes

const ACTION_FIXED = 'fixed'
 Prediction already fixed (one of the default prediction actions)
 
const ACTION_INCORRECTLY_FLAGGED = 'incorrectlyflagged'
 Prediction incorrectly flagged.
 
const ACTION_NOT_APPLICABLE = 'notapplicable'
 Prediction not applicable.
 
const ACTION_NOT_USEFUL = 'notuseful'
 Prediction not useful (one of the default prediction actions)
 
const ACTION_PREDICTION_DETAILS = 'predictiondetails'
 Prediction details (one of the default prediction actions)
 
const ACTION_USEFUL = 'useful'
 Prediction useful (one of the default prediction actions)
 

Detailed Description

Representation of a prediction.

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

Constructor & Destructor Documentation

◆ __construct()

core_analytics\prediction::__construct ( $prediction,
$sampledata )

Constructor.

Parameters
stdClass | int$prediction
array$sampledata
Return values
void

Member Function Documentation

◆ action_executed()

core_analytics\prediction::action_executed ( $actionname,
core_analytics\local\target\base $target )

Stores the executed action.

Prediction instances should be retrieved using core_analytics\manager\get_prediction, It is the caller responsability to check that the user can see the prediction.

Parameters
string$actionname
core_analytics\local\target\base$target

◆ get_calculations()

core_analytics\prediction::get_calculations ( )

Gets the prediction calculations.

Return values
array

◆ get_executed_actions()

core_analytics\prediction::get_executed_actions ( array $actionnamefilter = null,
int $userid = 0 )

Get the executed actions.

Actions could be filtered by actionname.

Parameters
array$actionnamefilterLimit the results obtained to this list of action names.
int$useridthe user id. Current user by default.
Return values
arrayof actions.

◆ get_prediction_data()

core_analytics\prediction::get_prediction_data ( )

Get prediction object data.

Return values
stdClass

◆ get_sample_data()

core_analytics\prediction::get_sample_data ( )

Get prediction sample data.

Return values
array

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