question-preview.blade.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>题目预览</title>
  6. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
  7. <style>
  8. @page {
  9. size: A4;
  10. margin: 2cm;
  11. }
  12. body {
  13. font-family: "SimSun", "Songti SC", serif;
  14. line-height: 1.8;
  15. color: #000;
  16. background: #fff;
  17. font-size: 14px;
  18. }
  19. .page {
  20. max-width: 720px;
  21. margin: 0 auto;
  22. padding: 20px;
  23. }
  24. .header {
  25. text-align: center;
  26. margin-bottom: 20px;
  27. padding-bottom: 10px;
  28. border-bottom: 2px solid #333;
  29. }
  30. .header h1 {
  31. font-size: 18px;
  32. margin: 0;
  33. }
  34. .question-section {
  35. margin-bottom: 20px;
  36. }
  37. .section-title {
  38. font-weight: bold;
  39. font-size: 14px;
  40. color: #333;
  41. margin-bottom: 8px;
  42. }
  43. .question-stem {
  44. margin-bottom: 15px;
  45. line-height: 2;
  46. }
  47. .question-options {
  48. margin-left: 20px;
  49. margin-bottom: 15px;
  50. }
  51. .option-item {
  52. margin: 8px 0;
  53. line-height: 1.8;
  54. }
  55. .option-label {
  56. font-weight: bold;
  57. margin-right: 8px;
  58. }
  59. .answer-section {
  60. margin-top: 20px;
  61. padding-top: 15px;
  62. border-top: 1px dashed #999;
  63. }
  64. .answer-label {
  65. font-weight: bold;
  66. color: #2563eb;
  67. }
  68. .solution-section {
  69. margin-top: 15px;
  70. padding: 15px;
  71. background: #f5f5f5;
  72. border-radius: 4px;
  73. }
  74. .solution-title {
  75. font-weight: bold;
  76. margin-bottom: 10px;
  77. }
  78. .solution-content {
  79. line-height: 2;
  80. }
  81. /* KaTeX 样式调整 */
  82. .katex {
  83. font-size: 1.1em;
  84. }
  85. .katex-display {
  86. margin: 0.5em 0;
  87. }
  88. </style>
  89. </head>
  90. <body>
  91. <div class="page">
  92. <div class="header">
  93. <h1>题目预览</h1>
  94. </div>
  95. <!-- 题干 -->
  96. <div class="question-section">
  97. <div class="section-title">题目</div>
  98. <div class="question-stem">{!! $stem !!}</div>
  99. </div>
  100. <!-- 选项(如果有) -->
  101. @if($options && count($options) > 0)
  102. <div class="question-section">
  103. <div class="section-title">选项</div>
  104. <div class="question-options">
  105. @foreach($options as $key => $value)
  106. <div class="option-item">
  107. <span class="option-label">{{ $key }}.</span>
  108. <span>{!! $value !!}</span>
  109. </div>
  110. @endforeach
  111. </div>
  112. </div>
  113. @endif
  114. <!-- 答案 -->
  115. @if($answer)
  116. <div class="answer-section">
  117. <span class="answer-label">正确答案:</span>
  118. <span>{!! $answer !!}</span>
  119. </div>
  120. @endif
  121. <!-- 解析 -->
  122. @if($solution)
  123. <div class="solution-section">
  124. <div class="solution-title">解题思路</div>
  125. <div class="solution-content">{!! $solution !!}</div>
  126. </div>
  127. @endif
  128. </div>
  129. </body>
  130. </html>