Representation of a suggested action associated with a prediction.
More...
|
static | transform_to_forward_url (\moodle_url $actionurl, string $actionname, int $predictionid) |
| Transforms the provided url to an action url so we can record the user actions.
|
|
|
Action const | TYPE_NEGATIVE = 'notuseful' |
| type notuseful.
|
|
Action const | TYPE_NEUTRAL = 'neutral' |
| type neutral.
|
|
Action const | TYPE_POSITIVE = 'useful' |
| type useful.
|
|
|
renderable | $actionlink = null |
|
string | $actionname = null |
|
string | $text = null |
|
string string | $type = '' |
| Store the action type.
|
|
moodle_url | $url = null |
|
Representation of a suggested action associated with a prediction.
- Copyright
- 2017 David Monllao
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
Prediction action constructor.
- Parameters
-
string | $actionname | They should match a-zA-Z_0-9-, as we apply a PARAM_ALPHANUMEXT filter |
core_analytics\prediction | $prediction | |
moodle_url | $actionurl | The final URL where the user should be forwarded. |
pix_icon | $icon | Link icon |
string | $text | Link text |
bool | $primary | Primary button or secondary. |
array | $attributes | Link attributes |
string | false | $type | |
- Return values
-
◆ get_action_link()
core_analytics\action::get_action_link |
( |
| ) |
|
|
inherited |
Returns the link to the action.
- Return values
-
◆ get_action_name()
core_analytics\action::get_action_name |
( |
| ) |
|
|
inherited |
Returns the action name.
- Return values
-
◆ get_text()
core_analytics\action::get_text |
( |
| ) |
|
|
inherited |
Returns the action text.
- Return values
-
◆ get_type()
core_analytics\action::get_type |
( |
| ) |
|
|
inherited |
Returns the type of action.
- Return values
-
string | The positiveness of the action (self\TYPE_POSITIVE, self\TYPE_NEGATIVE or self\TYPE_NEUTRAL) |
◆ get_url()
core_analytics\action::get_url |
( |
| ) |
|
|
inherited |
Returns the url to the action.
- Return values
-
◆ set_type()
core_analytics\action::set_type |
( |
| $type = false | ) |
|
|
inherited |
Sets the type of the action according to its positiveness.
- Exceptions
-
- Parameters
-
◆ transform_to_forward_url()
static core_analytics\prediction_action::transform_to_forward_url |
( |
\moodle_url | $actionurl, |
|
|
string | $actionname, |
|
|
int | $predictionid ) |
|
static |
Transforms the provided url to an action url so we can record the user actions.
Note that it is the caller responsibility to check that the provided actionname is valid for the prediction target.
- Parameters
-
moodle_url | $actionurl | |
string | $actionname | |
int | $predictionid | |
- Return values
-
The documentation for this class was generated from the following file: