ocr-analysis-view.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <div>
  2. @push('styles')
  3. <style>
  4. .stat-card {
  5. transition: all 0.3s;
  6. }
  7. .stat-card:hover {
  8. transform: translateY(-2px);
  9. box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  10. }
  11. .progress-bar {
  12. height: 8px;
  13. border-radius: 4px;
  14. background: #e5e7eb;
  15. overflow: hidden;
  16. }
  17. .progress-fill {
  18. height: 100%;
  19. transition: width 0.5s;
  20. }
  21. .excellent { background: #10b981; }
  22. .good { background: #3b82f6; }
  23. .average { background: #f59e0b; }
  24. .poor { background: #ef4444; }
  25. </style>
  26. @endpush
  27. <div class="space-y-6">
  28. <!-- 头部信息 -->
  29. <div class="bg-white p-6 rounded-lg shadow">
  30. <div class="flex items-center justify-between mb-4">
  31. <div>
  32. <h1 class="text-2xl font-bold text-gray-900">{{ $record->paper_title }}</h1>
  33. <p class="text-sm text-gray-500 mt-1">
  34. 学生ID:{{ $record->user_id }} |
  35. 提交时间:{{ $record->created_at->format('Y-m-d H:i:s') }}
  36. </p>
  37. </div>
  38. <button
  39. wire:click="reanalyze"
  40. class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700"
  41. >
  42. 重新分析
  43. </button>
  44. </div>
  45. <!-- 处理状态 -->
  46. <div class="flex items-center gap-4 p-4 bg-gray-50 rounded-lg">
  47. <div class="flex items-center gap-2">
  48. <div class="w-3 h-3 rounded-full {{ $record->status === 'completed' ? 'bg-green-500' : 'bg-gray-400' }}"></div>
  49. <span class="text-sm font-medium">OCR状态:{{ $record->status }}</span>
  50. </div>
  51. <div class="flex items-center gap-2">
  52. <div class="w-3 h-3 rounded-full {{ $record->questions->count() > 0 ? 'bg-green-500' : 'bg-gray-400' }}"></div>
  53. <span class="text-sm font-medium">题目数:{{ $record->questions->count() }}</span>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- 整体成绩 -->
  58. <div class="grid grid-cols-1 md:grid-cols-4 gap-6">
  59. <div class="stat-card bg-white p-6 rounded-lg shadow">
  60. <div class="flex items-center justify-between">
  61. <div>
  62. <p class="text-sm font-medium text-gray-600">总得分</p>
  63. <p class="text-3xl font-bold text-gray-900 mt-2">{{ $analysisData['total_score'] ?? 0 }}</p>
  64. <p class="text-sm text-gray-500 mt-1">满分 {{ $analysisData['max_score'] ?? 0 }}</p>
  65. </div>
  66. <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center">
  67. <x-heroicon-o-trophy class="w-8 h-8 text-blue-600" />
  68. </div>
  69. </div>
  70. </div>
  71. <div class="stat-card bg-white p-6 rounded-lg shadow">
  72. <div class="flex items-center justify-between">
  73. <div>
  74. <p class="text-sm font-medium text-gray-600">正确率</p>
  75. <p class="text-3xl font-bold text-gray-900 mt-2">{{ $analysisData['accuracy_rate'] ?? 0 }}%</p>
  76. <p class="text-sm text-gray-500 mt-1">{{ $analysisData['correct_count'] ?? 0 }}/{{ $analysisData['total_count'] ?? 0 }} 题</p>
  77. </div>
  78. <div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center">
  79. <x-heroicon-o-check-circle class="w-8 h-8 text-green-600" />
  80. </div>
  81. </div>
  82. </div>
  83. <div class="stat-card bg-white p-6 rounded-lg shadow">
  84. <div class="flex items-center justify-between">
  85. <div>
  86. <p class="text-sm font-medium text-gray-600">平均分</p>
  87. <p class="text-3xl font-bold text-gray-900 mt-2">{{ $analysisData['average_score'] ?? 0 }}</p>
  88. <p class="text-sm text-gray-500 mt-1">每题平均</p>
  89. </div>
  90. <div class="w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center">
  91. <x-heroicon-o-chart-bar class="w-8 h-8 text-yellow-600" />
  92. </div>
  93. </div>
  94. </div>
  95. <div class="stat-card bg-white p-6 rounded-lg shadow">
  96. <div class="flex items-center justify-between">
  97. <div>
  98. <p class="text-sm font-medium text-gray-600">题目总数</p>
  99. <p class="text-3xl font-bold text-gray-900 mt-2">{{ $analysisData['total_count'] ?? 0 }}</p>
  100. <p class="text-sm text-gray-500 mt-1">已识别题目</p>
  101. </div>
  102. <div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center">
  103. <x-heroicon-o-document-text class="w-8 h-8 text-purple-600" />
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- 知识点分析 -->
  109. @if(count($knowledgeStats) > 0)
  110. <div class="bg-white p-6 rounded-lg shadow">
  111. <h2 class="text-xl font-bold text-gray-900 mb-4">知识点掌握情况</h2>
  112. <div class="space-y-4">
  113. @foreach($knowledgeStats as $kp)
  114. <div>
  115. <div class="flex items-center justify-between mb-2">
  116. <span class="text-sm font-medium text-gray-700">{{ $kp['kp_code'] }}</span>
  117. <span class="text-sm text-gray-600">{{ round($kp['correct_rate'] * 100, 1) }}% 正确率</span>
  118. </div>
  119. <div class="progress-bar">
  120. <div class="progress-fill {{ $kp['correct_rate'] >= 0.8 ? 'excellent' : ($kp['correct_rate'] >= 0.6 ? 'good' : ($kp['correct_rate'] >= 0.4 ? 'average' : 'poor')) }}"
  121. style="width: {{ $kp['correct_rate'] * 100 }}%"></div>
  122. </div>
  123. </div>
  124. @endforeach
  125. </div>
  126. </div>
  127. @endif
  128. <!-- 能力画像 -->
  129. @if(count($abilityProfile) > 0)
  130. <div class="bg-white p-6 rounded-lg shadow">
  131. <h2 class="text-xl font-bold text-gray-900 mb-4">能力画像</h2>
  132. <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
  133. @foreach($abilityProfile as $ability => $score)
  134. <div class="p-4 border border-gray-200 rounded-lg">
  135. <div class="flex items-center justify-between mb-2">
  136. <span class="text-sm font-medium text-gray-700">{{ $ability }}</span>
  137. <span class="text-lg font-bold text-gray-900">{{ $score }}</span>
  138. </div>
  139. <div class="progress-bar">
  140. <div class="progress-fill {{ $score >= 85 ? 'excellent' : ($score >= 70 ? 'good' : ($score >= 60 ? 'average' : 'poor')) }}"
  141. style="width: {{ $score }}%"></div>
  142. </div>
  143. </div>
  144. @endforeach
  145. </div>
  146. </div>
  147. @endif
  148. <!-- 题目详情 -->
  149. <div class="bg-white p-6 rounded-lg shadow">
  150. <h2 class="text-xl font-bold text-gray-900 mb-4">题目详情分析</h2>
  151. <div class="overflow-x-auto">
  152. <table class="w-full">
  153. <thead>
  154. <tr class="border-b border-gray-200">
  155. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">题号</th>
  156. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">题型</th>
  157. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">学生答案</th>
  158. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">置信度</th>
  159. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">得分</th>
  160. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">AI反馈</th>
  161. <th class="text-left py-3 px-4 text-sm font-semibold text-gray-600">错误分析</th>
  162. </tr>
  163. </thead>
  164. <tbody>
  165. @foreach($this->getQuestionDetails() as $question)
  166. <tr class="border-b border-gray-100 hover:bg-gray-50">
  167. <td class="py-3 px-4 text-sm font-medium text-gray-900">第{{ $question['question_number'] }}题</td>
  168. <td class="py-3 px-4 text-sm text-gray-600">
  169. <span class="px-2 py-1 rounded-full text-xs
  170. @switch($question['question_type'])
  171. @case('choice') bg-blue-100 text-blue-800 @break
  172. @case('fill') bg-green-100 text-green-800 @break
  173. @case('solve') bg-purple-100 text-purple-800 @break
  174. @default bg-gray-100 text-gray-800
  175. @endswitch
  176. ">
  177. {{ $question['question_type'] === 'choice' ? '选择题' : ($question['question_type'] === 'fill' ? '填空题' : '解答题') }}
  178. </span>
  179. </td>
  180. <td class="py-3 px-4 text-sm text-gray-900">{{ $question['student_answer'] }}</td>
  181. <td class="py-3 px-4 text-sm text-gray-600">{{ round($question['answer_confidence'] * 100, 1) }}%</td>
  182. <td class="py-3 px-4 text-sm">
  183. <span class="px-2 py-1 rounded-full text-xs {{ $question['ai_score'] > 0 ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' }}">
  184. {{ $question['ai_score'] }}分
  185. </span>
  186. </td>
  187. <td class="py-3 px-4 text-sm text-gray-600">{{ Str::limit($question['ai_feedback'], 30) }}</td>
  188. <td class="py-3 px-4 text-sm text-gray-600">{{ $question['error_analysis'] }}</td>
  189. </tr>
  190. @endforeach
  191. </tbody>
  192. </table>
  193. </div>
  194. </div>
  195. <!-- 错题重点推荐 -->
  196. <div class="bg-white p-6 rounded-lg shadow">
  197. <h2 class="text-xl font-bold text-gray-900 mb-4">学习建议</h2>
  198. <div class="space-y-3">
  199. @if(($analysisData['accuracy_rate'] ?? 0) >= 80)
  200. <div class="p-4 bg-green-50 border border-green-200 rounded-lg">
  201. <div class="flex items-start gap-3">
  202. <x-heroicon-o-check-circle class="w-6 h-6 text-green-600 mt-0.5" />
  203. <div>
  204. <p class="font-medium text-green-900">表现优秀!</p>
  205. <p class="text-sm text-green-700 mt-1">您的整体表现很好,建议挑战更高难度的题目。</p>
  206. </div>
  207. </div>
  208. </div>
  209. @elseif(($analysisData['accuracy_rate'] ?? 0) >= 60)
  210. <div class="p-4 bg-yellow-50 border border-yellow-200 rounded-lg">
  211. <div class="flex items-start gap-3">
  212. <x-heroicon-o-exclamation-triangle class="w-6 h-6 text-yellow-600 mt-0.5" />
  213. <div>
  214. <p class="font-medium text-yellow-900">需要加强</p>
  215. <p class="text-sm text-yellow-700 mt-1">部分知识点掌握不够牢固,建议重点复习。</p>
  216. </div>
  217. </div>
  218. </div>
  219. @else
  220. <div class="p-4 bg-red-50 border border-red-200 rounded-lg">
  221. <div class="flex items-start gap-3">
  222. <x-heroicon-o-x-circle class="w-6 h-6 text-red-600 mt-0.5" />
  223. <div>
  224. <p class="font-medium text-red-900">需要努力</p>
  225. <p class="text-sm text-red-700 mt-1">建议系统复习基础知识,从基础题目开始练习。</p>
  226. </div>
  227. </div>
  228. </div>
  229. @endif
  230. </div>
  231. </div>
  232. </div>
  233. </div>