Treat placeholder comments as empty in PDF
This commit is contained in:
@@ -0,0 +1 @@
|
||||
-- Brak zmian w schemacie bazy danych w wersji 1.43.41.
|
||||
@@ -46,7 +46,10 @@ $resolveImageUrl = static function ($path) {
|
||||
window.addEventListener('beforeprint', function () {
|
||||
document.querySelectorAll('.result-pdf-comment').forEach(function (commentBlock) {
|
||||
const questionId = commentBlock.dataset.questionId;
|
||||
const manualComment = document.getElementById('result-comment-' + questionId)?.value.trim() || '';
|
||||
let manualComment = document.getElementById('result-comment-' + questionId)?.value.trim() || '';
|
||||
if (manualComment === '-' || manualComment === '—') {
|
||||
manualComment = '';
|
||||
}
|
||||
const storedAiFeedback = commentBlock.querySelector('.result-pdf-ai-source')?.textContent.trim() || '';
|
||||
const visibleAiFeedback = document.querySelector('.ai-feedback-screen[data-question-id="' + questionId + '"] .ai-feedback-text')?.textContent.trim() || '';
|
||||
const aiComment = storedAiFeedback || visibleAiFeedback;
|
||||
@@ -133,6 +136,9 @@ $resolveImageUrl = static function ($path) {
|
||||
$answerStatusPartial = $awardedPoints > 0 && !$answerStatusCorrect;
|
||||
}
|
||||
$manualComment = trim((string) ($answer['comment'] ?? ''));
|
||||
if ($manualComment === '-' || $manualComment === '—') {
|
||||
$manualComment = '';
|
||||
}
|
||||
$aiComment = trim((string) ($answer['ai_feedback'] ?? ''));
|
||||
$printComment = $manualComment !== '' ? $manualComment : $aiComment;
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user