fix(posimai-sc): 試験モードのAlpine null参照エラーを解消

Made-with: Cursor
This commit is contained in:
posimai 2026-04-20 20:37:44 +09:00
parent 81095b891f
commit a38447a061
1 changed files with 6 additions and 6 deletions

View File

@ -592,23 +592,23 @@ header{display:flex;align-items:center;justify-content:space-between;padding:0 1
<div class="drill-prog-wrap">
<div class="drill-prog-label">
<span x-text="'試験 ' + (examIdx+1) + ' / ' + examTotal"></span>
<span x-text="examCurrentEntry.unit.num"></span>
<span x-text="examCurrentEntry?.unit?.num || ''"></span>
</div>
<div class="drill-prog-bar">
<div class="drill-prog-fill" :style="'width:' + (examTotal ? (examIdx/examTotal*100) : 0) + '%'"></div>
</div>
</div>
<div class="drill-unit-lbl">
<span x-text="examCurrentEntry.unit.catLabel + ' — ' + examCurrentEntry.unit.title"></span>
<span x-text="(examCurrentEntry?.unit?.catLabel || '') + ' — ' + (examCurrentEntry?.unit?.title || '')"></span>
</div>
<div class="q-card" :class="exQCardCls()">
<div class="q-text" x-html="safeHtml(examCurrentEntry.q.q)"></div>
<div class="q-text" x-html="safeHtml(examCurrentEntry?.q?.q || '')"></div>
<div class="q-choices">
<template x-for="(ch, ci) in examCurrentEntry.q.choices" :key="ci">
<template x-for="(ch, ci) in (examCurrentEntry?.q?.choices || [])" :key="ci">
<button class="q-choice" type="button"
:class="exChoiceCls(ci, examCurrentEntry.q.answer)"
:class="exChoiceCls(ci, examCurrentEntry?.q?.answer ?? -1)"
:disabled="exAnswered()"
@click="doExamAnswer(ci, examCurrentEntry.q.answer, examCurrentEntry.q.exp)">
@click="doExamAnswer(ci, examCurrentEntry?.q?.answer ?? -1, examCurrentEntry?.q?.exp || '')">
<span class="choice-key" x-text="keys[ci]"></span>
<span x-html="safeHtml(ch)"></span>
</button>