Color AI feedback by awarded points
This commit is contained in:
@@ -102,7 +102,12 @@ $resolveImageUrl = static function ($path) {
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (!empty($answer['ai_feedback'])) : ?>
|
||||
<div class="alert alert-info mt-3"><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_RESULT'); ?>:</strong><br><?php echo nl2br(htmlspecialchars((string) $answer['ai_feedback'], ENT_QUOTES, 'UTF-8')); ?></div>
|
||||
<?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"><strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_RESULT'); ?>:</strong><br><?php echo nl2br(htmlspecialchars((string) $answer['ai_feedback'], ENT_QUOTES, 'UTF-8')); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($question->question_type === 'open' && $hasResponse) : ?>
|
||||
|
||||
Reference in New Issue
Block a user