Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
core_analytics\prediction Class Reference

Representation of a prediction. More...

Public Member Functions

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

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: