@if ($shouldShowNumber)
- {{ $badgeNumber }}
+ {{ $displayNumber }}
@elseif($hasGroupNumber)
- {{ $badgeNumber }}
+ {{ $displayNumber }}
@endif
{{ $pertanyaan }}
@@ -637,9 +701,9 @@
@php
$optionId = 'jawaban-' . $detail->id . '-' . $optionIndex;
$optionLabel = is_scalar($option) ? (string) $option : '';
- $isLainnya = stripos($optionLabel, 'lainnya') !== false;
- $optionValue = $isLainnya && $oldOtherAnswer ? $oldOtherAnswer : $optionLabel;
- $shouldCheck = $currentAnswer === $optionValue || ($isLainnya && $shouldForceLainnyaSelection);
+ $isOtherOption = $isOtherOptionLabel($optionLabel);
+ $optionValue = $isOtherOption && $oldOtherAnswer ? $oldOtherAnswer : $optionLabel;
+ $shouldCheck = $currentAnswer === $optionValue || ($isOtherOption && $shouldForceOtherSelection);
@endphp
- @if ($isLainnya)
+ @if ($isOtherOption)
@php
$lainnyaWrapperRendered = true;
@endphp
@@ -675,9 +739,9 @@
@endif
@endforeach
- @if ($hasLainnyaOption || $type === 'option_with_other')
+ @if ($otherOptionHintLabel)
@@ -794,8 +858,25 @@
const nonConsentFields = document.querySelectorAll('[data-field-hal]:not([data-consent-input="1"])');
const consentFields = document.querySelectorAll('[data-consent-input="1"][name]');
const headSoalCard = document.getElementById('head_soal');
- const consentNegativeKeywords = ['tidak', 'tidak setuju'];
+ const consentNegativeKeywords = ['tidak', 'tidak setuju', 'saya tidak bersedia'];
let immediateSubmitActive = false;
+ let groupInfoMap = {};
+ try {
+ groupInfoMap = JSON.parse(form.dataset.groupInfo || '{}');
+ } catch (error) {
+ groupInfoMap = {};
+ }
+ if (Array.isArray(groupInfoMap)) {
+ groupInfoMap = groupInfoMap.reduce(function (acc, value, index) {
+ if (value && typeof value === 'object') {
+ acc[index] = value;
+ }
+ return acc;
+ }, {});
+ }
+ const groupInfoCard = document.getElementById('group_info_card');
+ const groupInfoNama = document.getElementById('group-info-nama');
+ const groupInfoKeterangan = document.getElementById('group-info-keterangan');
function normalizeOtherValue(value) {
return (value || '').toString().trim().toLowerCase();
@@ -806,6 +887,9 @@
if (!normalized) {
return false;
}
+ const includesTidakBerlakuTidakTahu =
+ normalized.includes('tidak berlaku') && normalized.includes('tidak tahu');
+ const includesSebutkanAlasan = normalized.includes('sebutkan alasan');
return normalized === 'lainnya'
|| normalized === 'lainnya (sebutkan)'
|| normalized === 'lainnya/other'
@@ -813,7 +897,9 @@
|| normalized === 'other'
|| normalized === 'others'
|| normalized.includes('lainnya')
- || normalized.includes('other');
+ || normalized.includes('other')
+ || includesTidakBerlakuTidakTahu
+ || includesSebutkanAlasan;
}
function getLabelTextByInput(input) {
@@ -841,6 +927,7 @@
setupConsentWatcher();
updateQuestionVisibility();
updateNavigationUI();
+ updateGroupInfoUI();
navHalButtons.forEach(function (button) {
button.addEventListener('click', function () {
@@ -916,6 +1003,7 @@
}
updateQuestionVisibility();
updateNavigationUI();
+ updateGroupInfoUI();
scrollPageToTop();
}
@@ -999,6 +1087,19 @@
}
}
+ function updateGroupInfoUI() {
+ if (!groupInfoCard || !groupInfoNama || !groupInfoKeterangan) {
+ return;
+ }
+ const info = (groupInfoMap && groupInfoMap[currentHal]) || {};
+ const namaText = (info.nama || '').toString().trim() || '-';
+ const ketText = (info.keterangan || '').toString().trim() || '-';
+ groupInfoNama.textContent = namaText;
+ groupInfoKeterangan.textContent = ketText;
+ const shouldHide = namaText === '-' && ketText === '-';
+ groupInfoCard.classList.toggle('d-none', shouldHide);
+ }
+
function setupLainnyaInputs() {
const radios = form.querySelectorAll('input[type="radio"][name^="jawaban["]');
radios.forEach(function (radio) {
diff --git a/resources/views/soal/list.blade.php b/resources/views/soal/list.blade.php
index bf1b783..09c09cc 100644
--- a/resources/views/soal/list.blade.php
+++ b/resources/views/soal/list.blade.php
@@ -26,7 +26,7 @@
@section('content')
-
Selamat Datang di Survei Mutu
+
Selamat Datang di Survei Komite Mutu Rumah Sakit
Silakan pilih kuesioner yang ingin Anda isi. Pastikan data yang diberikan sesuai kondisi unit kerja Anda.
@if (session('success'))