bug mapel fixed
This commit is contained in:
parent
8afad7d12b
commit
67dacd6671
|
|
@ -62,15 +62,20 @@ public function store(Request $request)
|
|||
'password' => Hash::make($request->password),
|
||||
]);
|
||||
|
||||
// Tiap mapel berpasangan dengan kelas di index yang sama
|
||||
foreach ($request->id_mapel as $i => $idMapel) {
|
||||
$idKelas = $request->id_kelas[$i] ?? $request->id_kelas[0];
|
||||
Mengajar::create([
|
||||
'id_guru' => $guru->id_guru,
|
||||
$idKelas = $request->id_kelas[$i] ?? $request->id_kelas[0];
|
||||
|
||||
Mengajar::updateOrCreate(
|
||||
[
|
||||
'id_mapel' => $idMapel,
|
||||
'id_kelas' => $idKelas,
|
||||
]);
|
||||
}
|
||||
'id_guru' => null,
|
||||
],
|
||||
[
|
||||
'id_guru' => $guru->id_guru,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return redirect()->route('admin.guru.index')
|
||||
->with('success', 'Data guru berhasil ditambahkan.');
|
||||
|
|
@ -117,11 +122,17 @@ public function update(Request $request, string $id)
|
|||
|
||||
foreach ($request->id_mapel as $i => $idMapel) {
|
||||
$idKelas = $request->id_kelas[$i] ?? $request->id_kelas[0];
|
||||
Mengajar::create([
|
||||
'id_guru' => $guru->id_guru,
|
||||
'id_mapel' => $idMapel,
|
||||
'id_kelas' => $idKelas,
|
||||
]);
|
||||
|
||||
Mengajar::updateOrCreate(
|
||||
[
|
||||
'id_mapel' => $idMapel,
|
||||
'id_kelas' => $idKelas,
|
||||
'id_guru' => null,
|
||||
],
|
||||
[
|
||||
'id_guru' => $guru->id_guru,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return redirect()->route('admin.guru.index')
|
||||
|
|
|
|||
|
|
@ -44,31 +44,46 @@ public function index(Request $request)
|
|||
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
{
|
||||
$request->validate([
|
||||
'nama_mapel' => 'required|max:100',
|
||||
'kelas' => 'required|array',
|
||||
]);
|
||||
|
||||
$request->validate([
|
||||
'nama_mapel' => 'required|max:100',
|
||||
'kelas' => 'required|array'
|
||||
]);
|
||||
// Cek duplikat nama mapel di tiap kelas yang dipilih
|
||||
foreach ($request->kelas as $idKelas) {
|
||||
$sudahAda = Mengajar::whereHas('mapel', function ($q) use ($request) {
|
||||
$q->where('nama_mapel', $request->nama_mapel);
|
||||
})
|
||||
->where('id_kelas', $idKelas)
|
||||
->exists();
|
||||
|
||||
$mapel = Mapel::create([
|
||||
'nama_mapel' => $request->nama_mapel
|
||||
]);
|
||||
|
||||
foreach ($request->kelas as $kelas) {
|
||||
|
||||
Mengajar::create([
|
||||
'id_mapel' => $mapel->id_mapel,
|
||||
'id_kelas' => $kelas,
|
||||
'id_guru' => null
|
||||
]);
|
||||
if ($sudahAda) {
|
||||
$namaKelas = \App\Models\Kelas::find($idKelas);
|
||||
return redirect()->back()
|
||||
->withInput()
|
||||
->with('error_from', 'tambah')
|
||||
->withErrors([
|
||||
'nama_mapel' => 'Mapel "' . $request->nama_mapel . '" sudah ada di kelas ' . optional($namaKelas)->nama_kelas . '!'
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('admin.mapel.index')
|
||||
->with('success', 'Data mata pelajaran berhasil ditambahkan!');
|
||||
}
|
||||
|
||||
$mapel = Mapel::create([
|
||||
'nama_mapel' => $request->nama_mapel,
|
||||
]);
|
||||
|
||||
foreach ($request->kelas as $kelas) {
|
||||
Mengajar::create([
|
||||
'id_mapel' => $mapel->id_mapel,
|
||||
'id_kelas' => $kelas,
|
||||
'id_guru' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('admin.mapel.index')
|
||||
->with('success', 'Data mata pelajaran berhasil ditambahkan!');
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -235,14 +235,14 @@
|
|||
|
||||
<div class="mb-3">
|
||||
<label>Nama Mata Pelajaran <span class="text-danger">*</span></label>
|
||||
<input type="text" name="nama_mapel" class="form-control @error('nama_mapel') is-invalid @enderror"
|
||||
value="{{ old('nama_mapel') }}" placeholder="Contoh: Pemrograman Web" required>
|
||||
<input type="text" name="nama_mapel"
|
||||
class="form-control @error('nama_mapel') is-invalid @enderror"
|
||||
value="{{ old('nama_mapel') }}"
|
||||
placeholder="Contoh: Pemrograman Web" required>
|
||||
@error('nama_mapel')
|
||||
<small class="text-danger">{{ $message }}</small>
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<small class="text-muted">ID Mapel akan dibuat secara otomatis</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
|
|
|
|||
|
|
@ -356,7 +356,6 @@
|
|||
<ul class="navbar-nav ms-auto align-items-center gap-2">
|
||||
<li class="nav-item"><a class="nav-link" href="#fitur">Fitur</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#cara-kerja">Cara Kerja</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#masuk">Login</a></li>
|
||||
<li class="nav-item ms-2">
|
||||
<a href="#masuk" class="btn-nav-cta text-decoration-none">Masuk →</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -4,54 +4,115 @@
|
|||
|
||||
@push('styles')
|
||||
<style>
|
||||
/* Sembunyikan sidebar saat kerjakan biar fokus */
|
||||
.siswa-wrapper .sidebar { display: none !important; }
|
||||
.sidebar-toggle-btn { display: none !important; }
|
||||
/* ─────────────────────────────────────────
|
||||
SEMBUNYIKAN SIDEBAR APP + TOGGLE
|
||||
Hanya sembunyikan elemen navigasi,
|
||||
bukan semua .sidebar agar tidak rusak
|
||||
───────────────────────────────────────── */
|
||||
.siswa-wrapper .sidebar,
|
||||
.siswa-wrapper [class*="sidebar"]:not(.quiz-sidebar-panel),
|
||||
.sidebar-toggle-btn {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.quiz-wrapper {
|
||||
max-width: 680px;
|
||||
/* Paksa main content pakai full width */
|
||||
.siswa-wrapper .main,
|
||||
.siswa-wrapper .main-content,
|
||||
.siswa-wrapper > div:not(.sidebar):not([class*="sidebar"]) {
|
||||
margin-left: 0 !important;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
/* Paksa .content tidak punya padding aneh */
|
||||
.content {
|
||||
padding: 16px 20px 40px !important;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────
|
||||
LAYOUT UTAMA — 2 KOLOM
|
||||
───────────────────────────────────────── */
|
||||
.quiz-page {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 272px;
|
||||
gap: 20px;
|
||||
max-width: 1100px;
|
||||
margin: 0 auto;
|
||||
padding: 10px 0 40px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────
|
||||
KOLOM KIRI
|
||||
───────────────────────────────────────── */
|
||||
.quiz-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.quiz-header {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 18px;
|
||||
padding: 20px 24px;
|
||||
text-align: center;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.quiz-title {
|
||||
font-size: 20px;
|
||||
font-size: 19px;
|
||||
font-weight: 800;
|
||||
color: #1e293b;
|
||||
margin-bottom: 6px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.quiz-title img { width: 24px; height: 24px; object-fit: contain; }
|
||||
.quiz-title img { width: 22px; height: 22px; object-fit: contain; }
|
||||
|
||||
.quiz-meta {
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.quiz-meta span {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 12px;
|
||||
color: #475569;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 99px;
|
||||
padding: 4px 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.quiz-meta img { width: 14px; height: 14px; object-fit: contain; }
|
||||
.quiz-meta img { width: 13px; height: 13px; object-fit: contain; }
|
||||
|
||||
/* Progress bar */
|
||||
/* Progress */
|
||||
.progress-card {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 14px;
|
||||
padding: 12px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
.progress-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #64748b;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.progress-bar-wrap {
|
||||
flex: 1;
|
||||
background: #e2e8f0;
|
||||
border-radius: 99px;
|
||||
height: 8px;
|
||||
margin-bottom: 28px;
|
||||
height: 7px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.progress-bar-fill {
|
||||
|
|
@ -60,21 +121,13 @@
|
|||
border-radius: 99px;
|
||||
transition: width 0.4s ease;
|
||||
}
|
||||
.progress-label {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* Soal card */
|
||||
.soal-card {
|
||||
background: white;
|
||||
border-radius: 20px;
|
||||
border: 2px solid #e5e5e5;
|
||||
padding: 28px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 18px;
|
||||
padding: 24px 26px;
|
||||
display: none;
|
||||
}
|
||||
.soal-card.active { display: block; }
|
||||
|
|
@ -82,277 +135,497 @@
|
|||
.soal-number {
|
||||
display: inline-block;
|
||||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
padding: 3px 12px;
|
||||
padding: 3px 13px;
|
||||
border-radius: 99px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.soal-pertanyaan {
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 20px;
|
||||
line-height: 1.7;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
/* Opsi pilihan */
|
||||
.opsi-list { display: flex; flex-direction: column; gap: 10px; }
|
||||
|
||||
/* Opsi */
|
||||
.opsi-list { display: flex; flex-direction: column; gap: 9px; }
|
||||
.opsi-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
gap: 12px;
|
||||
background: #f8fafc;
|
||||
border: 2px solid #e2e8f0;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
padding: 13px 16px;
|
||||
padding: 12px 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.18s;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
font-size: 14px;
|
||||
color: #1e293b;
|
||||
color: #334155;
|
||||
user-select: none;
|
||||
}
|
||||
.opsi-item:hover {
|
||||
border-color: #667eea;
|
||||
background: #f0eeff;
|
||||
}
|
||||
.opsi-item:hover { border-color: #667eea; background: #f0eeff; }
|
||||
.opsi-item.selected {
|
||||
border-color: #667eea;
|
||||
background: linear-gradient(135deg, #ede9fe, #f5f3ff);
|
||||
font-weight: 600;
|
||||
background: #ede9fe;
|
||||
color: #4c1d95;
|
||||
font-weight: 600;
|
||||
}
|
||||
.opsi-item input[type="radio"] { display: none; }
|
||||
|
||||
.opsi-label-circle {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 30px; height: 30px;
|
||||
border-radius: 50%;
|
||||
background: #e2e8f0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 12px; font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.18s;
|
||||
}
|
||||
.opsi-item.selected .opsi-label-circle {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
.opsi-item.selected .opsi-label-circle { background: #667eea; color: #fff; }
|
||||
|
||||
/* Navigasi */
|
||||
.nav-buttons {
|
||||
/* Tombol navigasi */
|
||||
.nav-buttons-card {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 14px;
|
||||
padding: 14px 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.btn-nav {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 11px 24px;
|
||||
border-radius: 12px;
|
||||
padding: 10px 22px;
|
||||
border-radius: 10px;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
transition: all 0.18s;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
.btn-nav img { width: 16px; height: 16px; object-fit: contain; }
|
||||
|
||||
.btn-nav img { width: 15px; height: 15px; object-fit: contain; }
|
||||
.btn-prev { background: #f1f5f9; color: #475569; }
|
||||
.btn-prev:hover { background: #e2e8f0; }
|
||||
.btn-prev:hover:not(:disabled) { background: #e2e8f0; }
|
||||
.btn-prev:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.btn-next { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
|
||||
.btn-next:hover { opacity: 0.88; }
|
||||
.btn-submit { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; display: none; }
|
||||
.btn-submit:hover { opacity: 0.88; }
|
||||
|
||||
.btn-next {
|
||||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||||
color: white;
|
||||
margin-left: auto;
|
||||
}
|
||||
.btn-next:hover { opacity: 0.9; }
|
||||
|
||||
.btn-submit {
|
||||
background: linear-gradient(135deg, #22c55e, #16a34a);
|
||||
color: white;
|
||||
margin-left: auto;
|
||||
display: none;
|
||||
}
|
||||
.btn-submit:hover { opacity: 0.9; }
|
||||
|
||||
/* Nomor soal dots */
|
||||
.soal-dots {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.soal-dot {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: #e2e8f0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.soal-dot.active { background: #667eea; color: white; }
|
||||
.soal-dot.answered { background: #dcfce7; color: #16a34a; border: 2px solid #22c55e; }
|
||||
.soal-dot.active.answered { background: #22c55e; color: white; }
|
||||
|
||||
/* Warning belum semua dijawab */
|
||||
/* Warning */
|
||||
.warning-box {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: #fff7ed;
|
||||
border: 1px solid #fed7aa;
|
||||
border-radius: 12px;
|
||||
padding: 12px 16px;
|
||||
border-radius: 11px;
|
||||
padding: 11px 15px;
|
||||
font-size: 13px;
|
||||
color: #c2410c;
|
||||
font-weight: 500;
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.warning-box img { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; }
|
||||
|
||||
/* ─────────────────────────────────────────
|
||||
KOLOM KANAN — SIDEBAR QUIZ
|
||||
───────────────────────────────────────── */
|
||||
.quiz-sidebar-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
position: sticky;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/* Timer */
|
||||
.timer-card {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 18px;
|
||||
padding: 18px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.timer-label {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: #94a3b8;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.timer-label img { width: 13px; height: 13px; object-fit: contain; }
|
||||
.timer-display {
|
||||
font-size: 34px;
|
||||
font-weight: 800;
|
||||
color: #1e293b;
|
||||
letter-spacing: 3px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
transition: color 0.3s;
|
||||
}
|
||||
.timer-display.warning { color: #d97706; }
|
||||
.timer-display.danger { color: #dc2626; animation: heartbeat 0.8s ease-in-out infinite; }
|
||||
@keyframes heartbeat {
|
||||
0%, 100% { transform: scale(1); }
|
||||
50% { transform: scale(1.06); }
|
||||
}
|
||||
.timer-bar-wrap {
|
||||
background: #e2e8f0;
|
||||
border-radius: 99px;
|
||||
height: 5px;
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.timer-bar-fill {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, #22c55e, #667eea);
|
||||
border-radius: 99px;
|
||||
transition: width 1s linear, background 0.3s;
|
||||
}
|
||||
.timer-bar-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
|
||||
.timer-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
|
||||
|
||||
/* Nav card */
|
||||
.nav-card {
|
||||
background: #fff;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
border-radius: 18px;
|
||||
padding: 18px 20px;
|
||||
}
|
||||
.nav-card-label {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: #94a3b8;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.nav-card-label img { width: 13px; height: 13px; object-fit: contain; }
|
||||
|
||||
.nav-summary {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.summary-item {
|
||||
text-align: center;
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 10px;
|
||||
padding: 8px 4px;
|
||||
}
|
||||
.summary-num { font-size: 22px; font-weight: 800; }
|
||||
.summary-label { font-size: 10px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
|
||||
.summary-item.answered-sum .summary-num { color: #22c55e; }
|
||||
.summary-item.unanswered-sum .summary-num { color: #94a3b8; }
|
||||
|
||||
.nav-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
gap: 7px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.nav-btn {
|
||||
aspect-ratio: 1;
|
||||
border-radius: 9px;
|
||||
border: 1.5px solid #e2e8f0;
|
||||
background: #f8fafc;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #64748b;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.15s;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
.nav-btn:hover { border-color: #667eea; background: #f0eeff; color: #667eea; }
|
||||
.nav-btn.active { background: #667eea; border-color: #667eea; color: #fff; }
|
||||
.nav-btn.answered { background: #dcfce7; border-color: #22c55e; color: #16a34a; }
|
||||
.nav-btn.active.answered { background: #22c55e; border-color: #22c55e; color: #fff; }
|
||||
|
||||
.nav-legend {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f1f5f9;
|
||||
}
|
||||
.legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
font-size: 11px;
|
||||
color: #64748b;
|
||||
}
|
||||
.legend-dot {
|
||||
width: 13px; height: 13px;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.legend-dot.current { background: #667eea; }
|
||||
.legend-dot.done { background: #dcfce7; border: 1.5px solid #22c55e; }
|
||||
.legend-dot.undone { background: #f8fafc; border: 1.5px solid #e2e8f0; }
|
||||
|
||||
/* ─────────────────────────────────────────
|
||||
RESPONSIVE
|
||||
───────────────────────────────────────── */
|
||||
@media (max-width: 768px) {
|
||||
.quiz-page { grid-template-columns: 1fr; }
|
||||
.quiz-sidebar-panel { position: static; order: -1; }
|
||||
.nav-grid { grid-template-columns: repeat(8, 1fr); }
|
||||
}
|
||||
.warning-box img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="quiz-wrapper">
|
||||
<div class="quiz-page">
|
||||
|
||||
{{-- Header --}}
|
||||
<div class="quiz-header">
|
||||
<div class="quiz-title">
|
||||
<img src="{{ asset('images/icon/siswac/piala.png') }}" alt="Ikon piala">
|
||||
{{ $challenge->judul_challenge }}
|
||||
</div>
|
||||
<div class="quiz-meta">
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/buku1.png') }}" alt="Jumlah soal">
|
||||
{{ $challenge->soal->count() }} Soal
|
||||
</span>
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/star.png') }}" alt="EXP">
|
||||
{{ $challenge->exp }} EXP
|
||||
</span>
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/alarm.png') }}" alt="Tenggat waktu">
|
||||
Tenggat: {{ \Carbon\Carbon::parse($challenge->tenggat_waktu)->format('d M Y, H:i') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{-- ══════════════════════════════
|
||||
KOLOM KIRI — Soal
|
||||
══════════════════════════════ --}}
|
||||
<div class="quiz-main">
|
||||
|
||||
{{-- Dots navigasi soal --}}
|
||||
<div class="soal-dots" id="soalDots">
|
||||
@foreach($challenge->soal as $i => $soal)
|
||||
<div class="soal-dot {{ $i === 0 ? 'active' : '' }}"
|
||||
id="dot-{{ $i }}"
|
||||
onclick="goToSoal({{ $i }})">
|
||||
{{ $i + 1 }}
|
||||
<div class="quiz-header">
|
||||
<div class="quiz-title">
|
||||
<img src="{{ asset('images/icon/siswac/piala.png') }}" alt="Ikon piala">
|
||||
{{ $challenge->judul_challenge }}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="quiz-meta">
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/buku1.png') }}" alt="Jumlah soal">
|
||||
{{ $challenge->soal->count() }} Soal
|
||||
</span>
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/star.png') }}" alt="EXP">
|
||||
{{ $challenge->exp }} EXP
|
||||
</span>
|
||||
<span>
|
||||
<img src="{{ asset('images/icon/siswac/alarm.png') }}" alt="Tenggat waktu">
|
||||
Tenggat: {{ \Carbon\Carbon::parse($challenge->tenggat_waktu)->format('d M Y, H:i') }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Progress --}}
|
||||
<div class="progress-label" id="progressLabel">Soal 1 dari {{ $challenge->soal->count() }}</div>
|
||||
<div class="progress-bar-wrap">
|
||||
<div class="progress-bar-fill" id="progressBar"
|
||||
style="width: {{ round(1 / $challenge->soal->count() * 100) }}%"></div>
|
||||
</div>
|
||||
<div class="progress-card">
|
||||
<span class="progress-label" id="progressLabel">
|
||||
Soal 1 dari {{ $challenge->soal->count() }}
|
||||
</span>
|
||||
<div class="progress-bar-wrap">
|
||||
<div class="progress-bar-fill" id="progressBar"
|
||||
style="width: {{ round(1 / $challenge->soal->count() * 100) }}%">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Form --}}
|
||||
<form action="{{ route('siswa.challenge.submit', $challenge->id_challenge) }}"
|
||||
method="POST" id="quizForm">
|
||||
@csrf
|
||||
<form action="{{ route('siswa.challenge.submit', $challenge->id_challenge) }}"
|
||||
method="POST" id="quizForm">
|
||||
@csrf
|
||||
|
||||
{{-- Soal --}}
|
||||
@foreach($challenge->soal as $i => $soal)
|
||||
<div class="soal-card {{ $i === 0 ? 'active' : '' }}" id="soal-{{ $i }}">
|
||||
<span class="soal-number">Soal {{ $i + 1 }}</span>
|
||||
<p class="soal-pertanyaan">{{ $soal->pertanyaan }}</p>
|
||||
@foreach($challenge->soal as $i => $soal)
|
||||
<div class="soal-card {{ $i === 0 ? 'active' : '' }}" id="soal-{{ $i }}">
|
||||
<span class="soal-number">Soal {{ $i + 1 }}</span>
|
||||
<p class="soal-pertanyaan">{{ $soal->pertanyaan }}</p>
|
||||
<div class="opsi-list">
|
||||
@foreach(['A','B','C','D'] as $opsi)
|
||||
@php $key = 'opsi_' . strtolower($opsi); @endphp
|
||||
<label class="opsi-item" id="label-{{ $i }}-{{ $opsi }}"
|
||||
onclick="pilihJawaban({{ $i }}, '{{ $opsi }}', {{ $soal->id_soal }})">
|
||||
<input type="radio" name="jawaban[{{ $soal->id_soal }}]"
|
||||
value="{{ $opsi }}" id="radio-{{ $i }}-{{ $opsi }}">
|
||||
<span class="opsi-label-circle">{{ $opsi }}</span>
|
||||
<span>{{ $soal->$key }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="opsi-list">
|
||||
@foreach(['A','B','C','D'] as $opsi)
|
||||
@php $key = 'opsi_' . strtolower($opsi); @endphp
|
||||
<label class="opsi-item" id="label-{{ $i }}-{{ $opsi }}"
|
||||
onclick="pilihJawaban({{ $i }}, '{{ $opsi }}', {{ $soal->id_soal }})">
|
||||
<input type="radio" name="jawaban[{{ $soal->id_soal }}]"
|
||||
value="{{ $opsi }}" id="radio-{{ $i }}-{{ $opsi }}">
|
||||
<span class="opsi-label-circle">{{ $opsi }}</span>
|
||||
<span>{{ $soal->$key }}</span>
|
||||
</label>
|
||||
<div class="warning-box" id="warningBox">
|
||||
<img src="{{ asset('images/icon/siswac/alert.png') }}" alt="Peringatan">
|
||||
Masih ada <span id="warningCount"></span> soal yang belum dijawab. Yakin ingin submit?
|
||||
</div>
|
||||
|
||||
<div class="nav-buttons-card">
|
||||
<button type="button" class="btn-nav btn-prev" id="btnPrev"
|
||||
onclick="prevSoal()" disabled>← Sebelumnya</button>
|
||||
<button type="button" class="btn-nav btn-next" id="btnNext"
|
||||
onclick="nextSoal()">Selanjutnya →</button>
|
||||
<button type="submit" class="btn-nav btn-submit" id="btnSubmit"
|
||||
onclick="return konfirmasiSubmit()">
|
||||
<img src="{{ asset('images/icon/siswac/target.png') }}" alt="Submit">
|
||||
Selesai & Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>{{-- /quiz-main --}}
|
||||
|
||||
|
||||
{{-- ══════════════════════════════
|
||||
KOLOM KANAN — Sidebar Quiz
|
||||
══════════════════════════════ --}}
|
||||
<div class="quiz-sidebar-panel">
|
||||
|
||||
<div class="timer-card">
|
||||
<div class="timer-label">
|
||||
<img src="{{ asset('images/icon/siswac/alarm.png') }}" alt="Timer">
|
||||
Sisa Waktu
|
||||
</div>
|
||||
<div class="timer-display" id="timerDisplay">--:--</div>
|
||||
<div class="timer-bar-wrap">
|
||||
<div class="timer-bar-fill" id="timerBar" style="width:100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-card">
|
||||
<div class="nav-card-label">
|
||||
<img src="{{ asset('images/icon/siswac/buku1.png') }}" alt="Navigasi soal">
|
||||
Navigasi Soal
|
||||
</div>
|
||||
|
||||
<div class="nav-summary">
|
||||
<div class="summary-item answered-sum">
|
||||
<div class="summary-num" id="summaryAnswered">0</div>
|
||||
<div class="summary-label">Terjawab</div>
|
||||
</div>
|
||||
<div class="summary-item unanswered-sum">
|
||||
<div class="summary-num" id="summaryUnanswered">{{ $challenge->soal->count() }}</div>
|
||||
<div class="summary-label">Belum</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-grid" id="navGrid">
|
||||
@foreach($challenge->soal as $i => $soal)
|
||||
<button type="button"
|
||||
class="nav-btn {{ $i === 0 ? 'active' : '' }}"
|
||||
id="navBtn-{{ $i }}"
|
||||
onclick="goToSoal({{ $i }})">
|
||||
{{ $i + 1 }}
|
||||
</button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
{{-- Warning --}}
|
||||
<div class="warning-box" id="warningBox">
|
||||
<img src="{{ asset('images/icon/siswac/alert.png') }}" alt="Peringatan">
|
||||
Masih ada <span id="warningCount"></span> soal yang belum dijawab. Yakin ingin submit?
|
||||
<div class="nav-legend">
|
||||
<div class="legend-item">
|
||||
<div class="legend-dot current"></div>
|
||||
<span>Soal aktif</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<div class="legend-dot done"></div>
|
||||
<span>Sudah dijawab</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<div class="legend-dot undone"></div>
|
||||
<span>Belum dijawab</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Navigasi --}}
|
||||
<div class="nav-buttons">
|
||||
<button type="button" class="btn-nav btn-prev" id="btnPrev"
|
||||
onclick="prevSoal()" disabled>← Sebelumnya</button>
|
||||
</div>{{-- /quiz-sidebar-panel --}}
|
||||
|
||||
<button type="button" class="btn-nav btn-next" id="btnNext"
|
||||
onclick="nextSoal()">Selanjutnya →</button>
|
||||
|
||||
<button type="submit" class="btn-nav btn-submit" id="btnSubmit"
|
||||
onclick="return konfirmasiSubmit()">
|
||||
<img src="{{ asset('images/icon/siswac/target.png') }}" alt="Submit">
|
||||
Selesai & Submit
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>{{-- /quiz-page --}}
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const totalSoal = {{ $challenge->soal->count() }};
|
||||
let currentSoal = 0;
|
||||
let jawaban = {}; // { index: 'A'/'B'/'C'/'D' }
|
||||
const totalSoal = {{ $challenge->soal->count() }};
|
||||
let currentSoal = 0;
|
||||
let jawaban = {};
|
||||
|
||||
// ══════════════════════════════════════════════════════════
|
||||
// FIX TIMER — pakai timestamp detik dari server, kalikan
|
||||
// 1000 di JS. Ini cara paling reliable lintas timezone.
|
||||
// Carbon::parse()->timestamp = Unix timestamp dalam DETIK
|
||||
// ══════════════════════════════════════════════════════════
|
||||
const tenggatMs = {{ \Carbon\Carbon::parse($challenge->tenggat_waktu)->timestamp }} * 1000;
|
||||
const totalDetik = Math.max(0, Math.floor((tenggatMs - Date.now()) / 1000));
|
||||
let sisaDetik = totalDetik;
|
||||
|
||||
const elTimer = document.getElementById('timerDisplay');
|
||||
const elTimerBar = document.getElementById('timerBar');
|
||||
|
||||
function formatWaktu(s) {
|
||||
if (s <= 0) return '00:00';
|
||||
const j = Math.floor(s / 3600);
|
||||
const m = Math.floor((s % 3600) / 60);
|
||||
const d = s % 60;
|
||||
const mm = String(m).padStart(2, '0');
|
||||
const ss = String(d).padStart(2, '0');
|
||||
if (j > 0) return `${String(j).padStart(2,'0')}:${mm}:${ss}`;
|
||||
return `${mm}:${ss}`;
|
||||
}
|
||||
|
||||
function updateTimer() {
|
||||
elTimer.textContent = formatWaktu(sisaDetik);
|
||||
|
||||
// Progress bar timer
|
||||
const pct = totalDetik > 0 ? (sisaDetik / totalDetik) * 100 : 0;
|
||||
elTimerBar.style.width = pct + '%';
|
||||
|
||||
// State warna
|
||||
if (sisaDetik <= 60) {
|
||||
elTimer.className = 'timer-display danger';
|
||||
elTimerBar.className = 'timer-bar-fill danger';
|
||||
} else if (sisaDetik <= 300) {
|
||||
elTimer.className = 'timer-display warning';
|
||||
elTimerBar.className = 'timer-bar-fill warning';
|
||||
} else {
|
||||
elTimer.className = 'timer-display';
|
||||
elTimerBar.className = 'timer-bar-fill';
|
||||
}
|
||||
|
||||
if (sisaDetik <= 0) {
|
||||
clearInterval(timerInterval);
|
||||
elTimer.textContent = '00:00';
|
||||
alert('Waktu habis! Jawaban kamu akan otomatis dikumpulkan.');
|
||||
document.getElementById('quizForm').submit();
|
||||
return;
|
||||
}
|
||||
sisaDetik--;
|
||||
}
|
||||
|
||||
updateTimer();
|
||||
const timerInterval = setInterval(updateTimer, 1000);
|
||||
|
||||
|
||||
// ══════════════════════════════════════════
|
||||
// NAVIGASI SOAL
|
||||
// ══════════════════════════════════════════
|
||||
function goToSoal(index) {
|
||||
document.getElementById(`soal-${currentSoal}`).classList.remove('active');
|
||||
document.getElementById(`dot-${currentSoal}`).classList.remove('active');
|
||||
document.getElementById(`navBtn-${currentSoal}`).classList.remove('active');
|
||||
|
||||
currentSoal = index;
|
||||
document.getElementById(`soal-${currentSoal}`).classList.add('active');
|
||||
|
||||
const dot = document.getElementById(`dot-${currentSoal}`);
|
||||
dot.classList.add('active');
|
||||
document.getElementById(`soal-${currentSoal}`).classList.add('active');
|
||||
document.getElementById(`navBtn-${currentSoal}`).classList.add('active');
|
||||
|
||||
updateNav();
|
||||
updateProgress();
|
||||
}
|
||||
|
||||
function nextSoal() {
|
||||
if (currentSoal < totalSoal - 1) goToSoal(currentSoal + 1);
|
||||
}
|
||||
|
||||
function prevSoal() {
|
||||
if (currentSoal > 0) goToSoal(currentSoal - 1);
|
||||
}
|
||||
function nextSoal() { if (currentSoal < totalSoal - 1) goToSoal(currentSoal + 1); }
|
||||
function prevSoal() { if (currentSoal > 0) goToSoal(currentSoal - 1); }
|
||||
|
||||
function pilihJawaban(soalIndex, opsi, idSoal) {
|
||||
jawaban[soalIndex] = opsi;
|
||||
|
|
@ -360,14 +633,12 @@ function pilihJawaban(soalIndex, opsi, idSoal) {
|
|||
['A','B','C','D'].forEach(o => {
|
||||
document.getElementById(`label-${soalIndex}-${o}`)?.classList.remove('selected');
|
||||
});
|
||||
|
||||
document.getElementById(`label-${soalIndex}-${opsi}`)?.classList.add('selected');
|
||||
document.getElementById(`radio-${soalIndex}-${opsi}`).checked = true;
|
||||
|
||||
const dot = document.getElementById(`dot-${soalIndex}`);
|
||||
dot.classList.add('answered');
|
||||
document.getElementById(`navBtn-${soalIndex}`)?.classList.add('answered');
|
||||
|
||||
updateProgress();
|
||||
updateSummary();
|
||||
}
|
||||
|
||||
function updateNav() {
|
||||
|
|
@ -375,7 +646,7 @@ function updateNav() {
|
|||
const btnNext = document.getElementById('btnNext');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
|
||||
btnPrev.disabled = currentSoal === 0;
|
||||
btnPrev.disabled = (currentSoal === 0);
|
||||
|
||||
if (currentSoal === totalSoal - 1) {
|
||||
btnNext.style.display = 'none';
|
||||
|
|
@ -389,27 +660,30 @@ function updateNav() {
|
|||
function updateProgress() {
|
||||
const answered = Object.keys(jawaban).length;
|
||||
const pct = Math.round(((currentSoal + 1) / totalSoal) * 100);
|
||||
|
||||
document.getElementById('progressBar').style.width = pct + '%';
|
||||
document.getElementById('progressLabel').textContent =
|
||||
`Soal ${currentSoal + 1} dari ${totalSoal} · ${answered} terjawab`;
|
||||
}
|
||||
|
||||
function konfirmasiSubmit() {
|
||||
const belum = totalSoal - Object.keys(jawaban).length;
|
||||
const warningBox = document.getElementById('warningBox');
|
||||
function updateSummary() {
|
||||
const answered = Object.keys(jawaban).length;
|
||||
document.getElementById('summaryAnswered').textContent = answered;
|
||||
document.getElementById('summaryUnanswered').textContent = totalSoal - answered;
|
||||
}
|
||||
|
||||
function konfirmasiSubmit() {
|
||||
const belum = totalSoal - Object.keys(jawaban).length;
|
||||
if (belum > 0) {
|
||||
document.getElementById('warningCount').textContent = belum + ' soal';
|
||||
warningBox.style.display = 'flex';
|
||||
document.getElementById('warningCount').textContent = `${belum} soal`;
|
||||
document.getElementById('warningBox').style.display = 'flex';
|
||||
return confirm(`Masih ada ${belum} soal yang belum dijawab. Yakin ingin submit?`);
|
||||
}
|
||||
|
||||
return confirm('Yakin ingin submit jawaban? Jawaban tidak bisa diubah setelah submit.');
|
||||
}
|
||||
|
||||
// Init
|
||||
updateNav();
|
||||
updateProgress();
|
||||
updateSummary();
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -456,11 +456,26 @@
|
|||
{{-- Modal Badge Leaderboard Global --}}
|
||||
<div class="lb-badge-modal-overlay" id="lbBadgeModal">
|
||||
<div class="lb-badge-modal">
|
||||
<div class="lb-badge-modal-label">Badge Baru Diraih!</div>
|
||||
<div class="lb-badge-modal-label">Badge Baru Diraih! 🎉</div>
|
||||
|
||||
{{-- counter --}}
|
||||
<div id="lbBadgeCounter" style="font-size:12px;color:#94a3b8;margin-bottom:16px"></div>
|
||||
|
||||
{{-- slide tunggal --}}
|
||||
<div class="lb-badge-modal-list" id="lbBadgeList"></div>
|
||||
<button class="lb-badge-modal-btn" onclick="dismissLbBadgeModal()">
|
||||
Sip, lanjut! <img src="{{ asset('images/icon/lp/rocket.png') }}" alt="Let's Go!">
|
||||
</button>
|
||||
|
||||
{{-- navigasi --}}
|
||||
<div style="display:flex;gap:10px;margin-top:4px">
|
||||
<button class="lb-badge-modal-btn"
|
||||
id="lbBadgePrev"
|
||||
onclick="lbBadgeNav(-1)"
|
||||
style="background:#e2e8f0;color:#475569;display:none">
|
||||
← Sebelumnya
|
||||
</button>
|
||||
<button class="lb-badge-modal-btn" id="lbBadgeNext" onclick="lbBadgeNav(1)">
|
||||
Selanjutnya →
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -530,20 +545,52 @@ function clearPendingBadges() {
|
|||
try { localStorage.removeItem(LB_BADGE_PENDING_KEY); } catch(e) {}
|
||||
}
|
||||
|
||||
let lbBadgeQueue = [];
|
||||
let lbBadgeCurrent = 0;
|
||||
|
||||
function showLbBadgeModal(badges) {
|
||||
const list = document.getElementById('lbBadgeList');
|
||||
list.innerHTML = badges.map(b => `
|
||||
lbBadgeQueue = badges;
|
||||
lbBadgeCurrent = 0;
|
||||
renderLbBadgeSlide();
|
||||
document.getElementById('lbBadgeModal').classList.add('active');
|
||||
}
|
||||
|
||||
function renderLbBadgeSlide() {
|
||||
const b = lbBadgeQueue[lbBadgeCurrent];
|
||||
const total = lbBadgeQueue.length;
|
||||
const isLast = lbBadgeCurrent === total - 1;
|
||||
const isFirst = lbBadgeCurrent === 0;
|
||||
|
||||
document.getElementById('lbBadgeCounter').textContent =
|
||||
total > 1 ? `${lbBadgeCurrent + 1} / ${total}` : '';
|
||||
|
||||
document.getElementById('lbBadgeList').innerHTML = `
|
||||
<div class="lb-badge-modal-item">
|
||||
<img src="${b.icon_url}" alt="${b.nama_badge}" class="lb-badge-modal-icon">
|
||||
<div class="lb-badge-modal-nama">${b.nama_badge}</div>
|
||||
<div class="lb-badge-modal-desc">${b.deskripsi}</div>
|
||||
</div>`).join('');
|
||||
document.getElementById('lbBadgeModal').classList.add('active');
|
||||
</div>`;
|
||||
|
||||
document.getElementById('lbBadgePrev').style.display = isFirst ? 'none' : '';
|
||||
const nextBtn = document.getElementById('lbBadgeNext');
|
||||
nextBtn.textContent = isLast ? 'Sip, lanjut! 🚀' : 'Selanjutnya →';
|
||||
}
|
||||
|
||||
function lbBadgeNav(dir) {
|
||||
const total = lbBadgeQueue.length;
|
||||
const isLast = lbBadgeCurrent === total - 1;
|
||||
|
||||
if (dir === 1 && isLast) {
|
||||
dismissLbBadgeModal();
|
||||
return;
|
||||
}
|
||||
|
||||
lbBadgeCurrent = Math.max(0, Math.min(total - 1, lbBadgeCurrent + dir));
|
||||
renderLbBadgeSlide();
|
||||
}
|
||||
|
||||
function dismissLbBadgeModal() {
|
||||
document.getElementById('lbBadgeModal').classList.remove('active');
|
||||
// Baru update storage setelah user dismiss — ini yang fix masalah
|
||||
const pending = getPendingBadges();
|
||||
if (pending.length > 0) {
|
||||
saveBadgeIds(pending.map(b => b._confirmedIds).flat());
|
||||
|
|
|
|||
Loading…
Reference in New Issue