diff --git a/plugin/ai_helper/tool/learnpath.php b/plugin/ai_helper/tool/learnpath.php index 8efb1aaf881..db15032e7d6 100644 --- a/plugin/ai_helper/tool/learnpath.php +++ b/plugin/ai_helper/tool/learnpath.php @@ -9,13 +9,9 @@ require_once __DIR__.'/../../../main/inc/global.inc.php'; require_once __DIR__.'/../AiHelperPlugin.php'; -require_once __DIR__.'/../../text2speech/Text2SpeechPlugin.php'; require_once api_get_path(SYS_CODE_PATH).'exercise/export/aiken/aiken_classes.php'; require_once api_get_path(SYS_CODE_PATH).'exercise/export/aiken/aiken_import.inc.php'; -$text2speechPlugin = Text2SpeechPlugin::create(); -$isTextToSpeechEnabled = $text2speechPlugin->get('tool_enable') && $text2speechPlugin->get('tool_lp_enable'); - $plugin = AiHelperPlugin::create(); $apiList = $plugin->getApiList(); @@ -70,19 +66,11 @@ $promptItem = sprintf($messageGetItemContent, $topic, $courseLanguage, $wordsCount, $title); $resultContentText = $plugin->openAiGetCompletionText($promptItem, 'learnpath'); $lpItemContent = (!empty($resultContentText) ? trim($resultContentText) : ''); - $audioControl = ''; - if ($isTextToSpeechEnabled && !empty($lpItemContent)) { - $filePath = $text2speechPlugin->convert(strip_tags($lpItemContent)); - $audioControl = ''; - } if (false !== stripos($lpItemContent, '')) { - $lpItemContent = preg_replace("||i", "\r\n$style\r\n\\0", $audioControl.$lpItemContent); + $lpItemContent = preg_replace("||i", "\r\n$style\r\n\\0", $lpItemContent); } else { - $lpItemContent = ''.trim($title).''.$style.''.$audioControl.$lpItemContent.''; + $lpItemContent = ''.trim($title).''.$style.''.$lpItemContent.''; } $lpItems[$position]['content'] = $lpItemContent; $position++;