Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37d8c6040c | ||
|
|
7ed00f95e6 | ||
|
|
57065d4ca1 |
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
|
||||
|
||||
## Instalacja
|
||||
|
||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.4).
|
||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.7).
|
||||
|
||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||
|
||||
@@ -67,6 +67,21 @@ COM_TESTQUESTIONS_AI_PROVIDER="Dostawca AI"
|
||||
COM_TESTQUESTIONS_AI_API_KEY="Klucz API"
|
||||
COM_TESTQUESTIONS_AI_OPENAI_KEY="Klucz API OpenAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_KEY="Klucz API Grok"
|
||||
COM_TESTQUESTIONS_AI_OPENAI_MODEL="Model OpenAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_MODEL="Model Grok"
|
||||
COM_TESTQUESTIONS_AI_MODEL_INVALID="Wybierz prawidłowy model dla każdego dostawcy AI."
|
||||
COM_TESTQUESTIONS_AI_BALANCE="Saldo kont API"
|
||||
COM_TESTQUESTIONS_AI_OPENAI_BALANCE_INFO="OpenAI nie udostępnia salda przedpłaconych środków przez zwykłe API. Saldo sprawdzisz w panelu rozliczeń: "
|
||||
COM_TESTQUESTIONS_AI_OPENAI_BILLING_LINK="Otwórz rozliczenia OpenAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_TEAM_ID="ID zespołu xAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY="Klucz zarządzający xAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY_SAVED="Klucz zarządzający jest zapisany. Pozostaw pole bez zmian, aby go zachować."
|
||||
COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY_INFO="Wymagany jest osobny Management API key z xAI Console → Settings → Management Keys."
|
||||
COM_TESTQUESTIONS_AI_CHECK_GROK_BALANCE="Sprawdź saldo xAI"
|
||||
COM_TESTQUESTIONS_AI_GROK_BALANCE_INFO="Odczyt dotyczy dostępnych kredytów przedpłaconych zespołu xAI. Nie obejmuje limitu rozliczeń postpaid."
|
||||
COM_TESTQUESTIONS_AI_GROK_BALANCE_CONFIG_REQUIRED="Aby sprawdzić saldo xAI, wpisz ID zespołu i klucz zarządzający, a następnie ponów próbę."
|
||||
COM_TESTQUESTIONS_AI_GROK_BALANCE_FAILED="Nie udało się odczytać salda xAI. Sprawdź ID zespołu, klucz zarządzający i jego uprawnienia."
|
||||
COM_TESTQUESTIONS_AI_GROK_BALANCE_RESULT="Dostępne kredyty przedpłacone xAI: $%s USD"
|
||||
COM_TESTQUESTIONS_AI_SETTINGS_MENU="Konfiguracja AI"
|
||||
COM_TESTQUESTIONS_AI_SETTINGS_SAVED="Ustawienia AI zapisano."
|
||||
COM_TESTQUESTIONS_AI_SAVE_FAILED="Nie udało się zapisać ustawień AI."
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
-- No database changes required for version 1.43.5.
|
||||
@@ -0,0 +1 @@
|
||||
-- No database changes required for version 1.43.6.
|
||||
@@ -0,0 +1 @@
|
||||
-- No database changes required for version 1.43.7.
|
||||
@@ -5,14 +5,75 @@ namespace Komponent\Component\Testquestions\Administrator\Controller;
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Http\HttpFactory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Session\Session;
|
||||
use Komponent\Component\Testquestions\Administrator\Service\AiService;
|
||||
|
||||
class AiController extends BaseController
|
||||
{
|
||||
public function save(): void
|
||||
{
|
||||
$this->saveSettings();
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
Text::_('COM_TESTQUESTIONS_AI_SETTINGS_SAVED')
|
||||
);
|
||||
}
|
||||
|
||||
public function checkbalance(): void
|
||||
{
|
||||
$settings = $this->saveSettings();
|
||||
$teamId = trim((string) ($settings['ai_grok_team_id'] ?? ''));
|
||||
$managementKey = trim((string) ($settings['ai_grok_management_key'] ?? ''));
|
||||
|
||||
if ($teamId === '' || $managementKey === '') {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
Text::_('COM_TESTQUESTIONS_AI_GROK_BALANCE_CONFIG_REQUIRED'),
|
||||
'warning'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$response = HttpFactory::getHttp()->get(
|
||||
'https://management-api.x.ai/v1/billing/teams/' . rawurlencode($teamId) . '/prepaid/balance',
|
||||
['Authorization' => 'Bearer ' . $managementKey, 'Accept' => 'application/json'],
|
||||
30
|
||||
);
|
||||
} catch (\Throwable $error) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
Text::_('COM_TESTQUESTIONS_AI_GROK_BALANCE_FAILED'),
|
||||
'error'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$body = json_decode((string) $response->body, true);
|
||||
if ((int) $response->code < 200 || (int) $response->code >= 300 || !isset($body['total']['val']) || !is_numeric($body['total']['val'])) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
Text::_('COM_TESTQUESTIONS_AI_GROK_BALANCE_FAILED'),
|
||||
'error'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$balance = abs((float) $body['total']['val']) / 100;
|
||||
$message = Text::sprintf('COM_TESTQUESTIONS_AI_GROK_BALANCE_RESULT', number_format($balance, 2, ',', ' '));
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
$message,
|
||||
'message'
|
||||
);
|
||||
}
|
||||
|
||||
private function saveSettings(): array
|
||||
{
|
||||
if (!Session::checkToken()) {
|
||||
throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403);
|
||||
@@ -29,6 +90,16 @@ class AiController extends BaseController
|
||||
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_AI_PROVIDER_INVALID'));
|
||||
}
|
||||
|
||||
$models = AiService::availableModels();
|
||||
$selectedModels = [];
|
||||
foreach (['openai', 'grok'] as $modelProvider) {
|
||||
$model = $input->post->getCmd('ai_' . $modelProvider . '_model', '');
|
||||
if (!isset($models[$modelProvider][$model])) {
|
||||
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_AI_MODEL_INVALID'));
|
||||
}
|
||||
$selectedModels[$modelProvider] = $model;
|
||||
}
|
||||
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$row = $db->setQuery(
|
||||
$db->getQuery(true)
|
||||
@@ -45,35 +116,41 @@ class AiController extends BaseController
|
||||
$settings = json_decode((string) $row->params, true);
|
||||
$settings = is_array($settings) ? $settings : [];
|
||||
$legacyKey = trim((string) ($settings['ai_api_key'] ?? ''));
|
||||
|
||||
$settings['ai_provider'] = $provider;
|
||||
foreach ($selectedModels as $modelProvider => $model) {
|
||||
$settings['ai_' . $modelProvider . '_model'] = $model;
|
||||
}
|
||||
|
||||
foreach (['openai', 'grok'] as $keyProvider) {
|
||||
$fieldName = 'ai_' . $keyProvider . '_api_key';
|
||||
$apiKey = trim((string) $input->post->get($fieldName, '', 'RAW'));
|
||||
|
||||
if ($apiKey !== '') {
|
||||
$settings[$fieldName] = $apiKey;
|
||||
}
|
||||
|
||||
if ($keyProvider === $provider && empty($settings[$fieldName]) && $legacyKey !== '') {
|
||||
$settings[$fieldName] = $legacyKey;
|
||||
}
|
||||
}
|
||||
|
||||
$teamId = trim((string) $input->post->get('ai_grok_team_id', '', 'STRING'));
|
||||
if ($teamId !== '') {
|
||||
$settings['ai_grok_team_id'] = $teamId;
|
||||
}
|
||||
$managementKey = trim((string) $input->post->get('ai_grok_management_key', '', 'RAW'));
|
||||
if ($managementKey !== '') {
|
||||
$settings['ai_grok_management_key'] = $managementKey;
|
||||
}
|
||||
unset($settings['ai_api_key']);
|
||||
|
||||
$extension = (object) [
|
||||
'extension_id' => (int) $row->extension_id,
|
||||
'params' => json_encode($settings, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||
];
|
||||
|
||||
if (!$db->updateObject('#__extensions', $extension, 'extension_id')) {
|
||||
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_AI_SAVE_FAILED'));
|
||||
}
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||
Text::_('COM_TESTQUESTIONS_AI_SETTINGS_SAVED')
|
||||
);
|
||||
return $settings;
|
||||
}
|
||||
|
||||
public function cancel(): void
|
||||
|
||||
@@ -96,6 +96,8 @@ class ResultModel extends BaseDatabaseModel
|
||||
$keyName = 'ai_' . $provider . '_api_key';
|
||||
$apiKey = trim((string) $params->get($keyName, $params->get('ai_api_key', '')));
|
||||
$componentKeyLength = mb_strlen($apiKey);
|
||||
$defaultModels = ['openai' => 'gpt-4.1-mini', 'grok' => 'grok-4.7'];
|
||||
$model = trim((string) $params->get('ai_' . $provider . '_model', $defaultModels[$provider] ?? ''));
|
||||
|
||||
// Odczytaj zapisane parametry bezpośrednio z bazy. Dzięki temu nie użyjemy
|
||||
// nieaktualnej wartości z pamięci ComponentHelper, a maska pola hasła
|
||||
@@ -123,6 +125,12 @@ class ResultModel extends BaseDatabaseModel
|
||||
$keyName = 'ai_' . $provider . '_api_key';
|
||||
$apiKey = trim((string) $params->get($keyName, $params->get('ai_api_key', '')));
|
||||
$componentKeyLength = mb_strlen($apiKey);
|
||||
$model = trim((string) (is_array($storedParams)
|
||||
? ($storedParams['ai_' . $provider . '_model'] ?? $params->get('ai_' . $provider . '_model', $defaultModels[$provider] ?? ''))
|
||||
: $params->get('ai_' . $provider . '_model', $defaultModels[$provider] ?? '')));
|
||||
if ($model === '') {
|
||||
$model = $defaultModels[$provider] ?? '';
|
||||
}
|
||||
$storedApiKey = is_array($storedParams)
|
||||
? trim((string) ($storedParams[$keyName] ?? $storedParams['ai_api_key'] ?? ''))
|
||||
: '';
|
||||
@@ -144,6 +152,7 @@ class ResultModel extends BaseDatabaseModel
|
||||
$aiResult = (new AiService())->evaluate(
|
||||
$provider,
|
||||
$apiKey,
|
||||
$model,
|
||||
strip_tags((string) $question->question),
|
||||
(string) ($answer['selected'] ?? ''),
|
||||
(string) $question->answer_open,
|
||||
|
||||
@@ -8,13 +8,31 @@ use Joomla\CMS\Http\HttpFactory;
|
||||
|
||||
class AiService
|
||||
{
|
||||
public function evaluate(string $provider, string $apiKey, string $question, string $answer, string $pattern, int $maxPoints): array
|
||||
public static function availableModels(): array
|
||||
{
|
||||
return [
|
||||
'openai' => [
|
||||
'gpt-4.1-mini' => 'GPT-4.1 mini (starszy)',
|
||||
'gpt-5.6-luna' => 'GPT-5.6 Luna',
|
||||
'gpt-5.6-terra' => 'GPT-5.6 Terra',
|
||||
'gpt-5.6-sol' => 'GPT-5.6 Sol',
|
||||
'gpt-6-luna' => 'GPT-6 Luna',
|
||||
],
|
||||
'grok' => [
|
||||
'grok-4.7' => 'Grok 4.7',
|
||||
'grok-4.20' => 'Grok 4.20 Reasoning',
|
||||
'grok-4.20-non-reasoning' => 'Grok 4.20 Non-Reasoning',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function evaluate(string $provider, string $apiKey, string $model, string $question, string $answer, string $pattern, int $maxPoints): array
|
||||
{
|
||||
$provider = strtolower(trim($provider));
|
||||
$provider = preg_replace('/[^a-z]/', '', $provider);
|
||||
$config = $provider === 'grok'
|
||||
? ['url' => 'https://api.x.ai/v1/responses', 'model' => 'grok-4.7']
|
||||
: ['url' => 'https://api.openai.com/v1/responses', 'model' => 'gpt-4.1-mini'];
|
||||
? ['url' => 'https://api.x.ai/v1/responses']
|
||||
: ['url' => 'https://api.openai.com/v1/responses'];
|
||||
|
||||
if (trim($apiKey) === '') {
|
||||
throw new \RuntimeException('AI_NOT_CONFIGURED');
|
||||
@@ -24,6 +42,10 @@ class AiService
|
||||
throw new \RuntimeException('Nieprawidłowy dostawca AI: ' . $provider);
|
||||
}
|
||||
|
||||
if (!isset(self::availableModels()[$provider][$model])) {
|
||||
throw new \RuntimeException('Wybrany model AI nie jest obsługiwany.');
|
||||
}
|
||||
|
||||
$input = "Oceń odpowiedź ucznia na pytanie otwarte i ustal liczbę uznanych punktów.\n"
|
||||
. "Maksymalna liczba punktów za to pytanie: " . max(0, $maxPoints) . ".\n"
|
||||
. "Przyznaj liczbę całkowitą od 0 do maksymalnej liczby punktów. Przyznaj punkty proporcjonalnie za poprawne elementy odpowiedzi; pełne punkty za komplet, część punktów za częściową odpowiedź. Nie przekraczaj limitu.\n\n"
|
||||
@@ -32,11 +54,15 @@ class AiService
|
||||
. "Odpowiedź ucznia:\n" . ($answer !== '' ? $answer : 'Brak odpowiedzi') . "\n\n"
|
||||
. "Zwróć wyłącznie poprawny obiekt JSON w formacie {\"awarded_points\": liczba_całkowita, \"feedback\": \"krótka ocena po polsku\"}. W ocenie opisz poprawne i brakujące elementy. Nie zmieniaj wzorca odpowiedzi.";
|
||||
|
||||
$payload = json_encode([
|
||||
'model' => $config['model'],
|
||||
$requestData = [
|
||||
'model' => $model,
|
||||
'input' => $input,
|
||||
'temperature' => 0.1,
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
];
|
||||
// GPT-5.x reasoning models do not accept a custom temperature.
|
||||
if ($provider === 'grok' || $model === 'gpt-4.1-mini') {
|
||||
$requestData['temperature'] = 0.1;
|
||||
}
|
||||
$payload = json_encode($requestData, JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$response = HttpFactory::getHttp()->post(
|
||||
$config['url'],
|
||||
@@ -73,7 +99,11 @@ class AiService
|
||||
throw new \RuntimeException('AI zwróciło nieprawidłowy format oceny i punktów.');
|
||||
}
|
||||
|
||||
$usage = $this->getUsage($body, $provider, $config['model']);
|
||||
$actualModel = (string) ($body['model'] ?? $model);
|
||||
$usage = $this->getUsage($body, $provider, $model);
|
||||
if ($usage !== null) {
|
||||
$usage['model'] = $actualModel;
|
||||
}
|
||||
|
||||
return [
|
||||
'awarded_points' => min(max(0, $maxPoints), max(0, (int) $result['awarded_points'])),
|
||||
@@ -98,9 +128,12 @@ class AiService
|
||||
if ($provider === 'grok' && isset($usage['cost_in_usd_ticks']) && is_numeric($usage['cost_in_usd_ticks'])) {
|
||||
$cost = (float) $usage['cost_in_usd_ticks'] / 10000000000;
|
||||
$costSource = 'provider';
|
||||
} elseif ($provider === 'openai' && $model === 'gpt-4.1-mini') {
|
||||
} elseif ($provider === 'openai' && isset($this->openAiRates()[$model])) {
|
||||
[$inputRate, $cachedRate, $outputRate, $cacheWriteRate] = $this->openAiRates()[$model];
|
||||
$uncachedTokens = $inputTokens - $cachedTokens;
|
||||
$cost = ($uncachedTokens * 0.40 + $cachedTokens * 0.10 + $outputTokens * 1.60) / 1000000;
|
||||
$cacheWriteTokens = min($uncachedTokens, max(0, (int) ($usage['input_tokens_details']['cache_write_tokens'] ?? 0)));
|
||||
$uncachedTokens -= $cacheWriteTokens;
|
||||
$cost = ($uncachedTokens * $inputRate + $cachedTokens * $cachedRate + $cacheWriteTokens * $cacheWriteRate + $outputTokens * $outputRate) / 1000000;
|
||||
$costSource = 'token_rates';
|
||||
}
|
||||
|
||||
@@ -116,6 +149,17 @@ class AiService
|
||||
];
|
||||
}
|
||||
|
||||
private function openAiRates(): array
|
||||
{
|
||||
return [
|
||||
'gpt-4.1-mini' => [0.40, 0.10, 1.60, 0.40],
|
||||
'gpt-5.6-luna' => [0.20, 0.02, 1.20, 0.25],
|
||||
'gpt-5.6-terra' => [2.00, 0.20, 12.00, 2.50],
|
||||
'gpt-5.6-sol' => [4.00, 0.40, 20.00, 5.00],
|
||||
'gpt-6-luna' => [0.10, 0.01, 0.50, 0.125],
|
||||
];
|
||||
}
|
||||
|
||||
private function extractText(array $body): string
|
||||
{
|
||||
if (!empty($body['output_text']) && is_string($body['output_text'])) {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
<?php defined('_JEXEC') or die; ?>
|
||||
<?php use Joomla\CMS\HTML\HTMLHelper; ?>
|
||||
<?php use Joomla\CMS\Router\Route; ?>
|
||||
<?php $availableModels = \Komponent\Component\Testquestions\Administrator\Service\AiService::availableModels(); ?>
|
||||
<?php $provider = (string) ($this->settings['ai_provider'] ?? 'openai'); ?>
|
||||
<?php $legacyKey = (string) ($this->settings['ai_api_key'] ?? ''); ?>
|
||||
<?php $openaiKey = (string) ($this->settings['ai_openai_api_key'] ?? ($provider === 'openai' ? $legacyKey : '')); ?>
|
||||
<?php $grokKey = (string) ($this->settings['ai_grok_api_key'] ?? ($provider === 'grok' ? $legacyKey : '')); ?>
|
||||
<?php $openaiModel = (string) ($this->settings['ai_openai_model'] ?? 'gpt-4.1-mini'); ?>
|
||||
<?php $grokModel = (string) ($this->settings['ai_grok_model'] ?? 'grok-4.7'); ?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_testquestions&view=ai'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="card" style="max-width: 900px;">
|
||||
<div class="card-body">
|
||||
@@ -15,6 +18,14 @@
|
||||
<option value="grok" <?php echo $provider === 'grok' ? 'selected' : ''; ?>>Grok</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ai-openai-model" class="form-label"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_OPENAI_MODEL'); ?></label>
|
||||
<select id="ai-openai-model" name="ai_openai_model" class="form-select" required>
|
||||
<?php foreach ($availableModels['openai'] as $modelId => $modelLabel) : ?>
|
||||
<option value="<?php echo htmlspecialchars($modelId, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $openaiModel === $modelId ? 'selected' : ''; ?>><?php echo htmlspecialchars($modelLabel, ENT_QUOTES, 'UTF-8'); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ai-openai-api-key" class="form-label"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_OPENAI_KEY'); ?></label>
|
||||
<div class="input-group">
|
||||
@@ -35,6 +46,39 @@
|
||||
<?php echo $grokKey !== '' ? 'Zapisany klucz: ' . mb_strlen($grokKey) . ' znaków. Pozostaw pole bez zmian, aby go zachować.' : 'Nie zapisano klucza Grok.'; ?>
|
||||
</small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ai-grok-model" class="form-label"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_MODEL'); ?></label>
|
||||
<select id="ai-grok-model" name="ai_grok_model" class="form-select" required>
|
||||
<?php foreach ($availableModels['grok'] as $modelId => $modelLabel) : ?>
|
||||
<option value="<?php echo htmlspecialchars($modelId, ENT_QUOTES, 'UTF-8'); ?>" <?php echo $grokModel === $modelId ? 'selected' : ''; ?>><?php echo htmlspecialchars($modelLabel, ENT_QUOTES, 'UTF-8'); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
<h3><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_BALANCE'); ?></h3>
|
||||
<div class="alert alert-info">
|
||||
<?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_OPENAI_BALANCE_INFO'); ?>
|
||||
<a href="https://platform.openai.com/settings/organization/billing/overview" target="_blank" rel="noopener noreferrer"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_OPENAI_BILLING_LINK'); ?></a>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ai-grok-team-id" class="form-label"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_TEAM_ID'); ?></label>
|
||||
<input type="text" id="ai-grok-team-id" name="ai_grok_team_id" class="form-control" maxlength="255" value="<?php echo htmlspecialchars((string) ($this->settings['ai_grok_team_id'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="ai-grok-management-key" class="form-label"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY'); ?></label>
|
||||
<div class="input-group">
|
||||
<input type="password" id="ai-grok-management-key" name="ai_grok_management_key" value="<?php echo htmlspecialchars((string) ($this->settings['ai_grok_management_key'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>" class="form-control" maxlength="4096" autocomplete="new-password">
|
||||
<button type="button" class="btn btn-outline-secondary" data-ai-key-toggle="ai-grok-management-key">Pokaż</button>
|
||||
</div>
|
||||
<small class="form-text text-muted">
|
||||
<?php echo !empty($this->settings['ai_grok_management_key']) ? \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY_SAVED') : \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_MANAGEMENT_KEY_INFO'); ?>
|
||||
</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-primary" onclick="this.form.task.value='ai.checkbalance';">
|
||||
<?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_CHECK_GROK_BALANCE'); ?>
|
||||
</button>
|
||||
<div class="form-text mt-2"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_GROK_BALANCE_INFO'); ?></div>
|
||||
<hr>
|
||||
<button type="submit" class="btn btn-primary" onclick="this.form.task.value='ai.save';">
|
||||
<?php echo \Joomla\CMS\Language\Text::_('JTOOLBAR_SAVE'); ?>
|
||||
</button>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<creationDate>2026-10-14</creationDate>
|
||||
<author>Komponent</author>
|
||||
<license>GNU General Public License version 2 or later</license>
|
||||
<version>1.43.4</version>
|
||||
<version>1.43.7</version>
|
||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||
<element>com_testquestions</element>
|
||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||
|
||||
Reference in New Issue
Block a user