Render AI feedback independently of correctness
This commit is contained in:
@@ -158,6 +158,14 @@ $resolveImageUrl = static function ($path) {
|
||||
<span class="result-pdf-comment-text"><?php echo htmlspecialchars($manualComment, ENT_QUOTES, 'UTF-8'); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($question->question_type === 'open' && !empty($answer['ai_feedback'])) : ?>
|
||||
<?php
|
||||
$aiPoints = (int) ($answer['awarded_points'] ?? 0);
|
||||
$maxPoints = (int) ($question->points ?? 0);
|
||||
$aiAlertClass = $aiPoints <= 0 ? 'alert-danger' : ($aiPoints >= $maxPoints ? 'alert-success' : 'alert-info');
|
||||
?>
|
||||
<div class="alert <?php echo $aiAlertClass; ?> mt-3 ai-feedback-screen ai-feedback-print-source" data-question-id="<?php echo (int) $questionId; ?>"><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_RESULT'); ?>:</strong><br><span class="ai-feedback-text"><?php echo nl2br(htmlspecialchars((string) $answer['ai_feedback'], ENT_QUOTES, 'UTF-8')); ?></span></div>
|
||||
<?php endif; ?>
|
||||
<?php if (empty($answer['correct'])) : ?>
|
||||
<?php if ($question->question_type === 'open' && $hasResponse) : ?>
|
||||
<div class="mt-3">
|
||||
@@ -176,14 +184,6 @@ $resolveImageUrl = static function ($path) {
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!empty($answer['ai_feedback'])) : ?>
|
||||
<?php
|
||||
$aiPoints = (int) ($answer['awarded_points'] ?? 0);
|
||||
$maxPoints = (int) ($question->points ?? 0);
|
||||
$aiAlertClass = $aiPoints <= 0 ? 'alert-danger' : ($aiPoints >= $maxPoints ? 'alert-success' : 'alert-info');
|
||||
?>
|
||||
<div class="alert <?php echo $aiAlertClass; ?> mt-3 ai-feedback-screen ai-feedback-print-source" data-question-id="<?php echo (int) $questionId; ?>"><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_RESULT'); ?>:</strong><br><span class="ai-feedback-text"><?php echo nl2br(htmlspecialchars((string) $answer['ai_feedback'], ENT_QUOTES, 'UTF-8')); ?></span></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($question->question_type === 'open' && $hasResponse) : ?>
|
||||
<div class="row mt-3 no-print">
|
||||
|
||||
Reference in New Issue
Block a user