@php $rules = \App\Services\QuestionQualityCheckService::RULES; $btnSm = \Filament\Support\Enums\Size::Small; @endphp {{-- 勾选题目用 Alpine 即时高亮 + $wire.toggleTemQuestion,勿把 toggleTemQuestion 放进 target,避免出现全屏大图标一闪 --}}
{{ __('加载中…') }}
{{-- Filament 主题自带 fi-* 样式;此处用内联布局避免依赖 Tailwind 工具类是否被打进 app.css --}}
{{-- 左:知识点 --}}
@if (filled($this->kpSearch))

显示 {{ count($this->filteredKpRows) }} / 共 {{ count($this->kpRows) }} 个知识点

@endif
@forelse($this->filteredKpRows as $row)
@if (! empty($row['kp_name'] ?? '')) {{ $row['kp_name'] }} @endif {{ $row['kp_code'] }} 正式 {{ $row['questions_count'] }} · 表内 {{ $row['tem_count'] }} · 可入库 {{ $row['tem_importable_count'] ?? 0 }}
@empty

暂无数据(检查 questions_tem)

@endforelse
{{-- 中:与判卷页同源 components.exam.paper-body(一行一题,含选项布局/答案/解题思路) --}} @if (! $this->selectedKpCode)

请先在左侧选择一个知识点。

@else @php $qtrKpMeta = collect($this->kpRows)->firstWhere('kp_code', $this->selectedKpCode); @endphp
当前 KP {{ $this->selectedKpCode }} 本列表 {{ count($this->temQuestions) }} 道可入库预览 @if ($qtrKpMeta) (表内 {{ (int) ($qtrKpMeta['tem_count'] ?? 0) }} 道,已与正式库题干重复而隐藏 {{ max(0, (int) ($qtrKpMeta['tem_count'] ?? 0) - (int) ($qtrKpMeta['tem_importable_count'] ?? 0)) }} 道) @endif
{{-- KP 切换时整栏重绘;仅换选中题时 wire:ignore 阻止中间 DOM morph,右侧照常更新 --}}
@include('filament.pages.partials.question-tem-paper-body', [ 'questions' => $this->groupedPaperBodyQuestions, 'selectedTemId' => $this->selectedTemId, 'selectedTemIdsForMulti' => $this->selectedTemIds, ])
@endif
{{-- 右:快速批量入库 → 可选高级质检/单题入库 → 待组卷 / 批量 --}}
@if ($this->selectedTemIds === [])

在中间列表点击题目加入勾选。

@else
已选 {{ count($this->selectedTemIds) }} 道 · 最后聚焦 tem #{{ $this->selectedTemId ?? '—' }}
{{ implode(', ', array_map('intval', $this->selectedTemIds)) }}
@endif
一键入库已选题目 清空勾选

自本会话起成功写入 questions 的题目会进入列表,可集中修改难度系数。

打开「已入库题目 · 难度调整」
@if (! $this->qcPanelExpanded) 展开质检与单题入库 @else
收起
{{-- 质检 --}}

质检结果

@if (! $this->selectedTemId)

请先在中间点击一道题作为当前聚焦。

@else @php $qc = $this->qcResult; @endphp
questions_tem.id = {{ $this->selectedTemId }}
@if ($this->duplicateHint)
{{ $this->duplicateHint }}
@endif @if ($qc)
{{ $qc['passed'] ? '质检通过' : '质检未通过' }}
@if (! empty($qc['errors']))
    @foreach ($qc['errors'] as $code)
  • {{ $rules[$code]['name'] ?? $code }}
  • @endforeach
@endif
@foreach ($qc['results'] as $r) @if (($r['auto_result'] ?? '') !== 'skip')
{{ $r['rule_name'] ?? $r['rule_code'] }} {{ ($r['passed'] ?? false) ? 'OK' : '×' }}
@endif @endforeach
@endif @endif
{{-- 入库难度 --}}

单题入库难度

@if (! $this->selectedTemId)

先选择题目标

@else

将写入 questions.difficulty;批量/快速入库使用各题 tem 原始值(规整到 0~0.90)。

@endif
{{-- 单题入库 --}}

单题入库

@if (! $this->selectedTemId)

先选择题目标

@else @php $qc = $this->qcResult; $canImport = $qc && ($qc['passed'] ?? false) && ! $this->duplicateHint; @endphp 入库到 questions @if (! $canImport && $qc)

@if ($this->duplicateHint) 与正式库重复时不可入库。 @elseif (! ($qc['passed'] ?? false)) 质检未通过时不可入库,请先修正题目数据。 @endif

@else

audit_status=0(若表含该字段);同 KP + 同题干重复会拒绝。

@endif @endif
@endif
{{-- 待组卷与判卷 PDF --}}
@if ($this->selectedTemIds !== [])

当前勾选:{{ count($this->selectedTemIds) }} 道 tem

@endif

队列共 {{ count($this->assemblyQueueRows) }} 道

@if (count($this->assemblyQueueRows) > 0)
    @foreach ($this->assemblyQueueRows as $qr)
  • tem #{{ (int) ($qr->id ?? 0) }}
  • @endforeach
@endif
将当前勾选加入待组卷 清空队列 生成完整卷 PDF 并打开判卷页 @if ($this->trialGradingUrl) 判卷页预览(新标签) @endif @if ($this->trialGradingPdfUrl) 下载完整卷 PDF @endif
{{-- 5. 批量:questions_tem → questions(与单题入库同一套规则,不经 JSON) --}}
一键入库当前知识点全部 一键入库待组卷队列全部

与单题入库相同的数据写入逻辑;批量时不强制质检通过,仅做重复与必填判断。