| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <x-filament::page>
- <style>
- .qidt-shell {
- display: grid;
- grid-template-columns: minmax(0, 1fr) minmax(15rem, 20rem);
- gap: 1rem;
- align-items: start;
- }
- @media (max-width: 1024px) {
- .qidt-shell {
- grid-template-columns: 1fr;
- }
- }
- </style>
- <x-filament::section
- heading="说明"
- description="列表来自「待入库质检」页在本次登录会话中成功写入 questions 的题目 ID(快速/批量入库均会累积)。在此可逐题查看并修改难度系数 0.00~0.90(两位小数)。"
- :compact="true"
- >
- <div class="flex flex-wrap items-center gap-2">
- <x-filament::button
- color="gray"
- size="sm"
- wire:click="clearTuningList"
- wire:confirm="确定清空会话中的 ID 列表?(不会删除题库题目)"
- >
- 清空列表记录
- </x-filament::button>
- <a
- href="{{ \App\Filament\Pages\QuestionTemQualityReview::getUrl() }}"
- class="text-sm text-primary-600 underline"
- >
- 返回待入库质检
- </a>
- </div>
- <p class="mt-2 text-xs text-gray-500 dark:text-gray-400">
- 当前列表共 <strong>{{ count($this->tuningQuestionIds) }}</strong> 道题。
- </p>
- </x-filament::section>
- <div class="qidt-shell mt-4">
- <x-filament::section heading="题目列表" :compact="true">
- @if (count($this->tuningQuestionIds) === 0)
- <p class="text-sm text-gray-600 dark:text-gray-400">暂无记录,请先在待入库质检页执行入库。</p>
- @else
- <ul class="max-h-[min(70vh,40rem)] space-y-1 overflow-y-auto text-sm">
- @foreach ($this->tuningQuestionIds as $qid)
- @php
- $row = \App\Models\Question::query()->find($qid);
- $stemSnippet = $row ? \Illuminate\Support\Str::limit(strip_tags((string) $row->stem), 80) : '(无正文)';
- $diffLabel = $row ? number_format(max(0, min(0.9, (float) $row->difficulty)), 2, '.', '') : '—';
- @endphp
- <li
- wire:key="qidt-row-{{ $qid }}"
- class="flex items-start justify-between gap-2 rounded-lg border border-gray-100 p-2 dark:border-white/10 {{ (int) $this->selectedQuestionId === (int) $qid ? 'ring-2 ring-primary-500' : '' }}"
- >
- <button
- type="button"
- class="min-w-0 flex-1 text-left"
- wire:click="selectQuestion({{ (int) $qid }})"
- >
- <span class="font-mono text-xs text-primary-600">#{{ $qid }}</span>
- <span class="ml-2 text-xs text-gray-500">{{ $row?->kp_code }}</span>
- <span class="ml-2 text-xs text-gray-400">难度 {{ $diffLabel }}</span>
- <div class="mt-1 line-clamp-2 text-xs text-gray-700 dark:text-gray-300">
- {{ $stemSnippet }}
- </div>
- </button>
- <button
- type="button"
- class="shrink-0 text-xs text-danger-600 underline"
- wire:click="removeFromList({{ (int) $qid }})"
- >
- 移除
- </button>
- </li>
- @endforeach
- </ul>
- @endif
- </x-filament::section>
- <x-filament::section
- heading="调整难度"
- description="选中题目后修改 difficulty,点确定写回 questions 表"
- :compact="true"
- >
- @if (! $this->selectedQuestionId)
- <p class="text-xs text-gray-500">请从左侧选择一道题。</p>
- @else
- <p class="mb-2 text-xs text-gray-500">
- 当前 <span class="font-mono">question_id = {{ $this->selectedQuestionId }}</span>
- </p>
- <x-filament::input.wrapper>
- <x-filament::input
- type="number"
- min="0"
- max="0.9"
- step="0.01"
- wire:model.live.debounce.300ms="difficultyInput"
- />
- </x-filament::input.wrapper>
- <x-filament::button
- class="mt-3"
- color="primary"
- wire:click="saveDifficulty"
- wire:loading.attr="disabled"
- >
- 确定更新
- </x-filament::button>
- @endif
- </x-filament::section>
- </div>
- </x-filament::page>
|