question-check.blade.php 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. @php
  2. $gradingCode = $pdfMeta['exam_code'] ?? ($paper->paper_id ?? 'unknown');
  3. $studentName = $pdfMeta['student_name'] ?? ($student['name'] ?? ($paper->student_id ?? '________'));
  4. $paperHeaderTitle = $pdfMeta['header_title'] ?? ($studentName . '|' . $gradingCode . '|题目质检');
  5. $generateDateTime = now()->format('Y年m月d日 H:i:s');
  6. @endphp
  7. <!DOCTYPE html>
  8. <html lang="zh-CN">
  9. <head>
  10. <meta charset="UTF-8">
  11. <title>{{ $pdfMeta['grading_pdf_title'] ?? ($paper->paper_name ?? '题目质检预览') }}</title>
  12. <link rel="stylesheet" href="/css/katex/katex.min.css">
  13. <style>
  14. @page {
  15. size: A4;
  16. margin: 2.2cm 2cm 2.3cm 2cm;
  17. @top-left { content: "知了数学·{{ $generateDateTime }}"; font-size: 13px; color: #666; }
  18. @top-center { content: "{{ $studentName }}"; font-size: 13px; color: #666; }
  19. @top-right {
  20. content: "{{ $gradingCode }}";
  21. font-size: 19px;
  22. font-weight: 600;
  23. font-family: "Noto Sans", "Liberation Sans", "Nimbus Sans", sans-serif;
  24. color: #222;
  25. }
  26. @bottom-left { content: "{{ $paperHeaderTitle }}"; font-size: 11px; color: #666; }
  27. @bottom-right { content: counter(page) "/" counter(pages); font-size: 13px; color: #666; }
  28. }
  29. body {
  30. font-family: "Noto Serif", "Noto Serif CJK SC", "Noto Sans CJK SC", "Noto Sans", "STSongti-SC", "PingFang SC", "Songti SC", serif;
  31. line-height: 1.65;
  32. color: #000;
  33. background: #fff;
  34. font-size: 14px;
  35. }
  36. .page { max-width: 720px; margin: 0 auto; padding: 0 12px; }
  37. .header { text-align: center; margin-bottom: 1.1rem; border-bottom: 2px solid #000; padding-bottom: 0.8rem; }
  38. @include('pdf.partials.answer-detail-styles')
  39. @include('pdf.partials.grading-scan-sheet-styles')
  40. @include('pdf.partials.paper-body-core-styles')
  41. @include('pdf.partials.paper-exam-shared-image-styles')
  42. </style>
  43. </head>
  44. <body style="page-break-before: always;">
  45. <div class="page">
  46. <div class="header">
  47. <div style="font-size:22px;font-weight:bold;">题干区</div>
  48. <div style="display:flex;justify-content:space-between;font-size:14px;margin-top:8px;">
  49. <span>老师:{{ $teacher['name'] ?? '________' }}</span>
  50. <span>年级:@formatGrade($student['grade'] ?? '________')</span>
  51. <span>类型:题目质检</span>
  52. <span>姓名:{{ $student['name'] ?? '________' }}</span>
  53. <span>得分:________</span>
  54. </div>
  55. </div>
  56. @include('components.exam.paper-body', ['questions' => $questions, 'grading' => false])
  57. </div>
  58. <div class="page">
  59. @include('pdf.partials.answer-detail-page', ['questions' => $questions])
  60. </div>
  61. @include('pdf.partials.question-check-scan-sheet', [
  62. 'questions' => $questions,
  63. 'gradingCode' => $gradingCode,
  64. 'teacher' => $teacher,
  65. 'student' => $student,
  66. 'pdfMeta' => $pdfMeta ?? [],
  67. ])
  68. <script src="/js/katex.min.js"></script>
  69. <script src="/js/auto-render.min.js"></script>
  70. <script>
  71. document.addEventListener('DOMContentLoaded', function() {
  72. try {
  73. renderMathInElement(document.body, {
  74. delimiters: [
  75. {left: '$$', right: '$$', display: true},
  76. {left: '$', right: '$', display: false},
  77. {left: '\\(', right: '\\)', display: false},
  78. {left: '\\[', right: '\\]', display: true}
  79. ],
  80. throwOnError: false,
  81. strict: false,
  82. trust: true
  83. });
  84. } catch (e) {}
  85. });
  86. </script>
  87. </body>
  88. </html>