MDL-64996 analytics: Make sure the no_teaching model is trained
Due to the bug, the no_teaching model might have been marked as not-trained in the database. Static predictions models (i.e. those using a target based on assumptions, not facts) are always considered as trained. If they were marked as not-trained, the prediction scheduled task would skip them and they would produce no predictions. Ideally, such a fix should be done for all static models. But there is no easy way to do it during the upgrade where accessing the analytics API is not possible. I don't think there are many models out there that would be affected by this so this seems to be good enough solution for now (and the future ability to reset models will cover the rest).
This commit is contained in:
@@ -2462,5 +2462,11 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2018051705.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2018051705.04) {
|
||||
// The no_teaching model might have been marked as not-trained by mistake (static models are always trained).
|
||||
$DB->set_field('analytics_models', 'trained', 1, ['target' => '\core\analytics\target\no_teaching']);
|
||||
upgrade_main_savepoint(true, 2018051705.04);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2018051705.03; // 20180517 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2018051705.04; // 20180517 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user