Add aggregate AI tokens and move column
This commit is contained in:
@@ -33,15 +33,24 @@ use Joomla\CMS\Router\Route;
|
||||
</div>
|
||||
<div class="col-md-3 align-self-end"><button type="submit" class="btn btn-primary"><?php echo \Joomla\CMS\Language\Text::_('JSEARCH_FILTER_SUBMIT'); ?></button></div>
|
||||
</div>
|
||||
<div class="alert alert-info" role="status">
|
||||
<strong><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_RESULTS_AI_TOKENS_TOTAL'); ?>:</strong>
|
||||
<?php echo number_format((int) $this->aiUsageTotals['total_tokens'], 0, ',', ' '); ?> <?php echo $this->escape(\Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_AI_USAGE_TOTAL')); ?>
|
||||
(<?php echo number_format((int) $this->aiUsageTotals['input_tokens'], 0, ',', ' '); ?> in /
|
||||
<?php echo number_format((int) $this->aiUsageTotals['output_tokens'], 0, ',', ' '); ?> out)
|
||||
<?php if ($this->aiUsageTotals['cost_usd'] > 0) : ?>
|
||||
· <?php echo number_format((float) $this->aiUsageTotals['cost_usd'], 8, ',', ' '); ?> USD
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead><tr>
|
||||
<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_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_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_AI_TOKENS'); ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($this->items as $item) : ?>
|
||||
@@ -56,6 +65,9 @@ use Joomla\CMS\Router\Route;
|
||||
<?php if ($pointsAfterPercentage >= $gradeScale[1]) { $grade = $gradeScale[0]; break; } ?>
|
||||
<?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 $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 HTMLHelper::_('date', $item->created, 'Y-m-d H:i'); ?></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')); ?>
|
||||
@@ -68,9 +80,6 @@ use Joomla\CMS\Router\Route;
|
||||
—
|
||||
<?php endif; ?>
|
||||
</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 HTMLHelper::_('date', $item->created, 'Y-m-d H:i'); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user