mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
MDL-57791 analytics: Changes after review
- Split model::predict in parts - JS promises updated according to eslint-plugin-promise - New API methods replacing direct DB queries - Reduce insights nav link display cost - Increase time limit as well as memory for big processes - Move prediction action event to core - Dataset write locking and others - Refine last time range end time - Removed dodgy splitting method id to int - Replace admin_setting_predictor output_html overwrite for write_setting overwrite - New APIs for access control - Discard invalid samples also during prediction
This commit is contained in:
parent
584ffa4ffc
commit
1611308b58
40 changed files with 513 additions and 289 deletions
|
@ -27,20 +27,13 @@ require_once(__DIR__ . '/../../config.php');
|
|||
$contextid = required_param('contextid', PARAM_INT);
|
||||
$modelid = optional_param('modelid', false, PARAM_INT);
|
||||
|
||||
$context = context::instance_by_id($contextid);
|
||||
|
||||
if ($context->contextlevel === CONTEXT_MODULE) {
|
||||
list($course, $cm) = get_module_from_cmid($context->instanceid);
|
||||
require_login($course, true, $cm);
|
||||
} else if ($context->contextlevel >= CONTEXT_COURSE) {
|
||||
$coursecontext = $context->get_course_context(true);
|
||||
require_login($coursecontext->instanceid);
|
||||
} else {
|
||||
require_login();
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
require_login($course, false, $cm);
|
||||
if ($context->contextlevel < CONTEXT_COURSE) {
|
||||
// Only for higher levels than course.
|
||||
$PAGE->set_context($context);
|
||||
}
|
||||
|
||||
require_capability('moodle/analytics:listinsights', $context);
|
||||
\core_analytics\manager::check_can_list_insights($context);
|
||||
|
||||
// Get all models that are enabled, trained and have predictions at this context.
|
||||
$othermodels = \core_analytics\manager::get_all_models(true, true, $context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue