Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42b5006574 | ||
|
|
8693720b78 | ||
|
|
37d8c6040c | ||
|
|
7ed00f95e6 |
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
|
|||||||
|
|
||||||
## Instalacja
|
## Instalacja
|
||||||
|
|
||||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.5).
|
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.9).
|
||||||
|
|
||||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||||
|
|||||||
@@ -70,6 +70,13 @@ COM_TESTQUESTIONS_AI_GROK_KEY="Klucz API Grok"
|
|||||||
COM_TESTQUESTIONS_AI_OPENAI_MODEL="Model OpenAI"
|
COM_TESTQUESTIONS_AI_OPENAI_MODEL="Model OpenAI"
|
||||||
COM_TESTQUESTIONS_AI_GROK_MODEL="Model Grok"
|
COM_TESTQUESTIONS_AI_GROK_MODEL="Model Grok"
|
||||||
COM_TESTQUESTIONS_AI_MODEL_INVALID="Wybierz prawidłowy model dla każdego dostawcy AI."
|
COM_TESTQUESTIONS_AI_MODEL_INVALID="Wybierz prawidłowy model dla każdego dostawcy AI."
|
||||||
|
COM_TESTQUESTIONS_AI_TOKEN_USAGE="Wykorzystanie tokenów API"
|
||||||
|
COM_TESTQUESTIONS_AI_TOKEN_USAGE_INFO="Suma użycia zapisanego przy ocenach AI we wszystkich wynikach testów. Powtórne oceny są zliczane, jeśli zostały wykonane po tej aktualizacji."
|
||||||
|
COM_TESTQUESTIONS_AI_USAGE_CALLS="Liczba ocen"
|
||||||
|
COM_TESTQUESTIONS_AI_USAGE_INPUT="Tokeny wejściowe"
|
||||||
|
COM_TESTQUESTIONS_AI_USAGE_OUTPUT="Tokeny wyjściowe"
|
||||||
|
COM_TESTQUESTIONS_AI_USAGE_TOTAL="Razem tokenów"
|
||||||
|
COM_TESTQUESTIONS_AI_USAGE_COST="Koszt zapisany"
|
||||||
COM_TESTQUESTIONS_AI_SETTINGS_MENU="Konfiguracja AI"
|
COM_TESTQUESTIONS_AI_SETTINGS_MENU="Konfiguracja AI"
|
||||||
COM_TESTQUESTIONS_AI_SETTINGS_SAVED="Ustawienia AI zapisano."
|
COM_TESTQUESTIONS_AI_SETTINGS_SAVED="Ustawienia AI zapisano."
|
||||||
COM_TESTQUESTIONS_AI_SAVE_FAILED="Nie udało się zapisać ustawień AI."
|
COM_TESTQUESTIONS_AI_SAVE_FAILED="Nie udało się zapisać ustawień AI."
|
||||||
@@ -99,6 +106,7 @@ COM_TESTQUESTIONS_RESULTS="Zapisane testy"
|
|||||||
COM_TESTQUESTIONS_RESULT_PREVIEW="Podgląd zapisanego testu"
|
COM_TESTQUESTIONS_RESULT_PREVIEW="Podgląd zapisanego testu"
|
||||||
COM_TESTQUESTIONS_RESULT_NOT_FOUND="Nie znaleziono zapisanego testu."
|
COM_TESTQUESTIONS_RESULT_NOT_FOUND="Nie znaleziono zapisanego testu."
|
||||||
COM_TESTQUESTIONS_RESULT_PARTICIPANT="Użytkownik"
|
COM_TESTQUESTIONS_RESULT_PARTICIPANT="Użytkownik"
|
||||||
|
COM_TESTQUESTIONS_RESULT_AI_TOKENS="Tokeny AI"
|
||||||
COM_TESTQUESTIONS_RESULT_SCORE="Wynik"
|
COM_TESTQUESTIONS_RESULT_SCORE="Wynik"
|
||||||
COM_TESTQUESTIONS_RESULT_POINTS_BEFORE_AFTER="Punkty przed / po korekcie"
|
COM_TESTQUESTIONS_RESULT_POINTS_BEFORE_AFTER="Punkty przed / po korekcie"
|
||||||
COM_TESTQUESTIONS_RESULT_GRADE="Ocena"
|
COM_TESTQUESTIONS_RESULT_GRADE="Ocena"
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.43.6.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.43.7.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
UPDATE `#__extensions`
|
||||||
|
SET `params` = JSON_REMOVE(`params`, '$.ai_grok_team_id', '$.ai_grok_management_key')
|
||||||
|
WHERE `type` = 'component'
|
||||||
|
AND `element` = 'com_testquestions'
|
||||||
|
AND JSON_VALID(`params`);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- No database changes required for version 1.43.9.
|
||||||
@@ -14,6 +14,16 @@ use Komponent\Component\Testquestions\Administrator\Service\AiService;
|
|||||||
class AiController extends BaseController
|
class AiController extends BaseController
|
||||||
{
|
{
|
||||||
public function save(): void
|
public function save(): void
|
||||||
|
{
|
||||||
|
$this->saveSettings();
|
||||||
|
|
||||||
|
$this->setRedirect(
|
||||||
|
Route::_('index.php?option=com_testquestions&view=ai', false),
|
||||||
|
Text::_('COM_TESTQUESTIONS_AI_SETTINGS_SAVED')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function saveSettings(): array
|
||||||
{
|
{
|
||||||
if (!Session::checkToken()) {
|
if (!Session::checkToken()) {
|
||||||
throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403);
|
throw new \RuntimeException(Text::_('JINVALID_TOKEN'), 403);
|
||||||
@@ -56,38 +66,34 @@ class AiController extends BaseController
|
|||||||
$settings = json_decode((string) $row->params, true);
|
$settings = json_decode((string) $row->params, true);
|
||||||
$settings = is_array($settings) ? $settings : [];
|
$settings = is_array($settings) ? $settings : [];
|
||||||
$legacyKey = trim((string) ($settings['ai_api_key'] ?? ''));
|
$legacyKey = trim((string) ($settings['ai_api_key'] ?? ''));
|
||||||
|
|
||||||
$settings['ai_provider'] = $provider;
|
$settings['ai_provider'] = $provider;
|
||||||
foreach ($selectedModels as $modelProvider => $model) {
|
foreach ($selectedModels as $modelProvider => $model) {
|
||||||
$settings['ai_' . $modelProvider . '_model'] = $model;
|
$settings['ai_' . $modelProvider . '_model'] = $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (['openai', 'grok'] as $keyProvider) {
|
foreach (['openai', 'grok'] as $keyProvider) {
|
||||||
$fieldName = 'ai_' . $keyProvider . '_api_key';
|
$fieldName = 'ai_' . $keyProvider . '_api_key';
|
||||||
$apiKey = trim((string) $input->post->get($fieldName, '', 'RAW'));
|
$apiKey = trim((string) $input->post->get($fieldName, '', 'RAW'));
|
||||||
|
|
||||||
if ($apiKey !== '') {
|
if ($apiKey !== '') {
|
||||||
$settings[$fieldName] = $apiKey;
|
$settings[$fieldName] = $apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($keyProvider === $provider && empty($settings[$fieldName]) && $legacyKey !== '') {
|
if ($keyProvider === $provider && empty($settings[$fieldName]) && $legacyKey !== '') {
|
||||||
$settings[$fieldName] = $legacyKey;
|
$settings[$fieldName] = $legacyKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($settings['ai_api_key']);
|
unset($settings['ai_api_key']);
|
||||||
|
unset($settings['ai_grok_team_id'], $settings['ai_grok_management_key']);
|
||||||
|
|
||||||
$extension = (object) [
|
$extension = (object) [
|
||||||
'extension_id' => (int) $row->extension_id,
|
'extension_id' => (int) $row->extension_id,
|
||||||
'params' => json_encode($settings, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
'params' => json_encode($settings, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!$db->updateObject('#__extensions', $extension, 'extension_id')) {
|
if (!$db->updateObject('#__extensions', $extension, 'extension_id')) {
|
||||||
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_AI_SAVE_FAILED'));
|
throw new \RuntimeException(Text::_('COM_TESTQUESTIONS_AI_SAVE_FAILED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setRedirect(
|
return $settings;
|
||||||
Route::_('index.php?option=com_testquestions&view=ai', false),
|
|
||||||
Text::_('COM_TESTQUESTIONS_AI_SETTINGS_SAVED')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancel(): void
|
public function cancel(): void
|
||||||
|
|||||||
@@ -161,6 +161,14 @@ class ResultModel extends BaseDatabaseModel
|
|||||||
$item->answers[$questionId]['ai_feedback'] = $aiResult['feedback'];
|
$item->answers[$questionId]['ai_feedback'] = $aiResult['feedback'];
|
||||||
$item->answers[$questionId]['awarded_points'] = $aiResult['awarded_points'];
|
$item->answers[$questionId]['awarded_points'] = $aiResult['awarded_points'];
|
||||||
if ($aiResult['usage'] !== null) {
|
if ($aiResult['usage'] !== null) {
|
||||||
|
$history = $item->answers[$questionId]['ai_usage_history'] ?? null;
|
||||||
|
if (!is_array($history)) {
|
||||||
|
$history = !empty($item->answers[$questionId]['ai_usage']) && is_array($item->answers[$questionId]['ai_usage'])
|
||||||
|
? [$item->answers[$questionId]['ai_usage']]
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
$history[] = $aiResult['usage'];
|
||||||
|
$item->answers[$questionId]['ai_usage_history'] = $history;
|
||||||
$item->answers[$questionId]['ai_usage'] = $aiResult['usage'];
|
$item->answers[$questionId]['ai_usage'] = $aiResult['usage'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,48 @@ use Joomla\CMS\MVC\Model\ListModel;
|
|||||||
|
|
||||||
class ResultsModel extends ListModel
|
class ResultsModel extends ListModel
|
||||||
{
|
{
|
||||||
|
public function getItems()
|
||||||
|
{
|
||||||
|
$items = parent::getItems();
|
||||||
|
|
||||||
|
foreach ($items as $item) {
|
||||||
|
$item->ai_input_tokens = 0;
|
||||||
|
$item->ai_output_tokens = 0;
|
||||||
|
$item->ai_total_tokens = 0;
|
||||||
|
$item->ai_cost_usd = 0.0;
|
||||||
|
|
||||||
|
$answers = json_decode((string) ($item->answers ?? ''), true);
|
||||||
|
if (!is_array($answers)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($answers as $answer) {
|
||||||
|
if (!is_array($answer)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$usages = $answer['ai_usage_history'] ?? (isset($answer['ai_usage']) ? [$answer['ai_usage']] : []);
|
||||||
|
if (!is_array($usages)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($usages as $usage) {
|
||||||
|
if (!is_array($usage)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$item->ai_input_tokens += (int) ($usage['input_tokens'] ?? 0);
|
||||||
|
$item->ai_output_tokens += (int) ($usage['output_tokens'] ?? 0);
|
||||||
|
$item->ai_total_tokens += (int) ($usage['total_tokens'] ?? 0);
|
||||||
|
if (is_numeric($usage['cost_usd'] ?? null)) {
|
||||||
|
$item->ai_cost_usd += (float) $usage['cost_usd'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $items;
|
||||||
|
}
|
||||||
|
|
||||||
protected function populateState($ordering = 'r.created', $direction = 'desc')
|
protected function populateState($ordering = 'r.created', $direction = 'desc')
|
||||||
{
|
{
|
||||||
parent::populateState($ordering, $direction);
|
parent::populateState($ordering, $direction);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class AiService
|
|||||||
'gpt-5.6-luna' => 'GPT-5.6 Luna',
|
'gpt-5.6-luna' => 'GPT-5.6 Luna',
|
||||||
'gpt-5.6-terra' => 'GPT-5.6 Terra',
|
'gpt-5.6-terra' => 'GPT-5.6 Terra',
|
||||||
'gpt-5.6-sol' => 'GPT-5.6 Sol',
|
'gpt-5.6-sol' => 'GPT-5.6 Sol',
|
||||||
|
'gpt-6-luna' => 'GPT-6 Luna',
|
||||||
],
|
],
|
||||||
'grok' => [
|
'grok' => [
|
||||||
'grok-4.7' => 'Grok 4.7',
|
'grok-4.7' => 'Grok 4.7',
|
||||||
@@ -155,6 +156,7 @@ class AiService
|
|||||||
'gpt-5.6-luna' => [0.20, 0.02, 1.20, 0.25],
|
'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-terra' => [2.00, 0.20, 12.00, 2.50],
|
||||||
'gpt-5.6-sol' => [4.00, 0.40, 20.00, 5.00],
|
'gpt-5.6-sol' => [4.00, 0.40, 20.00, 5.00],
|
||||||
|
'gpt-6-luna' => [0.10, 0.01, 0.50, 0.125],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use Joomla\CMS\Toolbar\ToolbarHelper;
|
|||||||
class HtmlView extends BaseHtmlView
|
class HtmlView extends BaseHtmlView
|
||||||
{
|
{
|
||||||
protected array $settings = [];
|
protected array $settings = [];
|
||||||
|
protected array $usageTotals = [];
|
||||||
|
|
||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
@@ -24,6 +25,54 @@ class HtmlView extends BaseHtmlView
|
|||||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_testquestions'))
|
->where($db->quoteName('element') . ' = ' . $db->quote('com_testquestions'))
|
||||||
)->loadResult();
|
)->loadResult();
|
||||||
$this->settings = json_decode($raw, true) ?: [];
|
$this->settings = json_decode($raw, true) ?: [];
|
||||||
|
$this->usageTotals = [
|
||||||
|
'openai' => ['calls' => 0, 'input_tokens' => 0, 'output_tokens' => 0, 'total_tokens' => 0, 'cost_usd' => 0.0, 'cost_calls' => 0],
|
||||||
|
'grok' => ['calls' => 0, 'input_tokens' => 0, 'output_tokens' => 0, 'total_tokens' => 0, 'cost_usd' => 0.0, 'cost_calls' => 0],
|
||||||
|
];
|
||||||
|
|
||||||
|
$usageRows = $db->setQuery(
|
||||||
|
$db->getQuery(true)
|
||||||
|
->select($db->quoteName('answers'))
|
||||||
|
->from($db->quoteName('#__testquestions_results'))
|
||||||
|
->where($db->quoteName('answers') . ' LIKE ' . $db->quote('%ai_usage%'))
|
||||||
|
)->loadColumn();
|
||||||
|
|
||||||
|
foreach ($usageRows as $answersJson) {
|
||||||
|
$answers = json_decode((string) $answersJson, true);
|
||||||
|
if (!is_array($answers)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($answers as $answer) {
|
||||||
|
if (!is_array($answer)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$usages = $answer['ai_usage_history'] ?? (isset($answer['ai_usage']) ? [$answer['ai_usage']] : []);
|
||||||
|
if (!is_array($usages)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($usages as $usage) {
|
||||||
|
if (!is_array($usage)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$provider = (string) ($usage['provider'] ?? '');
|
||||||
|
if (!isset($this->usageTotals[$provider])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->usageTotals[$provider]['calls']++;
|
||||||
|
$this->usageTotals[$provider]['input_tokens'] += (int) ($usage['input_tokens'] ?? 0);
|
||||||
|
$this->usageTotals[$provider]['output_tokens'] += (int) ($usage['output_tokens'] ?? 0);
|
||||||
|
$this->usageTotals[$provider]['total_tokens'] += (int) ($usage['total_tokens'] ?? 0);
|
||||||
|
if (is_numeric($usage['cost_usd'] ?? null)) {
|
||||||
|
$this->usageTotals[$provider]['cost_usd'] += (float) $usage['cost_usd'];
|
||||||
|
$this->usageTotals[$provider]['cost_calls']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_AI_SETTINGS'));
|
ToolbarHelper::title(Text::_('COM_TESTQUESTIONS_AI_SETTINGS'));
|
||||||
ToolbarHelper::link('index.php?option=com_testquestions&view=questions', 'COM_TESTQUESTIONS_QUESTIONS', 'arrow-left');
|
ToolbarHelper::link('index.php?option=com_testquestions&view=questions', 'COM_TESTQUESTIONS_QUESTIONS', 'arrow-left');
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<?php use Joomla\CMS\HTML\HTMLHelper; ?>
|
<?php use Joomla\CMS\HTML\HTMLHelper; ?>
|
||||||
<?php use Joomla\CMS\Router\Route; ?>
|
<?php use Joomla\CMS\Router\Route; ?>
|
||||||
<?php $availableModels = \Komponent\Component\Testquestions\Administrator\Service\AiService::availableModels(); ?>
|
<?php $availableModels = \Komponent\Component\Testquestions\Administrator\Service\AiService::availableModels(); ?>
|
||||||
|
<?php $usageTotals = $this->usageTotals; ?>
|
||||||
<?php $provider = (string) ($this->settings['ai_provider'] ?? 'openai'); ?>
|
<?php $provider = (string) ($this->settings['ai_provider'] ?? 'openai'); ?>
|
||||||
<?php $legacyKey = (string) ($this->settings['ai_api_key'] ?? ''); ?>
|
<?php $legacyKey = (string) ($this->settings['ai_api_key'] ?? ''); ?>
|
||||||
<?php $openaiKey = (string) ($this->settings['ai_openai_api_key'] ?? ($provider === 'openai' ? $legacyKey : '')); ?>
|
<?php $openaiKey = (string) ($this->settings['ai_openai_api_key'] ?? ($provider === 'openai' ? $legacyKey : '')); ?>
|
||||||
@@ -54,6 +55,37 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
|
<h3><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_TOKEN_USAGE'); ?></h3>
|
||||||
|
<p class="text-muted"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_TOKEN_USAGE_INFO'); ?></p>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_PROVIDER'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_CALLS'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_INPUT'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_OUTPUT'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_TOTAL'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_COST'); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach (['openai' => 'OpenAI', 'grok' => 'Grok'] as $usageProvider => $usageProviderLabel) : ?>
|
||||||
|
<?php $providerUsage = $usageTotals[$usageProvider]; ?>
|
||||||
|
<tr>
|
||||||
|
<th><?php echo $usageProviderLabel; ?></th>
|
||||||
|
<td><?php echo number_format($providerUsage['calls'], 0, ',', ' '); ?></td>
|
||||||
|
<td><?php echo number_format($providerUsage['input_tokens'], 0, ',', ' '); ?></td>
|
||||||
|
<td><?php echo number_format($providerUsage['output_tokens'], 0, ',', ' '); ?></td>
|
||||||
|
<td><?php echo number_format($providerUsage['total_tokens'], 0, ',', ' '); ?></td>
|
||||||
|
<td><?php echo $providerUsage['cost_calls'] > 0 ? number_format($providerUsage['cost_usd'], 8, ',', ' ') . ' USD' : '—'; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
<button type="submit" class="btn btn-primary" onclick="this.form.task.value='ai.save';">
|
<button type="submit" class="btn btn-primary" onclick="this.form.task.value='ai.save';">
|
||||||
<?php echo \Joomla\CMS\Language\Text::_('JTOOLBAR_SAVE'); ?>
|
<?php echo \Joomla\CMS\Language\Text::_('JTOOLBAR_SAVE'); ?>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ use Joomla\CMS\Router\Route;
|
|||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_PARTICIPANT'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_PARTICIPANT'); ?></th>
|
||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_SET_TITLE'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_SET_TITLE'); ?></th>
|
||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_POINTS_BEFORE_AFTER'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_POINTS_BEFORE_AFTER'); ?></th>
|
||||||
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_AI_TOKENS'); ?></th>
|
||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_GRADE'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_GRADE'); ?></th>
|
||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_EXECUTION_TIME'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_EXECUTION_TIME'); ?></th>
|
||||||
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_DATE'); ?></th>
|
<th><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULT_DATE'); ?></th>
|
||||||
@@ -55,6 +56,18 @@ use Joomla\CMS\Router\Route;
|
|||||||
<?php if ($pointsAfterPercentage >= $gradeScale[1]) { $grade = $gradeScale[0]; break; } ?>
|
<?php if ($pointsAfterPercentage >= $gradeScale[1]) { $grade = $gradeScale[0]; break; } ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<td><?php echo (int) $item->points_before; ?> (<?php echo $pointsBeforePercentage; ?>%) / <?php echo (int) $item->points_after; ?> (<?php echo $pointsAfterPercentage; ?>%)</td>
|
<td><?php echo (int) $item->points_before; ?> (<?php echo $pointsBeforePercentage; ?>%) / <?php echo (int) $item->points_after; ?> (<?php echo $pointsAfterPercentage; ?>%)</td>
|
||||||
|
<td>
|
||||||
|
<?php if ($item->ai_total_tokens > 0) : ?>
|
||||||
|
<?php echo number_format((int) $item->ai_total_tokens, 0, ',', ' '); ?> <?php echo $this->escape(\Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_TOTAL')); ?>
|
||||||
|
<small class="d-block text-muted">
|
||||||
|
<?php echo number_format((int) $item->ai_input_tokens, 0, ',', ' '); ?> in /
|
||||||
|
<?php echo number_format((int) $item->ai_output_tokens, 0, ',', ' '); ?> out
|
||||||
|
<?php if ($item->ai_cost_usd > 0) : ?> · <?php echo number_format((float) $item->ai_cost_usd, 8, ',', ' '); ?> USD<?php endif; ?>
|
||||||
|
</small>
|
||||||
|
<?php else : ?>
|
||||||
|
—
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
<td><?php echo $this->escape($grade); ?></td>
|
<td><?php echo $this->escape($grade); ?></td>
|
||||||
<td><?php echo floor((int) $item->execution_time / 60); ?>:<?php echo str_pad((string) ((int) $item->execution_time % 60), 2, '0', STR_PAD_LEFT); ?></td>
|
<td><?php echo floor((int) $item->execution_time / 60); ?>:<?php echo str_pad((string) ((int) $item->execution_time % 60), 2, '0', STR_PAD_LEFT); ?></td>
|
||||||
<td><?php echo HTMLHelper::_('date', $item->created, 'Y-m-d H:i'); ?></td>
|
<td><?php echo HTMLHelper::_('date', $item->created, 'Y-m-d H:i'); ?></td>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<creationDate>2026-10-14</creationDate>
|
<creationDate>2026-10-14</creationDate>
|
||||||
<author>Komponent</author>
|
<author>Komponent</author>
|
||||||
<license>GNU General Public License version 2 or later</license>
|
<license>GNU General Public License version 2 or later</license>
|
||||||
<version>1.43.5</version>
|
<version>1.43.9</version>
|
||||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||||
<element>com_testquestions</element>
|
<element>com_testquestions</element>
|
||||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user