File size: 10,913 Bytes
9045c2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!DOCTYPE html>
<html lang="vi">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>HVU QA - HỆ THỐNG SINH CÂU HỎI</title>
    <meta
      name="description"
      content="HỆ THỐNG SINH CÂU HỎI của Trường Đại học Hùng Vương."
    />
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap"
      rel="stylesheet"
    />
    <link rel="stylesheet" href="/frontend/style.css" />
    <script src="/frontend/app.js" defer></script>
  </head>
  <body>
    <div class="page-shell">
      <aside class="sidebar" id="sidebar">
        <div class="sidebar-top">
          <button
            class="menu-toggle"
            id="menuToggle"
            type="button"
            aria-label="Mở hoặc đóng thanh bên"
            aria-expanded="false"
            aria-controls="sidebarContent"
          >
            <span></span>
            <span></span>
            <span></span>
          </button>
        </div>

        <div class="sidebar-content" id="sidebarContent" aria-hidden="true">
          <section class="side-card">
            <p class="side-label">Chọn model</p>
            <label class="select-shell">
              <span class="select-icon" aria-hidden="true">
                <svg viewBox="0 0 24 24" fill="none">
                  <path
                    d="M12 3 4.5 7.2v9.6L12 21l7.5-4.2V7.2L12 3Zm0 0v8.4m0 0 7.5-4.2M12 11.4 4.5 7.2"
                    stroke="currentColor"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="1.6"
                  />
                </svg>
              </span>
              <select id="modelSelect" disabled>
                <option>Đang tải danh sách model...</option>
              </select>
            </label>
          </section>

          <section class="side-card status-card">
            <div class="status-chip">
              <span class="status-dot" aria-hidden="true"></span>
              <p id="deviceStatus">Đang kiểm tra thiết bị...</p>
            </div>
            <p class="status-note" id="modelStatus">Model sẽ được nạp ở lần sinh câu hỏi đầu tiên.</p>
          </section>

          <section class="side-card history-card">
            <div class="history-header">
              <p class="side-label">Lịch sử</p>
              <button id="clearHistory" type="button">Xóa</button>
            </div>
            <div class="history-list" id="historyList"></div>
          </section>

          <section class="author-card">
            <button
              class="author-toggle"
              id="authorToggle"
              type="button"
              aria-expanded="false"
              aria-controls="authorContent"
            >
              <div class="author-header">
                <div class="author-header-icon" aria-hidden="true">
                  <svg viewBox="0 0 24 24" fill="none">
                    <path
                      d="M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8c0-3.314 3.134-6 7-6s7 2.686 7 6"
                      stroke="currentColor"
                      stroke-linecap="round"
                      stroke-linejoin="round"
                      stroke-width="1.8"
                    />
                  </svg>
                </div>
                <div>
                  <p class="author-title">Tác giả</p>
                </div>
              </div>
              <span class="author-toggle-icon" aria-hidden="true">
                <svg viewBox="0 0 24 24" fill="none">
                  <path
                    d="m8 10 4 4 4-4"
                    stroke="currentColor"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="1.8"
                  />
                </svg>
              </span>
            </button>

            <div class="author-content" id="authorContent" hidden>
              <div class="author-grid" id="authorList"></div>
            </div>

            <div class="author-footer">
              <p id="copyrightLine">© 2026 HVU - KTCN</p>
            </div>
          </section>
        </div>
      </aside>

      <main class="workspace">
        <header class="topbar">
          <div class="identity">
            <img class="logo" src="/frontend/HVU.png" alt="Logo Trường Đại học Hùng Vương" />
            <div class="identity-copy">
              <h1>TRƯỜNG ĐẠI HỌC HÙNG VƯƠNG</h1>
              <p>KHOA KỸ THUẬT - CÔNG NGHỆ</p>
            </div>
          </div>
        </header>

        <section class="hero-panel">
          <div class="hero-copy">
            <h2>
              <span
                class="typewriter-text"
                id="heroTitle"
                data-text="HỆ THỐNG SINH CÂU HỎI"
                aria-label="HỆ THỐNG SINH CÂU HỎI"
              ></span>
            </h2>
          </div>
        </section>

        <section class="result-card" id="resultCard" aria-live="polite" hidden></section>

        <form class="composer" id="generatorForm">
          <div class="input-shell" id="sourceShell">
            <label class="visually-hidden" for="sourceText">Nhập đoạn văn bản</label>
            <textarea
              id="sourceText"
              name="sourceText"
              rows="1"
              placeholder="Nhập đoạn văn bản ..."
              required
            ></textarea>

            <div class="composer-actions">
              <div class="count-shell" aria-label="Số câu hỏi">
                <span class="count-label">Số câu hỏi</span>
                <div class="count-stepper" role="group" aria-label="Điều chỉnh số câu hỏi">
                  <button class="count-button" id="decreaseCount" type="button" aria-label="Giảm số câu hỏi">
                    <span aria-hidden="true">-</span>
                  </button>
                  <output class="count-value" id="questionCountValue" for="questionCount">0</output>
                  <button class="count-button" id="increaseCount" type="button" aria-label="Tăng số câu hỏi">
                    <span aria-hidden="true">+</span>
                  </button>
                </div>
                <input id="questionCount" name="questionCount" type="hidden" value="0" />
              </div>

              <div class="action-cluster">
                <span class="voice-status is-empty" id="voiceStatus" aria-live="polite"></span>
                <div class="action-buttons">
                  <button
                    class="voice-button"
                    id="voiceInputButton"
                    type="button"
                    aria-label="Nhập bằng giọng nói qua trình duyệt"
                  >
                    <span class="voice-button-icon" aria-hidden="true">
                      <svg viewBox="0 0 24 24" fill="none">
                        <path
                          d="M12 15a3.5 3.5 0 0 0 3.5-3.5v-4a3.5 3.5 0 1 0-7 0v4A3.5 3.5 0 0 0 12 15Z"
                          stroke="currentColor"
                          stroke-linecap="round"
                          stroke-linejoin="round"
                          stroke-width="1.8"
                        />
                        <path
                          d="M6.5 11.5a5.5 5.5 0 1 0 11 0M12 17v3m-3 0h6"
                          stroke="currentColor"
                          stroke-linecap="round"
                          stroke-linejoin="round"
                          stroke-width="1.8"
                        />
                      </svg>
                    </span>
                  </button>

                  <button class="generate-button" id="generateButton" type="submit">
                    <span class="atom-loader atom-loader-sm" aria-hidden="true">
                      <span class="atom-core"></span>
                      <span class="atom-orbit atom-orbit-a"><span class="atom-electron"></span></span>
                      <span class="atom-orbit atom-orbit-b"><span class="atom-electron"></span></span>
                      <span class="atom-orbit atom-orbit-c"><span class="atom-electron"></span></span>
                    </span>
                    <span class="button-label">Sinh câu hỏi</span>
                  </button>
                </div>
              </div>
            </div>
          </div>
        </form>

        <section class="landing-panel" id="landingPanel">
          <article class="landing-card landing-guide">
            <div class="landing-card-head">
              <p class="landing-kicker">Hướng dẫn nhanh</p>
              <p class="landing-card-note">Tạo bộ câu hỏi từ đoạn văn bản đầu vào.</p>
            </div>
            <ol class="landing-guide-list">
              <li>Nhập hoặc dán đoạn văn bản vào ô nhập.</li>
              <li>Chọn số lượng câu hỏi cần sinh.</li>
              <li>Nhấn <strong>Sinh câu hỏi</strong> để hệ thống xử lý.</li>
            </ol>
          </article>

          <article class="landing-card landing-samples">
            <div class="landing-card-head">
              <p class="landing-kicker">Ví dụ mẫu</p>
              <p class="landing-card-note">Chọn văn bản luật mẫu để chèn nhanh nội dung thử nghiệm.</p>
            </div>
            <div class="landing-sample-grid" id="sampleList"></div>
          </article>

          <article class="landing-card landing-system">
            <div class="landing-card-head">
              <p class="landing-kicker">Trạng thái model</p>
              <span class="landing-runtime-badge is-pending" id="landingRuntimeBadge">Đang kiểm tra</span>
            </div>
            <p class="landing-card-note" id="landingStatusText">Đang kết nối backend và đọc cấu hình hệ thống.</p>
            <div class="landing-system-list">
              <div class="landing-system-row">
                <span>Model đang dùng</span>
                <strong id="landingModelName">Đang tải...</strong>
              </div>
              <div class="landing-system-row">
                <span>Thiết bị xử lý</span>
                <strong id="landingDeviceName">Đang kiểm tra...</strong>
              </div>
              <div class="landing-system-row">
                <span>Số model khả dụng</span>
                <strong id="landingModelCount">0</strong>
              </div>
            </div>
          </article>
        </section>
      </main>
    </div>
  </body>
</html>