item->extra_time > 0 ? ' style="background-color: #fff3cd;"' : ''; ?>>
escape($this->item->participant_name); ?>
escape(($this->item->subject_title ? $this->item->subject_title . ' — ' : '') . $this->item->set_title); ?>
item->set_image)) : ?>
item->correct_count; ?> / item->total_count; ?> (item->percentage, ENT_QUOTES, 'UTF-8'); ?>%)
item->points_before; ?> / item->points_after; ?>
item->points_total ?: (int) $this->item->total_count; ?> item->points_after / $pointsTotal) * 100, 2) : 0; ?> = $gradeScale[1]) { $grade = $gradeScale[0]; break; } ?>
escape($grade); ?>
item->execution_time / 60); ?>:item->execution_time % 60), 2, '0', STR_PAD_LEFT); ?>
item->answers as $questionId => $answer) : ?> item->questions[(int) $questionId] ?? null; ?> question_type === 'open' && empty($answer['correct']) && trim((string) ($answer['selected'] ?? '')) !== '') { $pendingAiCount++; } ?> 0) : ?>
0, 'output_tokens' => 0, 'total_tokens' => 0, 'cost_usd' => 0.0, 'cost_calls' => 0, 'providers' => []]; foreach ($this->item->answers as $savedAnswer) { $usage = $savedAnswer['ai_usage'] ?? null; if (!is_array($usage)) continue; $usageTotals['input_tokens'] += (int) ($usage['input_tokens'] ?? 0); $usageTotals['output_tokens'] += (int) ($usage['output_tokens'] ?? 0); $usageTotals['total_tokens'] += (int) ($usage['total_tokens'] ?? 0); if (is_numeric($usage['cost_usd'] ?? null)) { $usageTotals['cost_usd'] += (float) $usage['cost_usd']; $usageTotals['cost_calls']++; } if (!empty($usage['provider'])) $usageTotals['providers'][(string) $usage['provider']] = true; } ?> 0) : ?> 'OpenAI', 'grok' => 'Grok', 'groq' => 'Groq', 'gemini' => 'Gemini'][$usageProvider] ?? $usageProvider; }, array_keys($usageTotals['providers'])); ?> ✦ : tokenów, 0 ? number_format($usageTotals['cost_usd'], 8, ',', ' ') . ' USD' : 'koszt niedostępny'; ?>

item->answers as $questionId => $answer) : ?> item->questions[(int) $questionId] ?? null; if (!$question) continue; ?> question_type === 'open' && array_key_exists('awarded_points', $answer)) { $awardedPoints = (int) $answer['awarded_points']; $maximumPoints = (int) ($question->points ?? 0); $answerStatusCorrect = $awardedPoints > 0 && $awardedPoints >= $maximumPoints; $answerStatusPartial = $awardedPoints > 0 && !$answerStatusCorrect; } $manualComment = trim((string) ($answer['comment'] ?? '')); if ($manualComment === '-' || $manualComment === '—') { $manualComment = ''; } $aiComment = trim((string) ($answer['ai_feedback'] ?? '')); if ($aiComment === '' && (array_key_exists('ai_feedback', $answer) || !empty($answer['ai_usage']) || !empty($answer['ai_usage_history']))) { $aiComment = \Joomla\CMS\Language\Text::sprintf( 'COM_TESTQUESTIONS_RESULT_AI_POINTS_COMMENT', (int) ($answer['awarded_points'] ?? 0), (int) ($question->points ?? 0) ); } $printComment = $manualComment !== '' ? $manualComment : $aiComment; ?>
.
question; ?>
image)) : ?>
question_type === 'open') : ?>
:
: answer_open, ENT_QUOTES, 'UTF-8'); ?>
:
question_type === 'open') : ?>
:
question_type === 'open' && !empty($answer['ai_feedback'])) : ?> points ?? 0); $aiAlertClass = $aiPoints <= 0 ? 'alert-danger' : ($aiPoints >= $maxPoints ? 'alert-success' : 'alert-info'); ?>
:
question_type === 'open' && $hasResponse) : ?>
· in / out ·
question_type === 'open' && $hasResponse) : ?>