<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      培訓管理子系統開發4

      整個項目預期的任務量 (任務量 = 所有工作的預期時間10天)和 目前已經花的時間 (所有記錄的 ‘已經花費的時間’4天),還剩余的時間(所有工作的 ‘剩余時間’6天)


      實現了試卷管理試卷的發布與瀏覽

      package com.example.training.entity;
      
      import javax.persistence.*;
      
      @Entity
      public class ExamPaper {
          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          private Integer id;
      
          private String name;
      
          @Column(columnDefinition = "TEXT")
          private String content;
      
          private String answer;
          private String score;
      
          public ExamPaper() {
          }
      
          public ExamPaper(Integer id, String name, String content, String answer, String score) {
              this.id = id;
              this.name = name;
              this.content = content;
              this.answer = answer;
              this.score = score;
          }
      
          public Integer getId() {
              return id;
          }
      
          public void setId(Integer id) {
              this.id = id;
          }
      
          public String getName() {
              return name;
          }
      
          public void setName(String name) {
              this.name = name;
          }
      
          public String getContent() {
              return content;
          }
      
          public void setContent(String content) {
              this.content = content;
          }
      
          public String getAnswer() {
              return answer;
          }
      
          public void setAnswer(String answer) {
              this.answer = answer;
          }
      
          public String getScore() {
              return score;
          }
      
          public void setScore(String score) {
              this.score = score;
          }
      }
      // 試卷管理
          @GetMapping("/papers")
          public String paperManage(HttpSession session, Model model) {
              if (!checkAdmin(session)) return "redirect:/login";
              model.addAttribute("papers", adminService.findAllExamPapers());
              return "admin/paper";
          }
      
          @PostMapping("/papers")
          public String savePaper(@ModelAttribute ExamPaper paper, HttpSession session) {
              if (!checkAdmin(session)) return "redirect:/login";
              adminService.saveExamPaper(paper);
              return "redirect:/admin/papers";
          }
      
          @PostMapping("/papers/delete/{id}")
          public String deletePaper(@PathVariable Integer id,
                                    HttpSession session,
                                    RedirectAttributes ra) {
              if (!checkAdmin(session)) return "redirect:/login";
              try {
                  adminService.deleteExamPaper(id);
                  ra.addFlashAttribute("success", "刪除試卷成功");
              } catch (Exception e) {
                  ra.addFlashAttribute("error", "刪除失敗:" + e.getMessage());
              }
              return "redirect:/admin/papers";
          }
          @PostMapping("/papers/score/{id}")
          public String updateScore(@PathVariable Integer id,
                                    @RequestParam String score,
                                    HttpSession session) {
              if (!checkAdmin(session)) return "redirect:/login";
              adminService.updateExamScore(id, score);
              return "redirect:/admin/papers";
          }
      <!DOCTYPE html>
      <html xmlns:th="http://www.thymeleaf.org">
      <head>
        <title>試卷管理</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style>
          /* 基礎樣式 */
          body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            margin: 0;
            min-height: 100vh;
            padding: 2rem;
          }
      
          .admin-container {
            background: rgba(255, 255, 255, 0.98);
            border-radius: 16px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
            padding: 2.5rem;
            max-width: 1200px;
            margin: 0 auto;
            backdrop-filter: blur(8px);
          }
      
          /* 提示信息 */
          .alert-container {
            position: fixed;
            top: 20px;
            right: 20px;
            max-width: 400px;
            z-index: 1000;
          }
          .alert {
            padding: 1rem 1.5rem;
            border-radius: 8px;
            margin-bottom: 1rem;
            font-weight: 500;
            transition: opacity 0.5s ease;
          }
          .alert.success {
            background: #e8f6ef;
            color: #2e7d32;
            border: 1px solid #a5d6a7;
          }
          .alert.error {
            background: #ffebee;
            color: #c62828;
            border: 1px solid #ffcdd2;
          }
      
          /* 返回鏈接 */
          .back-link {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color: #2a5298;
            padding: 0.8rem 1.2rem;
            border-radius: 6px;
            background: rgba(42,82,152,0.1);
            transition: all 0.2s ease;
            text-decoration: none;
            margin-bottom: 2rem;
          }
          .back-link:hover {
            background: rgba(42,82,152,0.2);
            transform: translateX(-3px);
          }
      
          /* 標題樣式 */
          h2 {
            color: #1e3c72;
            margin: 0 0 2rem;
            padding-bottom: 1rem;
            border-bottom: 3px solid #1e3c72;
            font-size: 2rem;
            letter-spacing: -0.5px;
          }
      
          /* 表單樣式 */
          form {
            background: #f8f9fa;
            padding: 2rem;
            border-radius: 12px;
            margin-bottom: 3rem;
          }
          input, textarea {
            width: 100%;
            padding: 12px;
            margin: 10px 0;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s ease;
          }
          input:focus, textarea:focus {
            border-color: #1e3c72;
            box-shadow: 0 0 0 3px rgba(30,60,114,0.1);
            outline: none;
          }
          button[type="submit"] {
            background: #1e3c72;
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
            margin-top: 1rem;
          }
          button[type="submit"]:hover {
            background: #2a5298;
            transform: translateY(-2px);
          }
      
          /* 表格樣式 */
          .paper-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 6px rgba(0,0,0,0.05);
          }
          th {
            background: linear-gradient(135deg, #1e3c72, #2a5298);
            color: white;
            padding: 1rem;
            font-weight: 600;
            text-align: left;
          }
          td {
            padding: 1rem;
            border-bottom: 1px solid #f0f4f8;
            vertical-align: top;
          }
          .content-cell div {
            max-height: 100px;
            overflow-y: auto;
            line-height: 1.6;
          }
          tr:hover {
            background-color: #f8fafc;
          }
      
          /* 刪除按鈕 */
          .delete-btn {
            background: #c62828 !important;
            color: white !important;
            padding: 8px 16px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
          }
          .delete-btn:hover {
            background: #b71c1c !important;
            transform: translateY(-1px);
          }
      
          /* 響應式設計 */
          @media (max-width: 768px) {
            .admin-container {
              padding: 1.5rem;
            }
            form {
              padding: 1.5rem;
            }
            .paper-table {
              display: block;
              overflow-x: auto;
            }
            th, td {
              min-width: 200px;
            }
          }
          .alert-container {
            position: fixed;
            top: 80px;  /* 在導航欄下方 */
            right: 20px;
            z-index: 1000;
          }
        </style>
      </head>
      <body>
      <!-- 提示信息容器 -->
      <div class="alert-container">
        <div th:if="${success}" class="alert success" th:text="${success}"></div>
        <div th:if="${error}" class="alert error" th:text="${error}"></div>
      </div>
      
      <div class="admin-container">
      
        <h2>試卷管理系統</h2>
      
        <h3>新增試卷</h3>
        <form th:action="@{/admin/papers}" method="post">
          <input type="text" name="name" placeholder="試卷名稱" required>
          <textarea name="content" placeholder="試卷內容" rows="4"></textarea>
          <input type="text" name="answer" placeholder="答案">
          <button type="submit">發布試卷</button>
        </form>
      
        <h3>試卷列表</h3>
        <table class="paper-table">
          <thead>
          <tr>
            <th style="width: 20%">試卷名稱</th>
            <th style="width: 60%">試卷內容</th>
            <th style="width: 20%">操作</th>
          </tr>
          </thead>
          <tbody>
          <tr th:each="paper : ${papers}">
            <td th:text="${paper.name}"></td>
            <td class="content-cell">
              <div th:text="${paper.content}"></div>
            </td>
            <td>
              <form class="delete-form"
                    th:action="@{/admin/papers/delete/{id}(id=${paper.id})}"
                    method="post"
                    onsubmit="return confirm('確定刪除該試卷嗎?');">
                <button type="submit" class="delete-btn">刪除</button>
              </form>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
      
      <script>
        /* 自動隱藏提示 */
        document.addEventListener('DOMContentLoaded', function() {
          const alerts = document.querySelectorAll('.alert');
          alerts.forEach(alert => {
            setTimeout(() => {
              alert.style.opacity = '0';
              setTimeout(() => alert.remove(), 1000);
            }, 3000);
          });
        });
      </script>
      </body>
      </html>
      
      posted @ 2025-04-19 20:41  霸王雞  閱讀(6)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 龙陵县| 最近中文字幕完整版hd| 亚洲色婷婷一区二区三区| 国产破外女出血视频| 欧美成人精品手机在线| 日韩精品一区二区高清视频| 宅男噜噜噜66在线观看| 白河县| 国产精品久久久久影院色| 亚洲av永久无码精品秋霞电影影院| 久久AV中文综合一区二区| 日韩区中文字幕在线观看| 亚洲熟妇自偷自拍另欧美| 精品三级在线| 国产精品黄色一区二区三区| 亚洲日韩国产精品第一页一区| 亚洲中少妇久久中文字幕| 国产亚洲精品成人无码精品网站| 亚洲另类在线制服丝袜国产| 无码中文字幕乱码一区| 国产黄色三级三级看三级| 多伦县| 精品人妻av区乱码| 中文字幕乱偷无码av先锋蜜桃 | 精品亚洲女同一区二区| 中文字幕国产在线精品| 国产av仑乱内谢| 中文无码日韩欧免费视频| 91老肥熟女九色老女人| 日本高清一区二区三| 久久精品无码免费不卡| 成人国产乱对白在线观看| 精品无码久久久久国产| 亚洲中文字幕亚洲中文精| 亚洲成a人片在线观看中文| 蜜臀91精品高清国产福利| 国产二区三区不卡免费| 欧美成本人视频免费播放| 日韩av一区二区不卡在线| 久久久久国产精品人妻| 国产乱精品一区二区三区|