35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
$stmt_fdbck = $db["data"]->prepare(
|
|
"SELECT round_number, score, comment FROM assignments WHERE completed IS NOT NULL AND submission_id = :submission_id"
|
|
);
|
|
$stmt_fdbck->execute([
|
|
"submission_id" => $submission->id,
|
|
]);
|
|
$feedback = $stmt_fdbck->fetchAll(PDO::FETCH_OBJ);
|
|
?>
|
|
<section aria-labelledby="feedback" class="flow">
|
|
<h3 id="feedback">Feedback</h3>
|
|
<?php if ($feedback): ?>
|
|
<div role="region" aria-labelledby="feedback-caption" tabindex="0">
|
|
<table>
|
|
<caption id="feedback-caption">Feedback for "<?= $submission->title ?>"</caption>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Score</th>
|
|
<th scope="col">Comment</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($feedback as $item): ?>
|
|
<tr>
|
|
<td><?= $item->score ?></td>
|
|
<td><?= ($item->comment) ? mb_convert_encoding($item->comment, 'Windows-1252','utf-8') : '<i>No comment was provided.</i>' ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php else: ?>
|
|
<p>The feedback you receive from other writers will appear here.</p>
|
|
<?php endif; ?>
|
|
</section>
|