diff --git a/plugin/ai_helper/tool/learnpath.php b/plugin/ai_helper/tool/learnpath.php index b5e32def48..e75307a044 100644 --- a/plugin/ai_helper/tool/learnpath.php +++ b/plugin/ai_helper/tool/learnpath.php @@ -52,6 +52,7 @@ switch ($apiName) { // Create the learnpath and return the id generated. $return = ['success' => false, 'lp_id' => 0]; if (!empty($lpItems)) { + krsort($lpItems); $lpId = learnpath::add_lp( $courseCode, $topic,