﻿with open('resources/views/panel-tests/show.blade.php', 'r', encoding='utf-8') as f:
    lines = f.readlines()

# Baris 310 = @endforeach (index 309)
# Baris 311-387 = Pertanyaan Kesimpulan (index 310-386)
# Baris 388-390 = blank lines (index 387-389)
# Baris 391-443 = Tambah Sampel Baru (index 390-442)

kesimpulan_block = lines[310:387]
tambah_sampel_block = lines[390:443]

# Rebuild: @endforeach + blank + Tambah Sampel + blank + Kesimpulan + sisanya
new_lines = (
    lines[:310] +           # sampai @endforeach
    ['\n'] +
    tambah_sampel_block +   # Tambah Sampel Baru dulu
    ['\n'] +
    kesimpulan_block +      # Pertanyaan Kesimpulan setelahnya
    lines[443:]             # sisa (endsection dll)
)

with open('resources/views/panel-tests/show.blade.php', 'w', encoding='utf-8') as f:
    f.writelines(new_lines)
print("Berhasil!")
