exam-grading.blade.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. @php
  2. // 复用题目数据并开启判卷模式(显示方框+答案+思路)
  3. $grading = true;
  4. @endphp
  5. <!DOCTYPE html>
  6. <html lang="zh-CN">
  7. <head>
  8. <meta charset="UTF-8">
  9. <title>{{ $paper->paper_name ?? '判卷预览' }}</title>
  10. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
  11. <style>
  12. @page { size: A4; margin: 2cm; }
  13. :root {
  14. --question-gap: 6px;
  15. }
  16. body {
  17. font-family: "SimSun", "Songti SC", serif;
  18. line-height: 1.65;
  19. color: #000;
  20. background: #fff;
  21. font-size: 14px;
  22. }
  23. .page {
  24. max-width: 720px;
  25. margin: 0 auto;
  26. padding: 0 12px;
  27. }
  28. .header { text-align: center; margin-bottom: 1.5rem; border-bottom: 2px solid #000; padding-bottom: 1rem; }
  29. .section-title { font-size: 16px; font-weight: bold; margin-top: 16px; margin-bottom: 10px; }
  30. .question { margin-bottom: 14px; page-break-inside: avoid; }
  31. .question-grid {
  32. display: grid;
  33. grid-template-columns: auto 1fr;
  34. column-gap: 4px;
  35. row-gap: 6px;
  36. align-items: flex-start;
  37. }
  38. .question-lead {
  39. display: flex;
  40. gap: 4px;
  41. align-items: flex-start;
  42. font-weight: 600;
  43. font-size: 14px;
  44. line-height: 1.6;
  45. margin-top: 2px;
  46. }
  47. .question-lead.spacer { visibility: hidden; }
  48. .question-number { white-space: nowrap; margin-right: 2px; }
  49. .grading-boxes { gap: 4px; flex-wrap: wrap; align-items: center; }
  50. .grading-boxes span { vertical-align: middle; }
  51. .question-main { font-size: 14px; line-height: 1.65; font-family: inherit; display: block; }
  52. .question-score { margin-right: 6px; font-weight: 600; }
  53. .question-stem { display: inline-block; font-size: 14px; font-family: inherit; }
  54. .options { display: grid; row-gap: 8px; margin-top: 8px; }
  55. .options-grid-2 {
  56. display: grid;
  57. grid-template-columns: 1fr 1fr;
  58. gap: 8px 20px;
  59. }
  60. .option { display: flex; align-items: flex-start; font-size: 14px; line-height: 1.6; }
  61. .option strong { margin-right: 4px; }
  62. .option-compact { font-size: 14px; line-height: 1.6; }
  63. .answer-area { position: relative; margin-top: 4px; }
  64. .answer-area.boxy {
  65. min-height: 150px;
  66. border: 1.5px solid #444;
  67. border-radius: 6px;
  68. padding: 14px;
  69. }
  70. .answer-label {
  71. position: absolute;
  72. top: -10px;
  73. left: 10px;
  74. font-size: 10px;
  75. background: #fff;
  76. padding: 0 4px;
  77. color: #555;
  78. letter-spacing: 1px;
  79. }
  80. .answer-meta {
  81. font-size: 12px;
  82. color: #2f2f2f;
  83. line-height: 1.75;
  84. margin-top: 4px;
  85. }
  86. .answer-line + .answer-line { margin-top: 4px; }
  87. .solution-step {
  88. align-items: center;
  89. gap: 6px;
  90. }
  91. .step-box { display: inline-block; }
  92. .step-label { white-space: nowrap; }
  93. .solution-heading { font-weight: 700; }
  94. .solution-content { display: inline-block; line-height: 1.75; }
  95. svg, .math-render svg { max-width: 100%; height: auto; display: block; }
  96. </style>
  97. </head>
  98. <body>
  99. <div class="page">
  100. <div class="header">
  101. <div style="font-size:22px;font-weight:bold;">判卷专用</div>
  102. <div style="font-size:18px;">{{ $paper->paper_name ?? '未命名试卷' }}</div>
  103. <div style="display:flex;justify-content:space-between;font-size:14px;margin-top:8px;">
  104. <span>老师:{{ $teacher['name'] ?? '________' }}</span>
  105. <span>年级:{{ $student['grade'] ?? '________' }}</span>
  106. <span>姓名:{{ $student['name'] ?? '________' }}</span>
  107. <span>得分:________</span>
  108. </div>
  109. </div>
  110. @include('components.exam.paper-body', ['questions' => $questions, 'grading' => true])
  111. </div>
  112. <!-- KaTeX -->
  113. <script src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
  114. <script src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"></script>
  115. <script>
  116. document.addEventListener('DOMContentLoaded', function() {
  117. try {
  118. renderMathInElement(document.body, {
  119. delimiters: [
  120. {left: '$$', right: '$$', display: true},
  121. {left: '$', right: '$', display: false},
  122. {left: '\\\\(', right: '\\\\)', display: false},
  123. {left: '\\\\[', right: '\\\\]', display: true}
  124. ],
  125. throwOnError: false,
  126. strict: false,
  127. trust: true
  128. });
  129. } catch(e) {}
  130. });
  131. </script>
  132. </body>
  133. </html>