Portofolio: % tuntas per kelas (G.1b) & catatan kelas oleh pengampu

- G.1b: tabel CPMK x kelas (% mahasiswa tuntas, tuntas/jumlah), merah bila di bawah
  ambang batas MK; layar & .docx. Nilai tanpa KRS periode ini tampil sebagai
  "Tanpa kelas". Bukti asesmen CPMK per kelas (PIKOBE kriteria 16).
- Catatan Kelas: pengampu mengisi realisasi & kendala kelasnya sendiri, koordinator
  semua kelas; tabel baru catatan_kelas (terpisah dari dokumen koordinator, ikut
  terkunci saat semester ditutup, masuk cadangan JSON). Tercetak di bagian E dan H.3.
- Uji: pengampu B hanya kelas B, koordinator kelas A, G.1b per kelas, cetak docx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Power BI Dev
2026-10-17 22:14:27 +07:00
co-authored by Claude Opus 5.5
parent 7ece0d8b15
commit f106291caf
5 changed files with 203 additions and 6 deletions
+36 -1
View File
@@ -259,6 +259,17 @@ def build_portofolio(d: dict) -> bytes:
te = doc.add_table(rows=1, cols=1)
_borders(te)
_ct(te.cell(0, 0), d.get("realisasi", "") or "—", size=10)
ck = [k for k in d.get("catatan_kelas", []) if k.get("realisasi")]
if ck:
para("Catatan realisasi per kelas (diisi pengampu):", size=10, bold=True, before=6)
tk = doc.add_table(rows=1 + len(ck), cols=3)
_borders(tk)
for ci, h in enumerate(["Kelas", "Pengampu", "Realisasi"]):
_hdr(tk.cell(0, ci), h)
for i, k in enumerate(ck, 1):
_ct(tk.cell(i, 0), k["kelas"], bold=True, align=WD_ALIGN_PARAGRAPH.CENTER)
_ct(tk.cell(i, 1), ", ".join(k.get("pengampu") or []) or "—")
_ct(tk.cell(i, 2), k["realisasi"])
# ── F. penilaian ──
bagian("F. PENILAIAN MATA KULIAH")
@@ -367,6 +378,28 @@ def build_portofolio(d: dict) -> bytes:
"Skor CPMK seorang mahasiswa = rata-rata Sub-CPMK pendukung, tertimbang bobot kisi-kisi RPS.",
size=9, italic=True)
per_kelas = ev.get("per_kelas") or {}
if per_kelas:
para("G.1b Persentase mahasiswa tuntas per kelas", size=11, bold=True, before=8)
kls = list(per_kelas)
tb = doc.add_table(rows=1 + max(len(baris), 1), cols=2 + len(kls))
_borders(tb)
_hdr(tb.cell(0, 0), "CPMK")
for j, kl in enumerate(kls, 1):
_hdr(tb.cell(0, j), "Tanpa kelas" if kl == "?" else f"Kelas {kl}")
_hdr(tb.cell(0, 1 + len(kls)), "Gabungan")
for i, c in enumerate(baris, 1):
_ct(tb.cell(i, 0), c["kode"], bold=True, align=WD_ALIGN_PARAGRAPH.CENTER)
for j, kl in enumerate(kls, 1):
x = per_kelas[kl].get(c["kode"])
_ct(tb.cell(i, j), f"{x['pct_tuntas']:.0f}% ({x['atas'] + x['sesuai']}/{x['n']})" if x else "—",
color=RED if x and x["tercapai"] is False else None, align=WD_ALIGN_PARAGRAPH.CENTER)
sb = c.get("sebaran")
_ct(tb.cell(i, 1 + len(kls)), f"{sb['pct_tuntas']:.0f}%" if sb else "—", bold=True,
color=RED if c.get("tercapai") is False else None, align=WD_ALIGN_PARAGRAPH.CENTER)
para(f"Merah = di bawah ambang batas MK {target:g}%. Angka dalam kurung = mahasiswa tuntas / jumlah "
"mahasiswa kelas.", size=9, italic=True)
para("G.2 Ketercapaian CPL melalui mata kuliah ini", size=11, bold=True, before=8)
rollup = d.get("rollup", {})
cpl_ev = ev.get("cpl", {})
@@ -443,8 +476,10 @@ def build_portofolio(d: dict) -> bytes:
"Tidak ada temuan CQI pada periode ini.")
para("H.3 Kendala pelaksanaan", size=11, bold=True, before=8)
kendala = [(k.get("kendala", ""), k.get("tindak", "")) for k in d.get("kendala", [])]
kendala += [(f"[Kelas {k['kelas']}] {k['kendala']}", "") for k in d.get("catatan_kelas", []) if k.get("kendala")]
tabel(["No.", "Kendala", "Tindak Lanjut"],
[[str(n), k.get("kendala", ""), k.get("tindak", "")] for n, k in enumerate(d.get("kendala", []), 1)],
[[str(n), k, t] for n, (k, t) in enumerate(kendala, 1)],
"Tidak ada kendala pelaksanaan yang dicatat.")
para("H.4 Statistik nilai akhir", size=11, bold=True, before=8)