question-detail.blade.php 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <div class="min-h-screen bg-gray-50">
  2. <div class="container mx-auto p-6">
  3. @if (empty($this->questionData))
  4. <div class="bg-white rounded-lg shadow p-12 text-center">
  5. <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  6. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002 2v10a2 2 0 01-2 2H9a2 2 0 01-2-2V7a2 2 0 012-2z" />
  7. </svg>
  8. <h3 class="mt-4 text-lg font-medium text-gray-900">题目不存在</h3>
  9. <p class="mt-2 text-sm text-gray-500">请检查题目ID是否正确</p>
  10. <a href="{{ url()->previous() }}" class="mt-4 inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-indigo-600 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500">
  11. 返回上一页
  12. </a>
  13. </div>
  14. @else
  15. {{-- 主要内容区域 --}}
  16. <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
  17. {{-- 左侧:题目内容 --}}
  18. <div class="lg:col-span-2 space-y-6">
  19. {{-- 题目卡片 --}}
  20. <div class="bg-white rounded-lg shadow-sm p-6">
  21. <div class="flex items-start justify-between mb-4">
  22. {{-- 题目标识 --}}
  23. <div class="flex items-center space-x-3">
  24. @if ($this->sourceType === 'mistake')
  25. @php
  26. $answeredCorrectly = $this->questionData['mistake_info']['correct'] ?? false;
  27. @endphp
  28. <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium {{ $answeredCorrectly ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700' }}">
  29. {{ $answeredCorrectly ? '答题记录' : '错题' }}
  30. </span>
  31. @else
  32. <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-700">
  33. 题库
  34. </span>
  35. @endif
  36. @if ($this->questionData['question_number'] ?? null)
  37. <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-700">
  38. 第{{ $this->questionData['question_number'] }}题
  39. </span>
  40. @endif
  41. <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium {{ $this->getDifficultyColor() }}">
  42. {{ $this->getDifficultyLabel() }}
  43. </span>
  44. </div>
  45. {{-- 操作按钮 --}}
  46. <div class="flex items-center space-x-2">
  47. <button onclick="window.history.back()" class="text-gray-500 hover:text-gray-700">
  48. <svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  49. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" />
  50. </svg>
  51. </button>
  52. </div>
  53. </div>
  54. {{-- 题干 --}}
  55. <div class="prose prose-sm max-w-none mb-6">
  56. @php
  57. $displayStem = $this->questionData['display_stem'] ?? $this->questionData['stem'] ?? '';
  58. $stemHtml = \App\Services\MathFormulaProcessor::processFormulas($displayStem);
  59. @endphp
  60. @if (!empty($stemHtml))
  61. <div class="p-4 bg-gray-50 rounded-lg">
  62. <h4 class="text-sm font-medium text-gray-700 mb-2">题目</h4>
  63. <div class="text-gray-900 leading-relaxed space-y-3 question-stem prose-sm max-w-none">
  64. {!! $stemHtml !!}
  65. </div>
  66. </div>
  67. @endif
  68. @php
  69. $rawImages = $this->questionData['images']
  70. ?? ($this->questionData['meta']['images'] ?? ($this->questionData['meta']['generated_question']['images'] ?? []));
  71. if (is_string($rawImages)) {
  72. $decodedImages = json_decode($rawImages, true);
  73. $rawImages = is_array($decodedImages) ? $decodedImages : [];
  74. }
  75. $images = is_array($rawImages) ? array_values(array_filter($rawImages)) : [];
  76. @endphp
  77. @if (!empty($images))
  78. <div class="mt-4">
  79. <h4 class="text-sm font-medium text-gray-700 mb-2">题图</h4>
  80. <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
  81. @foreach($images as $img)
  82. <div class="bg-white border rounded-lg p-2">
  83. <img src="{{ $img }}" alt="题目图片" class="w-full h-auto rounded">
  84. </div>
  85. @endforeach
  86. </div>
  87. </div>
  88. @endif
  89. {{-- 标签 --}}
  90. <div class="flex flex-wrap gap-2 mb-4">
  91. @php
  92. $kpCode = $this->questionData['kp_code'] ?? '';
  93. $kpName = $this->getKnowledgePointName();
  94. @endphp
  95. @if ($kpCode)
  96. <span class="inline-flex items-center px-3 py-1 rounded-lg text-sm font-medium bg-indigo-50 text-indigo-700 hover:bg-indigo-100 transition-colors">
  97. <a href="{{ url('/admin/knowledge-point-detail') }}?kp_code={{ urlencode($kpCode) }}" class="hover:text-indigo-900">
  98. {{ $kpName }}
  99. </a>
  100. </span>
  101. @endif
  102. @php
  103. $rawTags = $this->questionData['tags'] ?? null;
  104. if (is_array($rawTags)) {
  105. $tags = $rawTags;
  106. } elseif (is_string($rawTags)) {
  107. $decodedTags = json_decode($rawTags, true);
  108. $tags = is_array($decodedTags) ? $decodedTags : [];
  109. } else {
  110. $tags = [];
  111. }
  112. @endphp
  113. @foreach($tags as $tag)
  114. <span class="inline-flex items-center px-2 py-1 rounded text-xs bg-gray-100 text-gray-600">
  115. {{ $tag }}
  116. </span>
  117. @endforeach
  118. @php
  119. $skillNames = $this->getSkillNames();
  120. $skillNames = is_array($skillNames) ? $skillNames : [];
  121. @endphp
  122. @foreach($skillNames as $skill)
  123. <span class="inline-flex items-center px-2 py-1 rounded text-xs bg-teal-50 text-teal-600">
  124. {{ $skill }}
  125. </span>
  126. @endforeach
  127. </div>
  128. {{-- 选择题选项(独立呈现,不与题干混排) --}}
  129. @php
  130. $options = $this->questionData['display_options'] ?? ($this->questionData['options'] ?? []);
  131. @endphp
  132. @if (!empty($options) && is_array($options))
  133. <div class="mt-4">
  134. <h4 class="text-sm font-medium text-gray-700 mb-2">选项</h4>
  135. <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
  136. @php
  137. $letters = range('A', 'Z');
  138. @endphp
  139. @foreach($options as $idx => $option)
  140. @php
  141. $optionText = $option;
  142. $label = null;
  143. if (is_array($option)) {
  144. $label = $option['label'] ?? $option['key'] ?? null;
  145. $optionText = $option['text'] ?? $option['value'] ?? $optionText;
  146. }
  147. if ($label === null) {
  148. if (is_numeric($idx)) {
  149. $index = (int) $idx;
  150. $label = $letters[$index] ?? chr(65 + ($index % 26));
  151. } else {
  152. $label = strtoupper((string) $idx);
  153. }
  154. }
  155. if (is_array($optionText)) {
  156. $optionText = json_encode($optionText, JSON_UNESCAPED_UNICODE);
  157. }
  158. @endphp
  159. <div class="flex items-start space-x-2">
  160. <span class="font-semibold text-gray-700">{{ $label }}.</span>
  161. <div class="text-gray-900">{!! $optionText !!}</div>
  162. </div>
  163. @endforeach
  164. </div>
  165. </div>
  166. @endif
  167. {{-- 答案对比(如果是错题) --}}
  168. @if ($this->sourceType === 'mistake' && isset($this->questionData['mistake_info']))
  169. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
  170. @php
  171. $answeredCorrectly = $this->questionData['mistake_info']['correct'] ?? false;
  172. $studentBg = $answeredCorrectly ? 'bg-green-50' : 'bg-red-50';
  173. $studentText = $answeredCorrectly ? 'text-green-700' : 'text-red-700';
  174. $statusLabel = $answeredCorrectly ? '本次作答正确' : '本次作答错误';
  175. @endphp
  176. <div class="p-4 rounded-lg {{ $studentBg }}">
  177. <h4 class="text-sm font-medium {{ $studentText }} mb-2">学生作答</h4>
  178. <p class="text-gray-900">{{ $this->questionData['mistake_info']['student_answer'] ?? '未作答' }}</p>
  179. @if (isset($this->questionData['mistake_info']['score']))
  180. <div class="mt-2 text-sm text-gray-500">
  181. 得分: {{ $this->questionData['mistake_info']['score'] }}/{{ $this->questionData['mistake_info']['full_score'] ?? '-' }}
  182. </div>
  183. @endif
  184. <div class="mt-2 inline-flex items-center px-2 py-1 rounded-full text-xs font-medium {{ $answeredCorrectly ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700' }}">
  185. {{ $statusLabel }}
  186. </div>
  187. </div>
  188. <div class="p-4 bg-green-50 rounded-lg">
  189. <h4 class="text-sm font-medium text-green-700 mb-2">正确答案</h4>
  190. <p class="text-gray-900">{!! \App\Services\MathFormulaProcessor::processFormulas($this->questionData['answer'] ?? '暂无') !!}</p>
  191. </div>
  192. </div>
  193. @else
  194. {{-- 正确答案 --}}
  195. @if (!empty($this->questionData['answer']))
  196. <div class="p-4 bg-green-50 rounded-lg mb-4">
  197. <h4 class="text-sm font-medium text-green-700 mb-2">正确答案</h4>
  198. <p class="text-gray-900 text-lg font-mono leading-relaxed">{!! \App\Services\MathFormulaProcessor::processFormulas($this->questionData['answer']) !!}</p>
  199. </div>
  200. @endif
  201. <div class="p-4 bg-white rounded-lg border border-gray-200 mb-4">
  202. <h4 class="text-sm font-medium text-gray-700 mb-2">答案校正与 AI 解题</h4>
  203. <textarea
  204. wire:model.defer="answerOverride"
  205. class="w-full rounded-lg border-gray-300 text-sm"
  206. rows="3"
  207. placeholder="手动修正答案,保存后再重新生成解题思路"
  208. ></textarea>
  209. <div class="mt-3 flex flex-wrap gap-2">
  210. <button
  211. wire:click="saveAnswerOverride"
  212. class="px-3 py-1.5 text-sm font-medium rounded-md bg-gray-900 text-white hover:bg-gray-800"
  213. >
  214. 保存答案
  215. </button>
  216. <button
  217. wire:click="regenerateSolution"
  218. wire:loading.attr="disabled"
  219. wire:target="regenerateSolution"
  220. class="px-3 py-1.5 text-sm font-medium rounded-md bg-blue-600 text-white hover:bg-blue-500"
  221. >
  222. <span wire:loading.remove wire:target="regenerateSolution">AI 重新生成解题思路</span>
  223. <span wire:loading wire:target="regenerateSolution" class="inline-flex items-center gap-2">
  224. <svg class="w-4 h-4 animate-spin" viewBox="0 0 24 24" fill="none">
  225. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  226. <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"></path>
  227. </svg>
  228. 正在生成...
  229. </span>
  230. </button>
  231. </div>
  232. </div>
  233. @endif
  234. {{-- 解题思路 --}}
  235. @if (!empty($this->questionData['solution']))
  236. <div class="p-4 bg-blue-50 rounded-lg">
  237. <h4 class="text-sm font-medium text-blue-700 mb-2">解题思路</h4>
  238. @php
  239. $solutionRaw = $this->questionData['solution'];
  240. $solutionProcessed = \App\Services\MathFormulaProcessor::processFormulas($solutionRaw);
  241. $solutionProcessed = preg_replace('/【(解题思路|详细解答|最终答案)】/u', '<br><strong>【$1】</strong><br>', $solutionProcessed);
  242. $solutionProcessed = preg_replace('/(第\s*\d+\s*步:)/u', '<br>$1', $solutionProcessed);
  243. $solutionProcessed = nl2br($solutionProcessed);
  244. @endphp
  245. <div class="prose prose-sm max-w-none text-gray-900 leading-relaxed space-y-3 solution-content">
  246. {!! $solutionProcessed !!}
  247. </div>
  248. </div>
  249. @endif
  250. </div>
  251. </div>
  252. <style>
  253. .question-stem svg,
  254. .solution-content svg {
  255. max-width: 100%;
  256. height: auto;
  257. display: block;
  258. }
  259. .solution-content {
  260. white-space: pre-line;
  261. }
  262. </style>
  263. {{-- AI分析(如果是错题) --}}
  264. @if ($this->sourceType === 'mistake' && !empty($this->questionData['mistake_info']['ai_analysis']))
  265. <div class="bg-white rounded-lg shadow-sm p-6">
  266. <h3 class="text-lg font-semibold text-gray-900 mb-4 flex items-center">
  267. <svg class="w-5 h-5 mr-2 text-amber-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  268. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-9M3 21l6.364-6.364M3 12l6.364 6.364M12 3L12 21m0-10.5v9M3 12l6.364-6.364" />
  269. </svg>
  270. AI 智能分析
  271. </h3>
  272. <div class="space-y-4">
  273. @if (!empty($this->questionData['mistake_info']['ai_analysis']['reason']))
  274. <div class="bg-amber-50 p-4 rounded-lg">
  275. <h4 class="text-sm font-medium text-amber-700 mb-2">错误原因</h4>
  276. <p class="text-gray-900">{{ $this->questionData['mistake_info']['ai_analysis']['reason'] }}</p>
  277. </div>
  278. @endif
  279. @if (!empty($this->questionData['mistake_info']['ai_analysis']['solution']))
  280. <div class="bg-blue-50 p-4 rounded-lg">
  281. <h4 class="text-sm font-medium text-blue-700 mb-2">改进方法</h4>
  282. <p class="text-gray-900">{{ $this->questionData['mistake_info']['ai_analysis']['solution'] }}</p>
  283. </div>
  284. @endif
  285. @if (!empty($this->questionData['mistake_info']['ai_analysis']['suggestions']))
  286. <div class="bg-green-50 p-4 rounded-lg">
  287. <h4 class="text-sm font-medium text-green-700 mb-2">学习建议</h4>
  288. <p class="text-gray-900">{{ $this->questionData['mistake_info']['ai_analysis']['suggestions'] }}</p>
  289. </div>
  290. @endif
  291. @if (!empty($this->questionData['mistake_info']['ai_analysis']['next_steps']))
  292. <div class="bg-purple-50 p-4 rounded-lg">
  293. <h4 class="text-sm font-medium text-purple-700 mb-2">后续步骤</h4>
  294. <ul class="list-disc list-inside text-gray-900 space-y-1">
  295. @php
  296. $nextSteps = $this->questionData['mistake_info']['ai_analysis']['next_steps'];
  297. if (!is_array($nextSteps)) {
  298. $nextSteps = [];
  299. }
  300. @endphp
  301. @foreach($nextSteps as $item)
  302. <li>{{ $item }}</li>
  303. @endforeach
  304. </ul>
  305. </div>
  306. @endif
  307. @php
  308. $modelUsed = $this->questionData['mistake_info']['ai_analysis']['model_used'] ?? '';
  309. @endphp
  310. @if ($modelUsed)
  311. <p class="text-xs text-gray-500 mt-2">分析模型: {{ $modelUsed }}</p>
  312. @endif
  313. </div>
  314. </div>
  315. @endif
  316. {{-- 相关题目 --}}
  317. @if (!empty($this->relatedQuestions))
  318. <div class="bg-white rounded-lg shadow-sm p-6">
  319. <h3 class="text-lg font-semibold text-gray-900 mb-4">相似题目</h3>
  320. <div class="space-y-4">
  321. @foreach($this->relatedQuestions as $relatedQuestion)
  322. <div class="border border-gray-200 rounded-lg p-4 hover:bg-gray-50 transition-colors cursor-pointer">
  323. <div class="flex items-center justify-between mb-2">
  324. <span class="text-sm font-medium text-gray-900">
  325. {{ substr($relatedQuestion['stem'] ?? '', 0, 100) }}...
  326. </span>
  327. <a href="/admin/question-detail/{{ $relatedQuestion['id'] }}"
  328. class="text-indigo-600 hover:text-indigo-700 text-sm">
  329. 查看详情
  330. </a>
  331. </div>
  332. @if (!empty($relatedQuestion['difficulty']))
  333. <span class="inline-flex items-center px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-700">
  334. {{ $relatedQuestion['difficulty'] < 0.4 ? '简单' : ($relatedQuestion['difficulty'] < 0.7 ? '中等' : '困难') }}
  335. </span>
  336. @endif
  337. </div>
  338. @endforeach
  339. </div>
  340. </div>
  341. @endif
  342. </div>
  343. {{-- 右侧:信息面板 --}}
  344. <div class="space-y-6">
  345. {{-- 题目信息 --}}
  346. @if ($this->questionData)
  347. <div class="bg-white rounded-lg shadow-sm p-6">
  348. <h3 class="text-lg font-semibold text-gray-900 mb-4">题目信息</h3>
  349. <dl class="space-y-3 text-sm">
  350. <div>
  351. <dt class="text-gray-500">题目ID</dt>
  352. <dd class="text-gray-900 font-mono">{{ $this->questionData['id'] ?? $this->questionData['question_code'] }}</dd>
  353. </div>
  354. @if (!empty($this->questionData['kp_code']))
  355. <div>
  356. <dt class="text-gray-500">知识点</dt>
  357. <dd class="text-gray-900">{{ $this->getKnowledgePointName() }}</dd>
  358. </div>
  359. @endif
  360. <div>
  361. <dt class="text-gray-500">难度等级</dt>
  362. <dd class="text-gray-900">{{ $this->getDifficultyLabel() }}</dd>
  363. </div>
  364. @php
  365. $globalAccuracy = $this->questionData['global_accuracy']
  366. ?? $this->questionData['correct_rate']
  367. ?? null;
  368. @endphp
  369. @if ($globalAccuracy !== null)
  370. <div>
  371. <dt class="text-gray-500">全体正确率</dt>
  372. <dd class="text-gray-900">
  373. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-50 text-blue-700">
  374. {{ round((float) $globalAccuracy * 100, 1) }}%
  375. </span>
  376. </dd>
  377. </div>
  378. @endif
  379. @if (!empty($this->historySummary))
  380. @php
  381. $accuracy = $this->historySummary['total'] > 0 ? ($this->historySummary['correct'] / $this->historySummary['total']) : null;
  382. if ($accuracy === null) {
  383. $masteryLabel = '未知';
  384. $masteryStyle = 'bg-gray-100 text-gray-700';
  385. } elseif ($accuracy >= 0.8) {
  386. $masteryLabel = '已掌握';
  387. $masteryStyle = 'bg-green-100 text-green-700';
  388. } elseif ($accuracy >= 0.5) {
  389. $masteryLabel = '待巩固';
  390. $masteryStyle = 'bg-amber-100 text-amber-700';
  391. } else {
  392. $masteryLabel = '待攻克';
  393. $masteryStyle = 'bg-red-100 text-red-700';
  394. }
  395. @endphp
  396. <div>
  397. <dt class="text-gray-500">掌握度</dt>
  398. <dd class="text-gray-900">
  399. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium {{ $masteryStyle }}">
  400. {{ $masteryLabel }}({{ $this->historySummary['correct'] }}/{{ $this->historySummary['total'] }})
  401. </span>
  402. </dd>
  403. </div>
  404. @endif
  405. @if (!empty($this->questionData['created_at']))
  406. <div>
  407. <dt class="text-gray-500">创建时间</dt>
  408. <dd class="text-gray-900">{{ \Carbon\Carbon::parse($this->questionData['created_at'])->format('Y-m-d H:i:s') }}</dd>
  409. </div>
  410. @endif
  411. </dl>
  412. </div>
  413. @endif
  414. {{-- 作答历史 --}}
  415. @if (!empty($this->historySummary))
  416. <div class="bg-white rounded-lg shadow-sm p-6">
  417. <h3 class="text-lg font-semibold text-gray-900 mb-4">作答历史</h3>
  418. <dl class="space-y-3 text-sm">
  419. <div class="flex items-center justify-between">
  420. <dt class="text-gray-500">总尝试</dt>
  421. <dd class="text-gray-900 font-medium">{{ $this->historySummary['total'] }}</dd>
  422. </div>
  423. <div class="flex items-center justify-between">
  424. <dt class="text-gray-500">答对次数</dt>
  425. <dd class="text-gray-900 font-medium">{{ $this->historySummary['correct'] }}</dd>
  426. </div>
  427. <div class="flex items-center justify-between">
  428. <dt class="text-gray-500">最近结果</dt>
  429. <dd class="text-gray-900">
  430. @if($this->historySummary['last_correct'])
  431. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700">正确</span>
  432. @else
  433. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-red-100 text-red-700">错误</span>
  434. @endif
  435. </dd>
  436. </div>
  437. @if(!empty($this->historySummary['last_time']))
  438. <div class="flex items-center justify-between">
  439. <dt class="text-gray-500">最近时间</dt>
  440. <dd class="text-gray-900">
  441. {{ \Carbon\Carbon::parse($this->historySummary['last_time'])->format('Y-m-d H:i') }}
  442. </dd>
  443. </div>
  444. @endif
  445. </dl>
  446. </div>
  447. @endif
  448. {{-- 答题信息(错题/正确均展示) --}}
  449. @if ($this->sourceType === 'mistake' && !empty($this->questionData['mistake_info']))
  450. <div class="bg-white rounded-lg shadow-sm p-6">
  451. <h3 class="text-lg font-semibold text-gray-900 mb-4">
  452. {{ $this->questionData['mistake_info']['correct'] ? '答题信息' : '错题信息' }}
  453. </h3>
  454. <dl class="space-y-3 text-sm">
  455. <div>
  456. <dt class="text-gray-500">记录ID</dt>
  457. <dd class="text-gray-900 font-mono">{{ $this->mistakeId }}</dd>
  458. </div>
  459. <div>
  460. <dt class="text-gray-500">学生</dt>
  461. <dd class="text-gray-900 font-mono">
  462. @if($this->studentName)
  463. {{ $this->studentName }}({{ $this->studentId }})
  464. @else
  465. {{ $this->studentId }}
  466. @endif
  467. </dd>
  468. </div>
  469. <div>
  470. <dt class="text-gray-500">是否正确</dt>
  471. <dd class="text-gray-900">
  472. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium {{ $this->questionData['mistake_info']['correct'] ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700' }}">
  473. {{ $this->questionData['mistake_info']['correct'] ? '正确' : '错误' }}
  474. </span>
  475. </dd>
  476. </div>
  477. <div>
  478. <dt class="text-gray-500">错误类型</dt>
  479. <dd class="text-gray-900">{{ $this->questionData['mistake_info']['error_type'] ?? '未分类' }}</dd>
  480. </div>
  481. <div>
  482. <dt class="text-gray-500">错误类别</dt>
  483. <dd class="text-gray-900">{{ $this->questionData['mistake_info']['mistake_category'] ?? '未分类' }}</dd>
  484. </div>
  485. @if (!empty($this->questionData['mistake_info']['created_at']))
  486. <div>
  487. <dt class="text-gray-500">记录时间</dt>
  488. <dd class="text-gray-900">{{ \Carbon\Carbon::parse($this->questionData['mistake_info']['created_at'])->format('Y-m-d H:i:s') }}</dd>
  489. </div>
  490. @endif
  491. </dl>
  492. </div>
  493. @endif
  494. </div>
  495. </div>
  496. @endif
  497. </div>
  498. </div>
  499. </div>