Skip to content

Commit 9ee619e

Browse files
authored
Merge pull request #16 from bycs-lp/MBS-10560-Fix_availability_check_for_purpose_img2txt
MBS-10560: Fix availability check for purpose img2txt
2 parents f077e45 + 4d7d7ea commit 9ee619e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

classes/local/question_generator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,10 @@ public function retrieve_file_content_from_ai_system(string $encodedimage): stri
446446
*/
447447
public function is_mimetype_supported_by_ai_system(string $mimetype): bool {
448448
global $USER;
449+
$aiconfig = ai_manager_utils::get_ai_config($USER, $this->contextid, null, ['itt']);
449450
if (
450-
ai_manager_utils::get_ai_config($USER, $this->contextid, null, ['itt'])['availability']
451-
!== ai_manager_utils::AVAILABILITY_AVAILABLE
451+
$aiconfig['availability']['available'] !== ai_manager_utils::AVAILABILITY_AVAILABLE
452+
|| $aiconfig['purposes'][0]['available'] !== ai_manager_utils::AVAILABILITY_AVAILABLE
452453
) {
453454
throw new questiongen_exception('errorimagetotextnotavailable', 'qbank_questiongen');
454455
}

0 commit comments

Comments
 (0)