/**
* get_analytics_logstore
*
- * @return \core\log\reader
+ * @return \core\log\sql_reader
*/
public static function get_analytics_logstore() {
$readers = get_log_manager()->get_readers('core\log\sql_reader');
protected function time_less_than($time) {
return $time + (WEEKSECS * 2);
}
-
- /**
- * Generate a log.
- *
- * @param int $time
- * @param int $userid
- * @param int $courseid
- * @return void
- */
- protected function generate_log($time, $userid = false, $courseid = false) {
- global $DB;
-
- if (empty($userid)) {
- $userid = $this->stu1->id;
- }
- if (empty($courseid)) {
- $courseid = $this->course->id;
- }
-
- $context = context_course::instance($courseid);
- $obj = (object)[
- 'eventname' => '\\core\\event\\course_viewed',
- 'component' => 'core',
- 'action' => 'viewed',
- 'target' => 'course',
- 'objecttable' => 'course',
- 'objectid' => $courseid,
- 'crud' => 'r',
- 'edulevel' => \core\event\base::LEVEL_PARTICIPATING,
- 'contextid' => $context->id,
- 'contextlevel' => $context->contextlevel,
- 'contextinstanceid' => $context->instanceid,
- 'userid' => $userid,
- 'courseid' => $courseid,
- 'relateduserid' => null,
- 'anonymous' => 0,
- 'other' => null,
- 'timecreated' => $time,
- 'origin' => 'web',
- ];
- $DB->insert_record('logstore_standard_log', $obj);
- }
-
}
-
public function test_ml_training_and_prediction($timesplittingid, $npredictedranges, $predictionsprocessorclass) {
global $DB;
+ set_config('enabled_stores', 'logstore_standard', 'tool_log');
+
$ncourses = 10;
$this->resetAfterTest(true);
public function test_ml_evaluation($modelquality, $ncourses, $expected, $predictionsprocessorclass) {
$this->resetAfterTest(true);
+ set_config('enabled_stores', 'logstore_standard', 'tool_log');
+
$sometimesplittings = '\core_analytics\local\time_splitting\weekly,' .
'\core_analytics\local\time_splitting\single_range,' .
'\core_analytics\local\time_splitting\quarters';