question-check.blade.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. </style>
  42. </head>
  43. <body style="page-break-before: always;">
  44. <div class="page">
  45. <div class="header">
  46. <div style="font-size:22px;font-weight:bold;">题干区</div>
  47. <div style="display:flex;justify-content:space-between;font-size:14px;margin-top:8px;">
  48. <span>老师:{{ $teacher['name'] ?? '________' }}</span>
  49. <span>年级:@formatGrade($student['grade'] ?? '________')</span>
  50. <span>类型:题目质检</span>
  51. <span>姓名:{{ $student['name'] ?? '________' }}</span>
  52. <span>得分:________</span>
  53. </div>
  54. </div>
  55. @include('components.exam.paper-body', ['questions' => $questions, 'grading' => false])
  56. </div>
  57. <div class="page">
  58. @include('pdf.partials.question-check-page', ['questions' => $questions])
  59. </div>
  60. @include('pdf.partials.question-check-scan-sheet', [
  61. 'questions' => $questions,
  62. 'gradingCode' => $gradingCode,
  63. 'teacher' => $teacher,
  64. 'student' => $student,
  65. 'pdfMeta' => $pdfMeta ?? [],
  66. ])
  67. <script src="/js/katex.min.js"></script>
  68. <script src="/js/auto-render.min.js"></script>
  69. <script>
  70. document.addEventListener('DOMContentLoaded', function() {
  71. try {
  72. renderMathInElement(document.body, {
  73. delimiters: [
  74. {left: '$$', right: '$$', display: true},
  75. {left: '$', right: '$', display: false},
  76. {left: '\\(', right: '\\)', display: false},
  77. {left: '\\[', right: '\\]', display: true}
  78. ],
  79. throwOnError: false,
  80. strict: false,
  81. trust: true
  82. });
  83. } catch (e) {}
  84. });
  85. </script>
  86. </body>
  87. </html>