Skip to content

Instantly share code, notes, and snippets.

@dmonllao
Created July 2, 2018 10:58
Show Gist options
  • Save dmonllao/eded79d096d51c81278738907b0e0d95 to your computer and use it in GitHub Desktop.
Save dmonllao/eded79d096d51c81278738907b0e0d95 to your computer and use it in GitHub Desktop.
<?php
// Not tested but it should be something like that. New file in $CFG->dirroot.
require_once(__DIR__ . '/config.php');
// For students at-risk model. Feel free to change.
$MODELID = 1;
$COURSEID = 123;
$coursecontext = \context_course::instance($COURSEID);
$model = new \core_analytics\model($MODELID);
$predictions = $model->get_predictions($coursecontext);
foreach ($predictions as $prediction) {
var_dump($prediction->get_calculations());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment