diff --git a/question.php b/question.php index ebc70b3..f25e57d 100755 --- a/question.php +++ b/question.php @@ -278,9 +278,7 @@ public function build_full_ai_prompt($response, $aiprompt, $defaultmark, $marksc $prompt .= ' translate the feedback to the language '.current_language(); }; - return $prompt; - } /** @@ -337,6 +335,10 @@ protected function llm_translate(string $text): string { if (current_language() == 'en') { return $text; } + if (get_config('qtype_aitext', 'translatepostfix') == 0) { + return $text; + } + $cache = cache::make('qtype_aitext', 'stringdata'); if (($translation = $cache->get(current_language().'_'.$text)) === false) { $prompt = 'translate "'.$text .'" into '.current_language();