← Thư viện luyện tập
👤 Khách (Chưa đăng nhập) 🔑 Đăng nhập ✨ Đăng ký

DatChucVyNguNgonA

🎓 Bạn là học sinh và muốn luyện thêm? 📖 Luyện tập bài này 🔎 Tìm bài công khai khác
|
📱
Làm bài mượt mà hơn trên App Bài Trắc Nghiệm
Cài app để lưu kết quả, nhận điểm & thông báo bài tập mới
App Store (iOS) Google Play (Android)
0

Kết quả bài làm

⭐ Luyện cùng Trợ lý thông minh – VIP học sinh
🎯 Muốn luyện thêm nhiều đề khác?
📚 Khám phá khóa học & bài lẻ →
Trang chủ
Đã làm: 0/0 câu
Chưa làm
Đã làm
Nội dung bài đọc
Họ và tên thí sinh: ................................................................................ Số báo danh: ............................. PHẦN I. Câu hỏi trắc nghiệm nhiều phương án lựa chọn. Thí sinh trả lời từ câu 1 đến câu 34. Mỗi câu hỏi thí sinh chỉ chọn một phương án.
Câu hỏi trắc nghiệm
🔒 Muốn biết đúng/sai từng câu ngay khi chọn?
📖 Luyện tập thử ⭐ Nâng cấp VIP
Câu 1 Thẻ nào sau đây KHÔNG cùng loại với các thẻ khác?
Câu 2 Khi ứng xử trong không gian mạng, nguyên tắc nào sau đây mà người tham gia cần thực hiện?
Câu 3 Khi ứng xử trong không gian mạng, người tham gia KHÔNG nên thực hiện hành vi nào sau đây?
Câu 4 Bộ định tuyến là thiết bị nào sau đây?
Câu 5 Đặc tính nào sau đây là một trong các nhược điểm của giao thức TCP/IP?
Câu 6 Phương án nào dưới đây đúng khi nói về ưu điểm của giao tiếp trong không gian mạng?
Câu 7 Phần tử nằm trong phần tử nào sau đây? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q7" value="A"> A. <p> </label> <label class="option-item"> <input type="radio" name="q7" value="B"> B. <body> </label> <label class="option-item"> <input type="radio" name="q7" value="C"> C. <head> </label> <label class="option-item"> <input type="radio" name="q7" value="D"> D. <!DOCTYPE html> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-8" data-qnum="8" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 8</span> Chức năng nào sau đây của hệ điều hành hỗ trợ người dùng trao đổi dữ liệu? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q8" value="A"> A. Chức năng mạng. </label> <label class="option-item"> <input type="radio" name="q8" value="B"> B. Quản lí bộ nhớ. </label> <label class="option-item"> <input type="radio" name="q8" value="C"> C. Kiểm soát hiệu suất hệ thống. </label> <label class="option-item"> <input type="radio" name="q8" value="D"> D. Kiểm soát các hoạt động thực thi ứng dụng. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-9" data-qnum="9" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 9</span> Công nghệ nhận dạng khuôn mặt KHÔNG dùng trong công việc nào sau đây? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q9" value="A"> A. Tìm kiếm ảnh khuôn mặt trên Internet. </label> <label class="option-item"> <input type="radio" name="q9" value="B"> B. Kiểm soát ra vào toà nhà. </label> <label class="option-item"> <input type="radio" name="q9" value="C"> C. Xác minh danh tính tại sân bay. </label> <label class="option-item"> <input type="radio" name="q9" value="D"> D. Mở khoá điện thoại thông minh. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-10" data-qnum="10" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 10</span> Phương án nào dưới đây mô tả đúng về giao tiếp trong không gian mạng? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q10" value="A"> A. Là hình thức giao tiếp trực tiếp trong không gian có các thiết bị số. </label> <label class="option-item"> <input type="radio" name="q10" value="B"> B. Là hình thức giao tiếp sử dụng các phương tiện kĩ thuật số để liên lạc với nhau thông qua nền tảng số. </label> <label class="option-item"> <input type="radio" name="q10" value="C"> C. Là hình thức giao tiếp sử dụng công cụ công nghệ số. </label> <label class="option-item"> <input type="radio" name="q10" value="D"> D. Là hình thức giao tiếp trực tiếp giữa người với người trong môi trường mạng. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-11" data-qnum="11" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 11</span> Phương án nào dưới đây là nhược điểm của giao tiếp trong không gian mạng? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q11" value="A"> A. Không thể diễn ra mọi lúc, mọi nơi, chỉ cho phép số lượng nhỏ người dùng cùng tham gia một lúc. </label> <label class="option-item"> <input type="radio" name="q11" value="B"> B. Khó mở rộng khả năng tương tác, kết nối nhiều người có cùng sở thích, quan điểm hoặc nhu cầu. </label> <label class="option-item"> <input type="radio" name="q11" value="C"> C. Phương tiện giao tiếp không đa dạng, phụ thuộc khoảng cách địa lí của các thiết bị. </label> <label class="option-item"> <input type="radio" name="q11" value="D"> D. Trao đổi trong không gian mạng có độ trễ nhất định do về đường truyền và nền tảng công nghệ. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-12" data-qnum="12" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 12</span> Phương án nào sau đây đúng khi nói về tác động của Trợ lý thông minh đối với việc làm của con người? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q12" value="A"> A. Trợ lý thông minh tạo ra những việc làm mới và thay thế một số công việc hiện có. </label> <label class="option-item"> <input type="radio" name="q12" value="B"> B. Trợ lý thông minh thay thế hoàn toàn con người trong mọi lĩnh vực việc làm. </label> <label class="option-item"> <input type="radio" name="q12" value="C"> C. Trợ lý thông minh chỉ tác động đến các công việc đơn giản, lặp đi lặp lại. </label> <label class="option-item"> <input type="radio" name="q12" value="D"> D. Trợ lý thông minh không có tác động đáng kể đến việc làm của con người. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-13" data-qnum="13" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 13</span> Phần mềm nào dưới đây là trợ lí ảo của công ty Apple? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q13" value="A"> A. Alexa. </label> <label class="option-item"> <input type="radio" name="q13" value="B"> B. Bixby. </label> <label class="option-item"> <input type="radio" name="q13" value="C"> C. Google Assistant. </label> <label class="option-item"> <input type="radio" name="q13" value="D"> D. Siri. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-14" data-qnum="14" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 14</span> Tại thiết bị gửi, giao thức mạng nào sau đây cần thực hiện ngay trước khi truyền gói dữ liệu đi? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q14" value="A"> A. Xác định đường đi tối ưu cho gói dữ liệu. </label> <label class="option-item"> <input type="radio" name="q14" value="B"> B. Xác định địa chỉ IP, địa chỉ MAC. </label> <label class="option-item"> <input type="radio" name="q14" value="C"> C. Đóng gói dữ liệu. </label> <label class="option-item"> <input type="radio" name="q14" value="D"> D. Kiểm tra lỗi và đảm bảo độ tin cậy. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-15" data-qnum="15" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 15</span> Phương án nào dưới đây nêu đúng về khả năng nhận thức của Trợ lý thông minh? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q15" value="A"> A. Khả năng vận dụng logic và tri thức để đưa ra quyết định hoặc kết luận. </label> <label class="option-item"> <input type="radio" name="q15" value="B"> B. Cảm nhận và hiểu biết môi trường thông qua các cảm biến và thiết bị đầu vào. </label> <label class="option-item"> <input type="radio" name="q15" value="C"> C. Trích xuất thông tin từ dữ liệu để học và tích lũy tri thức. </label> <label class="option-item"> <input type="radio" name="q15" value="D"> D. Khả năng tìm ra cách giải quyết các tình huống phức tạp dựa trên thông tin và tri thức. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-16" data-qnum="16" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 16</span> Phát biểu nào sau đây KHÔNG đúng về địa chỉ IP? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q16" value="A"> A. Mỗi thiết bị tham gia mạng Internet đều phải gán địa chỉ. </label> <label class="option-item"> <input type="radio" name="q16" value="B"> B. Có thể tạo được 2^128 địa chỉ IPv6. </label> <label class="option-item"> <input type="radio" name="q16" value="C"> C. Trong mạng cục bộ, mỗi thiết bị được gán một địa chỉ IP duy nhất. </label> <label class="option-item"> <input type="radio" name="q16" value="D"> D. Có thể tạo được 2^8 địa chỉ IPv4. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-17" data-qnum="17" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 17</span> Lựa chọn nào sau đây cho phép mở cài đặt để thiết lập chia sẻ máy in dùng chung trong mạng nội bộ? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q17" value="A"> A. Windows Defender Firewall </label> <label class="option-item"> <input type="radio" name="q17" value="B"> B. Mail (Microsoft Outlook 2016) </label> <label class="option-item"> <input type="radio" name="q17" value="C"> C. Internet Options </label> <label class="option-item"> <input type="radio" name="q17" value="D"> D. Network and Sharing Center </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-18" data-qnum="18" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 18</span> Trong các thẻ dưới đây, sử dụng thẻ nào để định dạng cho tiêu đề của trang web có cỡ chữ nhỏ nhất? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q18" value="A"> A. <h6> </label> <label class="option-item"> <input type="radio" name="q18" value="B"> B. <h1> </label> <label class="option-item"> <input type="radio" name="q18" value="C"> C. <h0> </label> <label class="option-item"> <input type="radio" name="q18" value="D"> D. <h2> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-19" data-qnum="19" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 19</span> Thuộc tính của phần tử HTML KHÔNG có đặc điểm nào sau đây? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q19" value="A"> A. Có phần tử không có thuộc tính nào. </label> <label class="option-item"> <input type="radio" name="q19" value="B"> B. Mỗi phần tử bắt buộc phải có 1 thuộc tính. </label> <label class="option-item"> <input type="radio" name="q19" value="C"> C. Nằm trong thẻ mở. </label> <label class="option-item"> <input type="radio" name="q19" value="D"> D. Mỗi phần tử có thể có một hoặc nhiều thuộc tính. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-20" data-qnum="20" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 20</span> Phát biểu nào dưới đây là thách thức lớn nhất liên quan đến việc sử dụng Trợ lý thông minh? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q20" value="A"> A. Trợ lý thông minh không lưu trữ và sử dụng quyền riêng tư của cá nhân. </label> <label class="option-item"> <input type="radio" name="q20" value="B"> B. Khả năng Trợ lý thông minh không vượt qua trí thông minh của con người. </label> <label class="option-item"> <input type="radio" name="q20" value="C"> C. Khả năng Trợ lý thông minh không làm mất đi một số ngành nghề đang có. </label> <label class="option-item"> <input type="radio" name="q20" value="D"> D. Thiếu quy định và luật lệ về việc sử dụng Trợ lý thông minh trong xã hội ngày nay. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-21" data-qnum="21" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 21</span> Loại dây nào sau đây cho phép kết nối máy tính với Switch? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q21" value="A"> A. Dây cáp VGA </label> <label class="option-item"> <input type="radio" name="q21" value="B"> B. Dây cáp HDMI </label> <label class="option-item"> <input type="radio" name="q21" value="C"> C. Dây AV 3.5 </label> <label class="option-item"> <input type="radio" name="q21" value="D"> D. Dây cáp mạng đã gắn 2 đầu RJ45 </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-22" data-qnum="22" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 22</span> Trí tuệ nhân tạo còn nhiều hạn chế ở khả năng nào sau đây? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q22" value="A"> A. Cảm nhận cảm xúc. </label> <label class="option-item"> <input type="radio" name="q22" value="B"> B. Học và tích luỹ tri thức. </label> <label class="option-item"> <input type="radio" name="q22" value="C"> C. Giải quyết vấn đề. </label> <label class="option-item"> <input type="radio" name="q22" value="D"> D. Hiểu ngôn ngữ tự nhiên. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-23" data-qnum="23" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 23</span> Chuẩn kết nối nào dưới đây thường được sử dụng để kết nối các thiết bị âm nhạc với điện thoại di động? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q23" value="A"> A. NFC. </label> <label class="option-item"> <input type="radio" name="q23" value="B"> B. USB-C. </label> <label class="option-item"> <input type="radio" name="q23" value="C"> C. Bluetooth. </label> <label class="option-item"> <input type="radio" name="q23" value="D"> D. HDMI. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-24" data-qnum="24" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 24</span> Điều gì sau đây đảm bảo cho máy tính và thiết bị mạng có thể giao tiếp được với nhau đúng cách? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q24" value="A"> A. Giao tiếp mạng (Network communication). </label> <label class="option-item"> <input type="radio" name="q24" value="B"> B. Giao thức mạng (Network protocol). </label> <label class="option-item"> <input type="radio" name="q24" value="C"> C. Giao dịch mạng (Network transactions). </label> <label class="option-item"> <input type="radio" name="q24" value="D"> D. Giao thông mạng (Network traffic). </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-25" data-qnum="25" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 25</span> Đặc tính nào sau đây là một trong các ưu điểm của giao thức TCP/IP? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q25" value="A"> A. Hiệu suất trong môi trường yêu cầu thời gian thực. </label> <label class="option-item"> <input type="radio" name="q25" value="B"> B. Khả năng hỗ trợ đa phương tiện. </label> <label class="option-item"> <input type="radio" name="q25" value="C"> C. Khả năng kiểm soát luồng. </label> <label class="option-item"> <input type="radio" name="q25" value="D"> D. Khả năng đối phó với độ trễ. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-26" data-qnum="26" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 26</span> Phương án nào dưới đây KHÔNG phù hợp để minh hoạ cho hệ thống Trí tuệ nhân tạo có tri thức? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q26" value="A"> A. Chatbot có thể trò chuyện và đưa ra câu trả lời hợp lí cho các câu hỏi mở. </label> <label class="option-item"> <input type="radio" name="q26" value="B"> B. Hệ thống Trợ lý thông minh có thể chẩn đoán bệnh dựa trên triệu chứng và bệnh án. </label> <label class="option-item"> <input type="radio" name="q26" value="C"> C. Robot hút bụi tự động làm sạch sàn nhà theo lịch trình định sẵn. </label> <label class="option-item"> <input type="radio" name="q26" value="D"> D. Mô hình Trợ lý thông minh có thể trả lời câu hỏi dựa trên thông tin từ Wikipedia. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-27" data-qnum="27" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 27</span> Phát biểu nào dưới đây là phù hợp khi nói về khả năng của Trí tuệ nhân tạo hẹp? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q27" value="A"> A. Suy luận và giải quyết các vấn đề phức tạp như con người. </label> <label class="option-item"> <input type="radio" name="q27" value="B"> B. Giải quyết nhiệm vụ cụ thể theo những gì đã được học. </label> <label class="option-item"> <input type="radio" name="q27" value="C"> C. Hiểu ngôn ngữ tự nhiên và tạo ra văn bản giống con người. </label> <label class="option-item"> <input type="radio" name="q27" value="D"> D. Tự chuyển đổi để giải quyết các nhiệm vụ khác nhau. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-28" data-qnum="28" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 28</span> Sau khi bật tính năng chia sẻ máy in (Turn on file and printer sharing), lựa chọn nào sau đây cho phép người dùng thiết lập chia sẻ máy in để dùng chung? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q28" value="A"> A. Device Manager </label> <label class="option-item"> <input type="radio" name="q28" value="B"> B. Administrative Tools </label> <label class="option-item"> <input type="radio" name="q28" value="C"> C. Devices and Printers </label> <label class="option-item"> <input type="radio" name="q28" value="D"> D. File Explorer Options </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-29" data-qnum="29" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 29</span> Thiết bị Switch KHÔNG có khả năng nào sau đây? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q29" value="A"> A. Kết nối các thiết bị không dây vào mạng. </label> <label class="option-item"> <input type="radio" name="q29" value="B"> B. Kết nối các thiết bị với nhau theo mô hình mạng hình sao. </label> <label class="option-item"> <input type="radio" name="q29" value="C"> C. Kết nối các máy tính trong cùng mạng LAN. </label> <label class="option-item"> <input type="radio" name="q29" value="D"> D. Kết nối trực tiếp các máy tính với đường truyền của nhà cung cấp dịch vụ. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-30" data-qnum="30" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 30</span> Phương án nào dưới đây đúng khi nói về nhược điểm của giao tiếp trong không gian mạng? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q30" value="A"> A. Không bị giới hạn về thời gian và địa điểm. </label> <label class="option-item"> <input type="radio" name="q30" value="B"> B. Không thể xác định đối tượng giao tiếp một cách rõ ràng, chính xác. </label> <label class="option-item"> <input type="radio" name="q30" value="C"> C. Tiết kiệm chi phí và thời gian. </label> <label class="option-item"> <input type="radio" name="q30" value="D"> D. Mở rộng khả năng tương tác, tạo cơ hội kết nối nhiều người. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-31" data-qnum="31" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 31</span> Thiết bị nào sau đây giúp kết nối các thiết bị tạo thành mạng hình sao? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q31" value="A"> A. Modem. </label> <label class="option-item"> <input type="radio" name="q31" value="B"> B. Máy chủ. </label> <label class="option-item"> <input type="radio" name="q31" value="C"> C. Laptop. </label> <label class="option-item"> <input type="radio" name="q31" value="D"> D. Switch. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-32" data-qnum="32" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 32</span> Thiết bị nào sau đây KHÔNG sử dụng Trí tuệ nhân tạo để điều khiển tự động? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q32" value="A"> A. Máy bay không người lái. </label> <label class="option-item"> <input type="radio" name="q32" value="B"> B. Robot hút bụi thông minh. </label> <label class="option-item"> <input type="radio" name="q32" value="C"> C. Ấm điện siêu tốc tự động ngắt. </label> <label class="option-item"> <input type="radio" name="q32" value="D"> D. Xe ô tô không người lái. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-33" data-qnum="33" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 33</span> Cách làm nào sau đây là đúng khi muốn chia sẻ ổ đĩa cho người dùng khác trong cùng mạng để đọc, xem dữ liệu? </div> <div class="options-list" > <label class="option-item"> <input type="radio" name="q33" value="A"> A. Nháy phải chuột ổ đĩa cần chia sẻ/Properties/Advanced Sharing, chọn nhóm hoặc tên người dùng cần chia sẻ, chọn mức phân quyền Full control. </label> <label class="option-item"> <input type="radio" name="q33" value="B"> B. Nháy phải chuột ổ đĩa cần chia sẻ/Properties/Advanced Sharing, chọn nhóm hoặc tên người dùng cần chia sẻ, chọn mức phân quyền Read. </label> <label class="option-item"> <input type="radio" name="q33" value="C"> C. Nháy phải chuột ổ đĩa cần chia sẻ/Properties/Advanced Sharing, chọn nhóm hoặc tên người dùng cần chia sẻ, chọn cả ba mức phân quyền (Full control, Change, Read). </label> <label class="option-item"> <input type="radio" name="q33" value="D"> D. Nháy phải chuột ổ đĩa cần chia sẻ/Properties/Advanced Sharing, chọn nhóm hoặc tên người dùng cần chia sẻ, chọn mức phân quyền Change. </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-34" data-qnum="34" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 34</span> YouTube được trang bị hệ thống trí tuệ nhân tạo để gợi ý cho người dùng. Hãy cho biết hệ thống này làm nhiệm vụ gì dưới đây? </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) ,</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) ,</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) ,</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) ở mỗi câu, thí sinh chọn Đúng hoặc Sai.</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q34_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-35" data-qnum="35" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 35</span> Trí tuệ nhân tạo (Trợ lý thông minh) nâng cao chất lượng ngành y tế thông qua phân tích dữ liệu y tế lớn. Xét các phát biểu sau: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Phân tích hình ảnh y tế và đưa ra chẩn đoán bệnh. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Hỗ trợ giao tiếp và thấu hiểu cảm xúc bệnh nhân. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Đưa ra chẩn đoán y tế cuối cùng. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Hỗ trợ bác sĩ thực hiện các thủ thuật y tế phức tạp. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q35_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-36" data-qnum="36" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 36</span> Trí tuệ nhân tạo (Trợ lý thông minh) đang cải thiện ngành tài chính, ngân hàng bằng cách tăng cường an ninh giao dịch và dự đoán rủi ro. Xét các phát biểu sau: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Trợ lý thông minh thay thế hoàn toàn con người trong việc ra quyết định giao dịch. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Trợ lý thông minh không có khả năng phát hiện gian lận trong các giao dịch tài chính. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Trợ lý thông minh hỗ trợ tự động hoá các quy trình thủ công để nâng cao trải nghiệm khách hàng. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Trợ lý thông minh hỗ trợ phân tích và dự báo xu thế thị trường để tối ưu hoá hoạt động kinh doanh. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q36_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-37" data-qnum="37" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 37</span> Khi mở cửa sổ Properties của máy in không tích chọn được Share this printer: </div> <div class="options-list" data-multi="1"> <div style="font-size:12px;color:#7c3aed;font-weight:700;margin-bottom:6px">☑️ Câu này có thể có nhiều đáp án đúng</div> <label class="option-item"> <input type="checkbox" name="q37[]" value="A"> A. Máy tính cài đặt máy in này chưa bật chế độ cho phép chia sẻ máy in. -> </label> <label class="option-item"> <input type="checkbox" name="q37[]" value="B"> B. Máy tính cài đặt máy in này không có tính năng chia sẻ máy in dùng chung. -> </label> <label class="option-item"> <input type="checkbox" name="q37[]" value="C"> C. Cần vào Network and Sharing Center, chọn Turn on file and printer sharing để bật tính năng chia sẻ máy in. -> </label> <label class="option-item"> <input type="checkbox" name="q37[]" value="D"> D. Cần vào Network and Sharing Center, chọn Turn on network discovery để bật tính năng chia sẻ máy in. -> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-38" data-qnum="38" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 38</span> Tính nhân văn thể hiện trong các tình huống giao tiếp không gian mạng: </div> <div class="options-list" data-multi="1"> <div style="font-size:12px;color:#7c3aed;font-weight:700;margin-bottom:6px">☑️ Câu này có thể có nhiều đáp án đúng</div> <label class="option-item"> <input type="checkbox" name="q38[]" value="A"> A. Bạn A thảo luận trên mạng luôn đọc kỹ bài viết, hồi đáp lịch sự tôn trọng quan điểm khác. -> </label> <label class="option-item"> <input type="checkbox" name="q38[]" value="B"> B. Trào lưu "khoe mặt mộc đề cao vẻ đẹp tự nhiên" đã thu hút nhiều người tham gia trên mạng xã hội. -> </label> <label class="option-item"> <input type="checkbox" name="q38[]" value="C"> C. Khi tham gia học Online bạn A luôn nghiêm túc, ăn mặc lịch sự, tích cực xây dựng bài. -> </label> <label class="option-item"> <input type="checkbox" name="q38[]" value="D"> D. Bạn B phản hồi gay gắt để phủ nhận quan điểm người khác và bảo vệ ý kiến của mình tới cùng. -> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-39" data-qnum="39" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 39</span> Trí tuệ nhân tạo (Trợ lý thông minh) đang cách mạng hoá ngành giáo dục bằng cách cá nhân hoá quá trình học tập. Xét các phát biểu sau: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Trợ lý thông minh thay thế hoàn toàn vai trò của giáo viên trong lớp học. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Trợ lý thông minh có thể cá nhân hoá việc học tập cho mỗi học sinh. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Trợ lý thông minh tự động giải quyết mọi vấn đề trong giáo dục. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Trợ lý thông minh có thể tự động đánh giá kết quả học tập của học sinh. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q39_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-40" data-qnum="40" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 40</span> Yêu cầu tạo thư mục KẾ HOẠCH cho phép nhóm GIÁO VIÊN có thể sao chép các tệp vào đó: </div> <div class="options-list" data-multi="1"> <div style="font-size:12px;color:#7c3aed;font-weight:700;margin-bottom:6px">☑️ Câu này có thể có nhiều đáp án đúng</div> <label class="option-item"> <input type="checkbox" name="q40[]" value="A"> A. Phân quyền Full Control cho nhóm người dùng GIÁO VIÊN. -> </label> <label class="option-item"> <input type="checkbox" name="q40[]" value="B"> B. Phân quyền Read cho nhóm người dùng GIÁO VIÊN. -> </label> <label class="option-item"> <input type="checkbox" name="q40[]" value="C"> C. Phân quyền Change cho nhóm người dùng GIÁO VIÊN. -> </label> <label class="option-item"> <input type="checkbox" name="q40[]" value="D"> D. Phân quyền Change cho nhóm người dùng Everyone. -> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-41" data-qnum="41" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 41</span> Một nhân viên cần gửi gấp tệp tài liệu trên laptop về cơ quan ở nơi hẻo lánh không có wifi/cáp mạng nhưng có smartphone 4G: </div> <div class="options-list" data-multi="1"> <div style="font-size:12px;color:#7c3aed;font-weight:700;margin-bottom:6px">☑️ Câu này có thể có nhiều đáp án đúng</div> <label class="option-item"> <input type="checkbox" name="q41[]" value="A"> A. Mở laptop, sử dụng chức năng mạng của hệ điều hành để chia sẻ tệp tin. -> </label> <label class="option-item"> <input type="checkbox" name="q41[]" value="B"> B. Mở laptop, chọn Settings -> Network & Internet -> Mobile hotspot để tạo điểm phát sóng. -> </label> <label class="option-item"> <input type="checkbox" name="q41[]" value="C"> C. Trên điện thoại thông minh bật tính năng chia sẻ Mobile hotspot để tạo điểm phát sóng cho laptop. -> </label> <label class="option-item"> <input type="checkbox" name="q41[]" value="D"> D. Đi tìm quán cafe gần nhất để có mạng wifi. -> </label> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-42" data-qnum="42" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 42</span> Sơ đồ mạng máy tính trường THPT Đầm Dơi gồm Modem, Switch, Access point và các máy tính phòng thực hành. Nhận định về hệ thống mạng của trường: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Phải thay Switch bằng một Modem khác để vừa kết nối máy tính qua cáp vừa kết nối thiết bị di động. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Có thể bổ sung thêm máy tính vào phòng thực hành do vẫn còn cổng trên Switch chưa sử dụng. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Sử dụng thêm thiết bị Access point để mở rộng mạng không dây cho các thiết bị truy cập. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Các máy tính để bàn không thể kết nối vào Modem và Access point vì không có cổng cắm cáp. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q42_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-43" data-qnum="43" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 43</span> Hãng Google cung cấp nhiều dịch vụ tiện ích như thư điện tử, máy tìm kiếm, bản đồ số, không gian lưu trữ đám mây và ứng dụng Trợ lý thông minh trong y tế (dự án ARDA tầm soát bệnh võng mạc tiểu đường). Xét các phát biểu sau: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Ta có thể lưu trữ dữ liệu trên không gian lưu trữ đám mây không giới hạn. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Gmail là một dịch vụ thư điện tử miễn phí do Google phát triển. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Google có thể hỗ trợ bác sĩ tầm soát và phát hiện bệnh võng mạc tiểu đường thông qua camera điện thoại. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Máy tìm kiếm Google có thể chẩn đoán được tất cả các bệnh tật của con người. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q43_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-44" data-qnum="44" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 44</span> Cho tệp HTML có cấu trúc cơ bản bao gồm <html>, <head>, <title>, <body>, <h1>, <p>. Nhận định về tệp HTML: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Tiêu đề trang web hiển thị trên trình duyệt là Hello. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Phần tử <body> chứa một phần tử con. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Chỉ có một phần tử có thuộc tính. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Phần tử <html> chứa phần tử <head> và <body>. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q44_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-45" data-qnum="45" data-qtype="True_False"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 45</span> Năm 1997, máy tính Deep Blue của IBM đánh bại đại kiện tướng cờ vua Garry Kasparov. Xét các phát biểu sau: </div> <div class="true-false-container mt-2"> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">a) Cách thức đánh cờ của con người và máy tính là giống nhau. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_a" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_a" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">b) Trận đấu là cuộc đụng độ giữa một bên là trực giác kì diệu của con người với bên kia là tốc độ tính toán siêu phàm của máy tính. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_b" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_b" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">c) Việc máy tính đánh cờ vua chứng minh khả năng máy móc thực hiện được nhiệm vụ đòi hỏi trí thông minh cao. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_c" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_c" value="S" class="me-1"> Sai </label> </div> </div> <div class="true-false-row d-flex align-items-center py-2 border-bottom" style="font-size:0.95rem;"> <div class="flex-grow-1">d) Máy tính Deep Blue của IBM chỉ có thể hoạt động được vào ban ngày. -> (Đúng)</div> <div class="d-flex gap-3 ms-3"> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_d" value="Đ" class="me-1"> Đúng </label> <label class="d-flex align-items-center" style="cursor:pointer;"> <input type="radio" name="q45_d" value="S" class="me-1"> Sai </label> </div> </div> </div> <div class="explanation-box"></div> </div> <div class="question-card qcard-jump-target" id="q-46" data-qnum="46" data-qtype="Multiple Choice"> <div class="q-title"> <span class="badge bg-primary me-2">Câu 46</span> Yêu cầu tạo thư mục lưu trữ "Lịch công tác tuần" và cho phép nhóm GIÁO VIÊN có thể truy cập để xem: </div> <div class="options-list" data-multi="1"> <div style="font-size:12px;color:#7c3aed;font-weight:700;margin-bottom:6px">☑️ Câu này có thể có nhiều đáp án đúng</div> <label class="option-item"> <input type="checkbox" name="q46[]" value="A"> A. Phân quyền Read cho nhóm người dùng GIÁO VIÊN. -> </label> <label class="option-item"> <input type="checkbox" name="q46[]" value="B"> B. Phân quyền Change cho nhóm người dùng GIÁO VIÊN. -> </label> <label class="option-item"> <input type="checkbox" name="q46[]" value="C"> C. Phân quyền Read cho nhóm người dùng Everyone. -> </label> <label class="option-item"> <input type="checkbox" name="q46[]" value="D"> D. Phân quyền Full Control cho nhóm người dùng Everyone. -> </label> </div> <div class="explanation-box"></div> </div> </form> </div> </div> </div> <div class="footer-bar no-print" style="display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px"> <div id="guestInfoToggle" style="text-align:center;margin-bottom:2px"> <a href="javascript:void(0)" onclick="toggleGuestInfoBox()" style="font-size:12px;color:#1a56db;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:5px;background:#f0f4ff;padding:4px 12px;border-radius:20px;border:1px solid #c7d7f8"> ✍️ Điền tên & SĐT để lưu điểm (tùy chọn) <i class="fas fa-chevron-up" id="guestToggleIcon" style="font-size:10px;transition:transform 0.2s"></i> </a> </div> <div id="guestInfoBox" style="display:none;width:100%;max-width:420px;background:#f8faff;border:1.5px solid #dbeafe;border-radius:10px;padding:10px 14px;margin-bottom:4px"> <div style="font-size:11.5px;color:#1e40af;font-weight:600;margin-bottom:6px">✍️ Nhập tên và SĐT để lưu điểm bài làm (không bắt buộc):</div> <div style="display:flex;gap:6px"> <input type="text" id="guestNameInput" placeholder="Họ và tên" style="flex:1.3;padding:7px 10px;border:1.5px solid #dbeafe;border-radius:8px;font-size:12.5px"> <input type="tel" id="guestPhoneInput" placeholder="SĐT (không bắt buộc)" style="flex:1;padding:7px 10px;border:1.5px solid #dbeafe;border-radius:8px;font-size:12.5px"> <datalist id="guestClassList"></datalist><input type="text" list="guestClassList" id="guestClassInput" placeholder="Lớp (VD: 10A1)" style="flex:0.8;padding:7px 10px;border:1.5px solid #dbeafe;border-radius:8px;font-size:12.5px"> </div> <div style="font-size:11px;color:#065f46;background:#ecfdf5;border-radius:8px;padding:6px 9px;margin-top:6px;line-height:1.45"> 👩‍🏫 Nhập <b>mã lớp 6 ký tự</b> của giáo viên kèm số điện thoại để vào lớp luôn (nhập tên lớp hoặc mã lớp cũ thì giáo viên sẽ duyệt đề nghị của bạn). </div> <div style="font-size:10.5px;color:#9ca3af;margin-top:5px"> Bỏ trống để <b>làm thử tự do, không lưu điểm</b> — hoặc <a href="/login" style="color:#1a56db;font-weight:600">đăng nhập</a> để lưu vào tài khoản. </div> </div> <script> function toggleGuestInfoBox() { const box = document.getElementById('guestInfoBox'); const icon = document.getElementById('guestToggleIcon'); if (box.style.display === 'none' || !box.style.display) { box.style.display = 'block'; if (icon) icon.style.transform = 'rotate(180deg)'; const nameInp = document.getElementById('guestNameInput'); if (nameInp) nameInp.focus(); } else { box.style.display = 'none'; if (icon) icon.style.transform = 'rotate(0deg)'; } } </script> <div style="display:flex;align-items:center;justify-content:center"> <button class="submit-btn" onclick="submitQuiz()"> <i class="fas fa-paper-plane me-2"></i> NỘP BÀI </button> </div> </div> <script> async function reportContentIssue(contentType, contentId) { if (!contentId || contentId === 'undefined' || contentId === 'null') { alert('Không xác định được bài để báo lỗi.'); return; } if (typeof Swal === 'undefined') { const desc = prompt("🚩 Báo lỗi bài này:\nVui lòng mô tả chi tiết lỗi gặp phải (vd: Sai đáp án câu X, lỗi hình ảnh...):"); if (desc === null) return; try { const res = await fetch('/api/report-content', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({content_type: contentType, content_id: contentId, issue_type: 'khac', description: desc}) }); const data = await res.json(); alert(data.ok ? (data.message || 'Cảm ơn bạn đã báo lỗi!') : (data.error || 'Không gửi được báo lỗi.')); } catch (e) { alert('Lỗi kết nối, vui lòng thử lại.'); } return; } const { value: formValues } = await Swal.fire({ title: '🚩 Báo lỗi bài này', html: '<select id="report-issue-type" class="swal2-select" style="width:90%;padding:8px;border-radius:8px;border:1px solid #d1d5db;margin-bottom:10px">' + '<option value="sai_dap_an">❌ Sai đáp án</option>' + '<option value="loi_thoi_sai">⚠️ Nội dung lỗi thời/sai</option>' + '<option value="khong_tai_duoc">🖼️ Không tải được ảnh/audio</option>' + '<option value="sai_dinh_dang">📄 Sai định dạng (câu bị gộp, mất đáp án, hiển thị lỗi)</option>' + '<option value="tieu_de_lech">🏷️ Tiêu đề không khớp nội dung</option>' + '<option value="khac">❓ Khác</option>' + '</select>' + '<textarea id="report-description" class="swal2-textarea" placeholder="Mô tả thêm (không bắt buộc)" style="width:90%"></textarea>', showCancelButton: true, confirmButtonText: 'Gửi báo lỗi', cancelButtonText: 'Huỷ', confirmButtonColor: '#dc2626', preConfirm: () => { return { issue_type: document.getElementById('report-issue-type').value, description: document.getElementById('report-description').value }; } }); if (!formValues) return; try { const res = await fetch('/api/report-content', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({content_type: contentType, content_id: contentId, issue_type: formValues.issue_type, description: formValues.description}) }); const data = await res.json(); if (data.ok) { Swal.fire({icon: 'success', title: 'Cảm ơn bạn!', text: data.message, timer: 3000, showConfirmButton: false}); } else { Swal.fire({icon: 'error', title: 'Lỗi', text: data.error || 'Không gửi được báo lỗi.'}); } } catch (e) { Swal.fire({icon: 'error', title: 'Lỗi kết nối', text: 'Vui lòng thử lại.'}); } } async function reactToExercise(exerciseId, reactionType) { try { const res = await fetch(`/api/exercise/${exerciseId}/react`, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ reaction: reactionType }) }); const data = await res.json(); if (data.ok) { document.getElementById('like-count').textContent = data.likes_count; document.getElementById('dislike-count').textContent = data.dislikes_count; const likeBtn = document.getElementById('btn-like-ex'); const dislikeBtn = document.getElementById('btn-dislike-ex'); if (data.user_reaction === 'like') { likeBtn.style.background = '#dcfce7'; likeBtn.style.color = '#15803d'; } else { likeBtn.style.background = 'none'; likeBtn.style.color = '#475569'; } if (data.user_reaction === 'dislike') { dislikeBtn.style.background = '#fee2e2'; dislikeBtn.style.color = '#b91c1c'; } else { dislikeBtn.style.background = 'none'; dislikeBtn.style.color = '#475569'; } } } catch (e) { console.error('Lỗi tương tác bài tập:', e); } } function showExerciseQR() { const modal = document.getElementById('exercise-qr-modal'); const qrImg = document.getElementById('exercise-qr-img'); const urlText = document.getElementById('exercise-qr-url-text'); const currentUrl = window.location.href; if (qrImg) { qrImg.src = 'https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=' + encodeURIComponent(currentUrl); } if (urlText) { urlText.textContent = currentUrl; } if (modal) { modal.style.display = 'flex'; } } function copyCurrentExerciseUrl() { const currentUrl = window.location.href; if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(currentUrl).then(() => { alert('Đã sao chép đường dẫn bài tập vào bộ nhớ tạm!'); }).catch(() => { fallbackCopyText(currentUrl); }); } else { fallbackCopyText(currentUrl); } } function fallbackCopyText(text) { const dummy = document.createElement('input'); document.body.appendChild(dummy); dummy.value = text; dummy.select(); document.execCommand('copy'); document.body.removeChild(dummy); alert('Đã sao chép đường dẫn bài tập!'); } function normalize(str) { return str ? str.toString().trim().toLowerCase().replace(/\.$/, '') : ''; } function normalizeQtype(t) { const tStr = String(t || '').trim().toLowerCase().replace(/_/g, ' ').replace(/-/g, ' ').replace(/\//g, ' '); if (tStr.includes('true false') || tStr.includes('đúng sai')) { return 'True_False'; } if (tStr.includes('matching') || tStr.includes('ghép') || tStr.includes('nối')) { return 'Matching'; } if (tStr.includes('short answer') || tStr.includes('fill in the blank') || tStr.includes('điền khuyết') || tStr.includes('trả lời ngắn')) { return 'Short_Answer'; } if (tStr.includes('essay') || tStr.includes('tự luận') || tStr.includes('tu luan')) { return 'Essay'; } return 'Multiple Choice'; } // ===== QUESTION NAVIGATOR LOGIC ===== let qnavSubmitted = false; function getAllCards() { return Array.from(document.querySelectorAll('.question-card')); } function isCardAnswered(card) { const qtype = normalizeQtype(card.dataset.qtype || 'Multiple Choice'); const radios = card.querySelectorAll('input[type="radio"]'); const texts = card.querySelectorAll('input[type="text"]'); const selects = card.querySelectorAll('select.select-matching-item'); if (qtype === 'True_False') { const groups = {}; radios.forEach(r => { groups[r.name] = groups[r.name] || []; groups[r.name].push(r); }); const totalGroups = Object.keys(groups).length; if (totalGroups === 0) return false; let answeredGroups = 0; for (const name in groups) { if (groups[name].some(r => r.checked)) { answeredGroups++; } } return answeredGroups === totalGroups; } if (qtype === 'Matching' || selects.length > 0) { if (selects.length === 0) return false; return Array.from(selects).every(s => s.value && s.value.trim() !== ''); } if (radios.length > 0) { return Array.from(radios).some(r => r.checked); } const checkboxes = card.querySelectorAll('input[type="checkbox"]'); if (checkboxes.length > 0) { return Array.from(checkboxes).some(c => c.checked); } if (texts.length > 0) { return Array.from(texts).some(t => t.value && t.value.trim() !== ''); } return false; } function toggleQnavGrid() { const wrap = document.getElementById('qnav-wrap'); const btn = document.getElementById('qnav-toggle-btn'); const hidden = wrap.classList.toggle('qnav-hidden'); btn.textContent = hidden ? 'Xem danh sách câu hỏi' : 'Ẩn danh sách câu hỏi'; try { localStorage.setItem('qnavHidden', hidden ? '1' : '0'); } catch (e) {} } function buildQnavGrid() { const cards = getAllCards(); const grid = document.getElementById('qnav-grid'); if (!grid) return; const wrap = document.getElementById('qnav-wrap'); if (wrap) { // Mac dinh: bai > 20 cau thi an san; nho lua chon cua nguoi dung (localStorage) let pref = null; try { pref = localStorage.getItem('qnavHidden'); } catch (e) {} const hide = pref === null ? cards.length > 20 : pref === '1'; wrap.classList.toggle('qnav-hidden', hide); const tb = document.getElementById('qnav-toggle-btn'); if (tb) tb.textContent = hide ? 'Xem danh sách câu hỏi' : 'Ẩn danh sách câu hỏi'; } grid.innerHTML = ''; cards.forEach((card, idx) => { const qnum = card.dataset.qnum || (idx + 1); const btn = document.createElement('div'); btn.className = 'qnav-item'; btn.id = 'qnav-btn-' + qnum; btn.textContent = qnum; btn.title = 'Câu ' + qnum; btn.onclick = function() { const target = document.getElementById('q-' + qnum) || cards[idx]; if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'center' }); target.classList.remove('qcard-unanswered-flash'); void target.offsetWidth; if (!isCardAnswered(target) && !qnavSubmitted) { target.classList.add('qcard-unanswered-flash'); } } }; grid.appendChild(btn); }); const totalEl = document.getElementById('qnav-total-count'); if (totalEl) totalEl.textContent = cards.length; updateQnavProgress(); } function updateQnavProgress() { if (qnavSubmitted) return; const cards = getAllCards(); let doneCount = 0; cards.forEach(card => { const qnum = card.dataset.qnum; const btn = document.getElementById('qnav-btn-' + qnum); const answered = isCardAnswered(card); if (answered) doneCount++; if (btn) { btn.classList.toggle('qnav-answered', answered); } }); const doneEl = document.getElementById('qnav-done-count'); if (doneEl) doneEl.textContent = doneCount; const total = cards.length; const pct = total > 0 ? Math.round((doneCount / total) * 100) : 0; const fill = document.getElementById('qnav-progress-fill'); if (fill) fill.style.width = pct + '%'; } function getUnansweredQuestionNumbers() { const cards = getAllCards(); const unanswered = []; cards.forEach(card => { if (!isCardAnswered(card)) { unanswered.push(card.dataset.qnum || '?'); } }); return unanswered; } function markQnavResults() { qnavSubmitted = true; const cards = getAllCards(); cards.forEach(card => { const qnum = card.dataset.qnum; const btn = document.getElementById('qnav-btn-' + qnum); if (!btn) return; btn.classList.remove('qnav-answered'); if (card.classList.contains('qcard-result-correct')) { btn.classList.add('qnav-correct'); } else if (card.classList.contains('qcard-result-essay')) { btn.classList.add('qnav-essay'); } else { btn.classList.add('qnav-wrong'); } btn.onclick = (function(targetCard) { return function() { targetCard.scrollIntoView({ behavior: 'smooth', block: 'center' }); }; })(card); }); const legB = document.getElementById('qnav-legend-before'); const legA = document.getElementById('qnav-legend-after'); if (legB) legB.style.display = 'none'; if (legA) legA.style.display = 'flex'; const fill = document.getElementById('qnav-progress-fill'); if (fill) fill.style.width = '100%'; const doneEl = document.getElementById('qnav-done-count'); const totalEl = document.getElementById('qnav-total-count'); if (doneEl && totalEl) doneEl.textContent = totalEl.textContent; } (function(){ try { var id=document.body.dataset.exerciseId; if(!id) return; fetch('/api/exercise/'+id+'/guest_classes').then(function(r){return r.json()}).then(function(l){ var d=document.getElementById('guestClassList'); if(d) d.innerHTML=l.map(function(c){return '<option value="'+String(c).replace(/"/g,'')+'">'}).join(''); }).catch(function(){}); } catch(e){} })(); const storageKey = `exercise_draft_${document.body.dataset.exerciseId}`; function saveDraft() { if (qnavSubmitted) return; const answers = {}; const cards = getAllCards(); cards.forEach(card => { const qnum = card.dataset.qnum; const qtype = normalizeQtype(card.dataset.qtype || 'Multiple Choice'); if (qtype === 'True_False') { const tfAnswers = {}; const radios = card.querySelectorAll('input[type="radio"]'); radios.forEach(r => { if (r.checked) { const parts = r.name.split('_'); if (parts.length > 1) { tfAnswers[parts[1]] = r.value; } } }); answers[`q_${qnum}_tf`] = tfAnswers; } else { const radios = card.querySelectorAll('input[type="radio"]'); radios.forEach(r => { if (r.checked) answers[`q_${qnum}`] = r.value; }); const checkboxes = card.querySelectorAll('input[type="checkbox"]'); if (checkboxes.length > 0) { const pickedMulti = []; checkboxes.forEach(c => { if (c.checked) pickedMulti.push(c.value); }); answers[`q_${qnum}_multi`] = pickedMulti; } const texts = card.querySelectorAll('input[type="text"]'); texts.forEach(t => { if (t.value && t.value.trim() !== '') answers[`q_${qnum}_text`] = t.value; }); } }); localStorage.setItem(storageKey, JSON.stringify(answers)); } function restoreDraft() { const raw = localStorage.getItem(storageKey); if (!raw) return; try { const answers = JSON.parse(raw); const cards = getAllCards(); cards.forEach(card => { const qnum = card.dataset.qnum; const qtype = normalizeQtype(card.dataset.qtype || 'Multiple Choice'); if (qtype === 'True_False') { const tfAnswers = answers[`q_${qnum}_tf`] || {}; for (const subKey in tfAnswers) { const val = tfAnswers[subKey]; const radio = card.querySelector(`input[type="radio"][name="q${qnum}_${subKey}"][value="${val}"]`); if (radio) radio.checked = true; } } else { const val = answers[`q_${qnum}`]; if (val !== undefined) { const radio = card.querySelector(`input[type="radio"][value="${val}"]`); if (radio) radio.checked = true; } const multiVal = answers[`q_${qnum}_multi`]; if (multiVal !== undefined && Array.isArray(multiVal)) { multiVal.forEach(v => { const cb = card.querySelector(`input[type="checkbox"][value="${v}"]`); if (cb) cb.checked = true; }); } const textVal = answers[`q_${qnum}_text`]; if (textVal !== undefined) { const textInput = card.querySelector('input[type="text"]'); if (textInput) textInput.value = textVal; } } }); updateQnavProgress(); } catch(e) { console.error("Error restoring draft", e); } } document.addEventListener('DOMContentLoaded', function() { restoreDraft(); buildQnavGrid(); document.body.addEventListener('change', function(e) { if (e.target.matches('.question-card input[type="radio"], .question-card input[type="checkbox"], .question-card select.select-matching-item')) { updateQnavProgress(); saveDraft(); } }); document.body.addEventListener('input', function(e) { if (e.target.matches('.question-card input[type="text"]')) { updateQnavProgress(); saveDraft(); } }); }); async function submitQuiz() { // ===== KIEM TRA CAU CHUA LAM ===== const unanswered = getUnansweredQuestionNumbers(); const isLoggedInEarly = document.body.dataset.isLoggedIn === "true"; let guestName = '', guestPhone = '', guestClass = ''; if (!isLoggedInEarly) { const nameEl = document.getElementById('guestNameInput'); const phoneEl = document.getElementById('guestPhoneInput'); guestName = nameEl ? nameEl.value.trim() : ''; guestPhone = phoneEl ? phoneEl.value.trim() : ''; const clsEl = document.getElementById('guestClassInput'); guestClass = clsEl ? clsEl.value.trim() : ''; // Chi bat buoc dien DU CA 2 hoac KHONG dien gi ca (lam tu do khong luu). // Dien 1 nua thi nhac dien du, tranh luu thieu du lieu. if ((guestName && !guestPhone && !guestClass) || (!guestName && (guestPhone || guestClass))) { alert('Vui lòng nhập Họ tên và Lớp để lưu điểm, hoặc để trống cả hai ô để làm thử không lưu.'); if (nameEl) nameEl.scrollIntoView({ behavior: 'smooth', block: 'center' }); return; } } // ===== THU THAP CAU TRA LOI CUA HOC SINH (khong tu cham diem o day nua - server se cham) ===== const cards = document.querySelectorAll('.question-card'); const studentAnswers = {}; cards.forEach(card => { const qnum = card.dataset.qnum; const qtype = normalizeQtype(card.dataset.qtype || 'Multiple Choice'); const radioInputs = card.querySelectorAll('input[type="radio"]'); const textInputs = card.querySelectorAll('input[type="text"]'); const selectInputs = card.querySelectorAll('select.select-matching-item'); if (qtype === 'True_False') { const tfAnswers = {}; radioInputs.forEach(input => { input.disabled = true; if (input.checked) { const parts = input.name.split('_'); if (parts.length > 1) { tfAnswers[parts[1]] = input.value; } } }); studentAnswers[qnum] = tfAnswers; } else if (qtype === 'Matching') { const matchAnswers = {}; selectInputs.forEach(sel => { sel.disabled = true; const parts = sel.name.split('_'); if (parts.length > 1) { matchAnswers[parts[1]] = sel.value; } }); studentAnswers[qnum] = matchAnswers; } else if (qtype === 'Essay' || qtype === 'Short_Answer' || qtype === 'Fill in the Blank') { let val = ''; const textInputs = card.querySelectorAll('textarea, input[type="text"]'); textInputs.forEach(input => { input.disabled = true; if (input.value) val = input.value; }); studentAnswers[qnum] = val; } else { var checkboxInputs = card.querySelectorAll('input[type="checkbox"]'); if (checkboxInputs.length > 0) { // Cau nhieu dap an dung - thu thap TAT CA cac o da tick, noi bang ", " khop // dinh dang correctAnswer phia server (VD "A, C") var pickedMulti = []; checkboxInputs.forEach(function(input) { input.disabled = true; if (input.checked) pickedMulti.push(input.value); }); studentAnswers[qnum] = pickedMulti.join(', '); } else { let picked = ''; radioInputs.forEach(input => { input.disabled = true; if (input.checked) picked = input.value; }); studentAnswers[qnum] = picked; } } }); const submitBtn = document.querySelector('.submit-btn'); if (submitBtn) { submitBtn.disabled = true; submitBtn.innerText = 'Đang chấm bài...'; } const exerciseId = document.body.dataset.exerciseId; const isLoggedIn = document.body.dataset.isLoggedIn === "true"; let gradeData; try { const resp = await fetch(`/exercise_result/${exerciseId}`, { method: "POST", headers: {"Content-Type": "application/json"}, body: JSON.stringify({ answers: studentAnswers, guest_name: guestName, guest_phone: guestPhone, guest_class: guestClass }) }); gradeData = await resp.json(); } catch (err) { alert("Lỗi kết nối server, không chấm được bài. Vui lòng thử lại."); if (submitBtn) { submitBtn.disabled = false; submitBtn.innerText = 'NỘP BÀI'; } return; } if (!gradeData || gradeData.error) { alert("Lỗi chấm bài: " + (gradeData && gradeData.error ? gradeData.error : "không rõ")); if (submitBtn) { submitBtn.disabled = false; submitBtn.innerText = 'NỘP BÀI'; } return; } try { if (window._liveDone) window._liveDone(); } catch (e) {} const score = gradeData.score || 0; const total = gradeData.total || 0; const perQuestion = gradeData.results || {}; // ===== HIEN THI DUNG/SAI TUNG CAU THEO KET QUA SERVER TRA VE ===== cards.forEach(card => { const qnum = card.dataset.qnum; const qtype = normalizeQtype(card.dataset.qtype || 'Multiple Choice'); const info = perQuestion[qnum]; const explainBox = card.querySelector('.explanation-box'); if (!info) return; const radioInputs = card.querySelectorAll('input[type="radio"]'); const textInputs = card.querySelectorAll('input[type="text"]'); if (qtype === 'True_False') { const subResults = info.sub_results || {}; radioInputs.forEach(input => { const parent = input.closest('label') || input.parentElement; const parts = input.name.split('_'); if (parts.length > 1) { const subKey = parts[1]; const res = subResults[subKey] || {}; const isChoiceCorrect = res.ok; if (input.checked) { parent.style.color = isChoiceCorrect ? '#198754' : '#dc3545'; parent.style.fontWeight = 'bold'; parent.style.textDecoration = isChoiceCorrect ? 'none' : 'line-through'; } else if (input.value === res.correct) { parent.style.color = '#198754'; parent.style.fontWeight = 'bold'; } } }); if (explainBox) { let explainHtml = `<h6 class="fw-bold text-success mb-0"><i class="fas fa-check-circle"></i> Đáp án đúng: `; const subCorrects = []; for (const subKey in subResults) { subCorrects.push(`${subKey}-${subResults[subKey].correct}`); } explainHtml += subCorrects.join(', ') + `</h6>`; if (info.explanation) { explainHtml += `<div style="margin-top:6px;font-size:13px;color:#374151">${info.explanation}</div>`; } explainBox.innerHTML = explainHtml; explainBox.classList.add('explanation-show'); } } else if (qtype === 'Essay') { const essayTextareas = card.querySelectorAll('textarea, input[type="text"]'); essayTextareas.forEach(input => { input.disabled = true; input.style.border = "1.5px solid #93c5fd"; input.style.backgroundColor = "#f0f9ff"; }); if (explainBox) { if (info.sample_answer || info.explanation) { explainBox.innerHTML = `<h6 class="fw-bold text-primary mb-0"><i class="fas fa-lightbulb"></i> Gợi ý đáp án / Bài mẫu:</h6>` + `<div style="margin-top:6px;font-size:13px;color:#1e3a8a">${info.sample_answer || info.explanation}</div>`; } else { explainBox.innerHTML = `<div style="font-size:13px;color:#1e40af;font-weight:600"><i class="fas fa-info-circle"></i> Bài làm tự luận đã được ghi nhận.</div>`; } explainBox.classList.add('explanation-show'); } } else if (qtype === 'Short_Answer' || qtype === 'Fill in the Blank') { textInputs.forEach(input => { input.disabled = true; if (info.correct) { input.style.border = "2px solid #198754"; input.style.backgroundColor = "#e8f5e9"; input.style.color = "#198754"; } else { input.style.border = "2px solid #dc3545"; input.style.backgroundColor = "#fdf2f2"; input.style.color = "#dc3545"; } }); if (explainBox) { explainBox.innerHTML = `<h6 class="fw-bold text-success mb-0"><i class="fas fa-check-circle"></i> Đáp án đúng: ${info.correctAnswer || ''}</h6>` + (info.explanation ? `<div style="margin-top:6px;font-size:13px;color:#374151">${info.explanation}</div>` : ''); explainBox.classList.add('explanation-show'); } } else { function extractChoiceLetter(v) { if (!v) return ''; const s = String(v).trim(); const m = s.match(/^([A-Da-d])[\.\)\s]/); if (m) return m[1].toUpperCase(); if (s.length === 1 && 'ABCD'.includes(s.toUpperCase())) return s.toUpperCase(); return ''; } const correctVal = normalize(info.correctAnswer); const correctLetter = extractChoiceLetter(info.correctAnswer); radioInputs.forEach(input => { const parent = input.closest('.option-item'); const val = normalize(input.value); const inputLetter = extractChoiceLetter(input.value); const isMatch = (val === correctVal) || (correctLetter && inputLetter && correctLetter === inputLetter); if (input.checked) { parent.classList.add(info.correct ? 'correct-style' : 'wrong-style'); } else if (isMatch) { parent.classList.add('correct-style'); } }); if (explainBox) { if (window.StudentAiTutor && !info.correct) { window.StudentAiTutor.enhanceCardExplanation(card, !!info.correct, info.correctAnswer || '', info.explanation || ''); } else { explainBox.innerHTML = `<h6 class="fw-bold text-success mb-0"><i class="fas fa-check-circle"></i> Đáp án đúng: ${info.correctAnswer || ''}</h6>` + (info.explanation ? `<div style="margin-top:6px;font-size:13px;color:#374151">${info.explanation}</div>` : ''); explainBox.classList.add('explanation-show'); } } } card.classList.add(qtype === 'Essay' ? 'qcard-result-essay' : (info.correct ? 'qcard-result-correct' : 'qcard-result-wrong')); }); // ===== CAP NHAT QUESTION NAVIGATOR THEO KET QUA ===== markQnavResults(); try { localStorage.removeItem(storageKey); } catch (e) {} // ===== HIỂN THỊ RESULT ===== document.querySelector('.footer-bar').style.display = 'none'; const resultBox = document.getElementById('result-summary'); resultBox.style.display = 'block'; document.getElementById('final-score').innerText = `${score}/${total}`; const percent = total > 0 ? Math.round((score / total) * 100) : 0; let msg = ""; let colorClass = "text-muted"; if(percent == 100) { msg = "Hoàn hảo!"; colorClass = "text-success"; } else if(percent >= 80) { msg = "Rất tốt!"; colorClass = "text-primary"; } else if(percent >= 50) { msg = "Tạm ổn."; colorClass = "text-warning"; } else { msg = "Cần cố gắng."; colorClass = "text-danger"; } const scoreText = document.getElementById('score-text'); scoreText.innerText = `${msg} (${percent}%)`; scoreText.className = `fw-bold mb-4 ${colorClass}`; try { showReactionFace('react-face', percent); } catch (e) {} // ===== HIEN THI XEP HANG + BANG XEP HANG (so voi tat ca HS moi lop tung lam bai nay) ===== const ranking = gradeData.ranking; if (ranking && ranking.total_students > 0) { const rankingBox = document.getElementById('ranking-box'); const rankingText = document.getElementById('ranking-text'); const lbList = document.getElementById('leaderboard-list'); rankingText.innerHTML = `🏆 Bạn xếp hạng <b>#${ranking.rank}/${ranking.total_students}</b> — Top <b>${ranking.percentile_top}%</b>`; if (ranking.leaderboard && ranking.leaderboard.length > 0) { let rows = '<div style="font-size:11px;color:#9e8a6b;font-weight:700;margin-bottom:6px">🥇 TOP ĐIỂM CAO NHẤT</div>'; ranking.leaderboard.forEach((row, i) => { const medal = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : `${i + 1}.`; rows += `<div style="display:flex;justify-content:space-between;padding:4px 0;font-size:13px;border-bottom:1px solid #fef3c7"> <span>${medal} ${row.name}</span><span style="font-weight:700;color:#b45309">${row.score}</span> </div>`; }); lbList.innerHTML = rows; } rankingBox.style.display = 'block'; } // ===== SHARE LINK (KHÔNG BỊ DUPLICATE) ===== let oldShare = document.getElementById("share-box"); if (oldShare) oldShare.remove(); const shareUrl = window.location.href.split('?')[0] + `?s=${score}/${total}`; const shareBox = document.createElement("div"); shareBox.id = "share-box"; shareBox.className = "mt-3"; shareBox.innerHTML = ` <input type="text" class="form-control mb-2 text-center fw-bold" value="${shareUrl}" readonly> <button class="btn btn-success w-100" onclick="copyLink('${shareUrl}')"> <i class="fas fa-copy"></i> Copy link chia sẻ </button> `; resultBox.appendChild(shareBox); window.scrollTo({ top: 0, behavior: 'smooth' }); // Ket qua da duoc gui + luu server o buoc cham diem phia tren roi, khong goi lai lan 2 if (!isLoggedIn) { // Khach vua nop bai: moi tao tai khoan hoc sinh (1 mat khau) de luu ket qua va on lai cau sai const wrongCount = Object.values(perQuestion).filter(i => i && i.correct === false).length; const cta = document.createElement("div"); cta.id = "guest-signup-cta"; cta.className = "card border-primary mt-3"; cta.style.borderRadius = "14px"; cta.innerHTML = `<div class="card-body"> <h6 class="fw-bold text-primary mb-1" id="gs-title"></h6> <div class="small text-muted mb-2">Tạo tài khoản học sinh miễn phí, chỉ cần 1 mật khẩu. Không cần có lớp.</div> <input id="gs-name" class="form-control mb-2" placeholder="Họ và tên" maxlength="100" autocomplete="name"> <input id="gs-phone" class="form-control mb-2" type="tel" inputmode="tel" placeholder="SĐT phụ huynh" maxlength="15" autocomplete="tel"> <input id="gs-pass" class="form-control mb-2" type="password" placeholder="Tạo mật khẩu (ít nhất 6 ký tự)" autocomplete="new-password"> <input id="gs-code" class="form-control mb-2" placeholder="Mã lớp (nếu thầy/cô đã cho, không bắt buộc)" maxlength="20" style="text-transform:uppercase"> <div id="gs-msg" class="small text-danger mb-2"></div> <button id="gs-btn" class="btn btn-primary w-100 fw-bold" type="button"></button> <div class="text-center small mt-2">Đã có tài khoản? <a id="gs-login" href="/login">Đăng nhập</a></div> </div>`; resultBox.appendChild(cta); document.getElementById("gs-title").textContent = wrongCount > 0 ? `💾 Lưu kết quả và ôn lại ${wrongCount} câu bạn vừa sai` : "💾 Lưu kết quả và luyện tập thêm miễn phí"; document.getElementById("gs-btn").textContent = wrongCount > 0 ? "Tạo tài khoản & ôn câu sai" : "Tạo tài khoản"; document.getElementById("gs-name").value = guestName || ""; document.getElementById("gs-phone").value = guestPhone || ""; document.getElementById("gs-login").href = "/login?role=student&next=" + encodeURIComponent(location.pathname); document.getElementById("gs-btn").addEventListener("click", async function () { const btn = this, msg = document.getElementById("gs-msg"); msg.textContent = ""; btn.disabled = true; const old = btn.textContent; btn.textContent = "Đang tạo tài khoản..."; try { const r = await fetch("/dang-ky-nhanh", { method: "POST", headers: {"Content-Type": "application/json"}, credentials: "same-origin", body: JSON.stringify({ name: document.getElementById("gs-name").value, phone: document.getElementById("gs-phone").value, password: document.getElementById("gs-pass").value, code: document.getElementById("gs-code").value, exercise_id: exerciseId, answers: studentAnswers }) }); const j = await r.json(); if (j.ok) { window.location.href = j.redirect || "/student_dashboard"; return; } msg.textContent = j.message || "Không tạo được tài khoản, vui lòng thử lại."; } catch (e) { msg.textContent = "Lỗi kết nối, vui lòng thử lại."; } btn.disabled = false; btn.textContent = old; }); } if (!isLoggedIn && gradeData.saved === true) { const savedBox = document.createElement("div"); savedBox.className = "alert alert-success mt-3 text-center"; savedBox.innerHTML = `<i class="fas fa-check-circle me-2"></i><b>Đã lưu điểm thành công!</b> Giáo viên sẽ xem được kết quả của bạn.`; resultBox.appendChild(savedBox); } let oldHomeBtn = document.getElementById("home-btn-box"); if (oldHomeBtn) oldHomeBtn.remove(); const homeBox = document.createElement("div"); homeBox.id = "home-btn-box"; homeBox.className = "mt-3 text-center"; const role = document.body.dataset.role || 'student'; const homeUrl = role === 'student' ? '/student_dashboard' : '/diemdanh'; homeBox.innerHTML = `<a href="${homeUrl}" class="btn btn-primary w-100"> <i class="fas fa-home me-2"></i>Về trang chủ </a>`; resultBox.appendChild(homeBox); if (window.MathJax) MathJax.typesetPromise(); // Nudge cai app ngay sau khi HOC SINH / KHACH nop bai xong tren web if (role === 'student' || role === 'guest' || !isLoggedIn) { showAppInstallNudge(); } } function showAppInstallNudge() { if (document.getElementById('app-nudge-overlay')) return; const qrIosUrl = 'https://api.qrserver.com/v1/create-qr-code/?size=180x180&data=' + encodeURIComponent('https://apps.apple.com/app/diem-danh-app/id6782804149'); const qrAndroidUrl = 'https://api.qrserver.com/v1/create-qr-code/?size=180x180&data=' + encodeURIComponent('https://play.google.com/store/apps/details?id=com.diemdanh.app'); const overlay = document.createElement('div'); overlay.id = 'app-nudge-overlay'; overlay.style.cssText = 'display:flex;position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:9999;align-items:center;justify-content:center;padding:16px'; overlay.innerHTML = ` <div style="background:white;border-radius:24px;padding:26px 20px;max-width:450px;width:100%;text-align:center;position:relative;box-shadow:0 20px 40px rgba(0,0,0,0.25)"> <button onclick="document.getElementById('app-nudge-overlay').remove()" style="position:absolute;top:12px;right:12px;background:#f1f5f9;border:none;width:32px;height:32px;border-radius:50%;font-size:16px;color:#64748b;cursor:pointer;display:flex;align-items:center;justify-content:center;font-weight:bold">✕</button> <div style="font-size:42px;margin-bottom:4px">🎉</div> <h3 style="margin:0 0 6px;color:#0a2463;font-size:18px;font-weight:800">Nộp bài thành công!</h3> <p style="color:#4b5563;font-size:13.5px;margin:0 0 16px;line-height:1.5">Tải app <b>Bài Trắc Nghiệm</b> để nộp bài tập, xem điểm & nhận thông báo tức thì ngay trên điện thoại!</p> <div style="display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px"> <!-- iOS QR --> <div style="background:#f8fafc;border:1.5px solid #e2e8f0;border-radius:16px;padding:12px 8px;display:flex;flex-direction:column;align-items:center"> <div style="font-size:12.5px;font-weight:700;color:#0f172a;margin-bottom:8px"> 🍎 iOS (iPhone/iPad) </div> <img src="${qrIosUrl}" alt="QR iOS App Store" style="width:130px;height:130px;border-radius:10px;border:1px solid #cbd5e1;background:white;padding:4px;margin-bottom:8px"> <a href="https://apps.apple.com/app/diem-danh-app/id6782804149" target="_blank" style="display:flex;align-items:center;justify-content:center;gap:6px;background:#000;color:#fff;text-decoration:none;padding:8px 10px;border-radius:10px;width:100%;box-sizing:border-box"> <svg width="15" height="15" viewBox="0 0 24 24" fill="white"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg> <div style="text-align:left;line-height:1.1"><div style="font-size:8px;opacity:.7">App Store</div><div style="font-size:11px;font-weight:800">Tải về iOS</div></div> </a> </div> <!-- Android QR --> <div style="background:#f8fafc;border:1.5px solid #e2e8f0;border-radius:16px;padding:12px 8px;display:flex;flex-direction:column;align-items:center"> <div style="font-size:12.5px;font-weight:700;color:#0f172a;margin-bottom:8px"> 🤖 Android App </div> <img src="${qrAndroidUrl}" alt="QR Android Google Play" style="width:130px;height:130px;border-radius:10px;border:1px solid #cbd5e1;background:white;padding:4px;margin-bottom:8px"> <a href="https://play.google.com/store/apps/details?id=com.diemdanh.app" target="_blank" style="display:flex;align-items:center;justify-content:center;gap:6px;background:#000;color:#fff;text-decoration:none;padding:8px 10px;border-radius:10px;width:100%;box-sizing:border-box"> <svg width="15" height="15" viewBox="0 0 24 24" fill="white"><path d="M17.523 15.34a1.4 1.4 0 1 1-1.4-1.4 1.4 1.4 0 0 1 1.4 1.4M6.877 13.94a1.4 1.4 0 1 0 1.4 1.4 1.4 1.4 0 0 0-1.4-1.4M20.4 9.6H3.6a.6.6 0 0 0-.6.6v7.2a2.4 2.4 0 0 0 2.4 2.4h.3v2.4a1.2 1.2 0 0 0 2.4 0V19.8h6v2.4a1.2 1.2 0 0 0 2.4 0V19.8h.3a2.4 2.4 0 0 0 2.4-2.4v-7.2a.6.6 0 0 0-.6-.6M16.5 4.98l1.32-1.98a.36.36 0 0 0-.6-.4l-1.44 2.16a6.6 6.6 0 0 0-6.36 0L8 2.6a.36.36 0 1 0-.6.4l1.32 1.98A6.6 6.6 0 0 0 5.4 9.6h13.2a6.6 6.6 0 0 0-2.1-4.62"/></svg> <div style="text-align:left;line-height:1.1"><div style="font-size:8px;opacity:.7">Google Play</div><div style="font-size:11px;font-weight:800">Tải Android</div></div> </a> </div> </div> <div style="background:#eff6ff;border-radius:10px;padding:8px 12px;font-size:11.5px;color:#1e40af;margin-bottom:12px;line-height:1.4"> 💡 <b>Mẹo:</b> Dùng Camera hoặc Zalo quét mã QR tương ứng để cài app thuận tiện! </div> <button onclick="document.getElementById('app-nudge-overlay').remove()" style="background:none;border:none;color:#64748b;font-size:13px;font-weight:600;cursor:pointer;padding:4px 12px">Để sau</button> </div>`; document.body.appendChild(overlay); } // ===== COPY LINK ===== function copyLink(link) { navigator.clipboard.writeText(link); alert("Đã copy link!"); } // ===== AUTO HIỂN THỊ KHI MỞ LINK SHARE ===== window.onload = function () { const params = new URLSearchParams(window.location.search); const s = params.get("s"); if (s) { document.getElementById('result-summary').style.display = 'block'; document.querySelector('.footer-bar').style.display = 'none'; const qnavEl = document.getElementById('qnav-wrap'); if (qnavEl) qnavEl.style.display = 'none'; document.getElementById('final-score').innerText = s; document.getElementById('score-text').innerText = "Kết quả được chia sẻ"; } }; </script> <script> // COUNTDOWN TIMER const timeLimit = parseInt(document.body.dataset.timeLimit || '0'); if (timeLimit > 0) { // Tao timer box const timerBox = document.createElement('div'); timerBox.id = 'countdown-box'; timerBox.style.cssText = 'position:fixed;top:16px;right:16px;background:#0a2463;color:white;padding:10px 18px;border-radius:12px;font-size:18px;font-weight:700;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,0.3);display:flex;align-items:center;gap:8px'; timerBox.innerHTML = '<i class="fas fa-clock"></i> <span id="timer-display">--:--</span>'; document.body.appendChild(timerBox); let totalSeconds = timeLimit * 60; function updateTimer() { const m = Math.floor(totalSeconds / 60); const s = totalSeconds % 60; const display = `${String(m).padStart(2,'0')}:${String(s).padStart(2,'0')}`; document.getElementById('timer-display').textContent = display; // Doi mau khi gan het gio if (totalSeconds <= 300) { timerBox.style.background = '#e53935'; timerBox.style.animation = totalSeconds <= 60 ? 'pulse 1s infinite' : 'none'; } else if (totalSeconds <= 600) { timerBox.style.background = '#f57c00'; } if (totalSeconds <= 0) { clearInterval(timerInterval); timerBox.innerHTML = '<i class="fas fa-clock"></i> HẾT GIỜ!'; // Tu dong nop bai alert('Hết giờ! Bài thi sẽ được nộp tự động.'); const submitBtn = document.querySelector('.submit-btn, button[onclick*="submit"], button[onclick*="Submit"]'); if (submitBtn) { submitBtn.click(); } else { // Goi ham submit neu co if (typeof submitQuiz === 'function') submitQuiz(); else if (typeof checkAnswers === 'function') checkAnswers(); } } totalSeconds--; } updateTimer(); const timerInterval = setInterval(updateTimer, 1000); } </script> <style> @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } </style> <!-- Modal Thông báo dành riêng cho Giáo viên (khi học sinh/khách bấm) --> <div class="modal fade" id="teacherOnlyNoticeModal" tabindex="-1" style="z-index: 100000;"> <div class="modal-dialog modal-dialog-centered" style="max-width:420px"> <div class="modal-content border-0 shadow-lg rounded-4 overflow-hidden"> <div class="modal-header border-0 pb-0 text-center d-block bg-light pt-4"> <div style="font-size: 2.8rem; line-height: 1">👩‍🏫</div> <h5 class="modal-title fw-bold text-primary mt-2">Dành riêng cho Giáo viên</h5> </div> <div class="modal-body text-center py-4 px-4 bg-light"> <p class="text-muted small mb-4" style="line-height:1.6"> Tính năng <b>Giao bài cho lớp</b> dành cho tài khoản <b>Giáo viên</b>.<br> Hãy đăng nhập hoặc tạo tài khoản Giáo viên miễn phí để giao bài cho học sinh và nhận kết quả tự động! </p> <div class="d-grid gap-2"> <a href="/login?next=/bai-tap/datchucvyngungona" class="btn btn-primary fw-bold py-2 shadow-sm"> 🔑 Đăng nhập Giáo viên </a> <a href="/login" class="btn btn-outline-primary fw-bold py-2"> ✨ Đăng ký / Đăng nhập </a> </div> </div> <div class="modal-footer border-0 pt-0 justify-content-center bg-light pb-3"> <button type="button" class="btn btn-link btn-sm text-secondary text-decoration-none" data-bs-dismiss="modal">Để sau</button> </div> </div> </div> </div> <script> function copyPublicQuizLink(btn) { var u = 'https://baitracnghiem.app' + location.pathname; var done = function () { var o = btn.innerHTML; btn.innerHTML = '✅ Đã copy'; setTimeout(function () { btn.innerHTML = o; }, 1800); }; if (navigator.clipboard) navigator.clipboard.writeText(u).then(done, function () { window.prompt('Copy link:', u); }); else window.prompt('Copy link:', u); } function handleAssignExercisePublic() { var el = document.getElementById('teacherOnlyNoticeModal'); if (el && typeof bootstrap !== 'undefined' && bootstrap.Modal) { var m = bootstrap.Modal.getInstance(el) || new bootstrap.Modal(el); m.show(); } else { alert('Chỉ Giáo viên mới có thể giao bài tập này cho học sinh! Vui lòng Đăng nhập tài khoản Giáo viên.'); window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname); } } </script> <script> /* Gui TIEN DO lam bai cho giao vien xem truc tiep (API /api/exercise-progress - xem exercise_live.py). Chi bat dau sau khi hoc sinh chon/dien dap an dau tien; server tu cham, khong co dap an dung o may HS. */ (function(){ var exId = document.body.dataset.exerciseId; if (!exId || exId === '0' || exId === 'None') return; var cid = ''; try { cid = localStorage.getItem('live_cid_' + exId) || ''; } catch (e) {} if (!cid) { cid = (window.crypto && crypto.randomUUID) ? crypto.randomUUID().replace(/-/g, '') : (Math.random().toString(36).slice(2) + Date.now().toString(36)); try { localStorage.setItem('live_cid_' + exId, cid); } catch (e) {} } var started = false, finished = false, curQ = '', timer = null; function collect(){ var out = {}; document.querySelectorAll('.question-card').forEach(function(card){ var q = card.dataset.qnum, t = (typeof normalizeQtype === 'function') ? normalizeQtype(card.dataset.qtype || 'Multiple Choice') : (card.dataset.qtype || ''); var radios = card.querySelectorAll('input[type="radio"]'), sels = card.querySelectorAll('select.select-matching-item'); if (t === 'True_False') { var tf = {}; radios.forEach(function(r){ if (r.checked) { var p = r.name.split('_'); if (p.length > 1) tf[p[1]] = r.value; } }); out[q] = tf; } else if (t === 'Matching') { var m = {}; sels.forEach(function(s){ var p = s.name.split('_'); if (p.length > 1) m[p[1]] = s.value; }); out[q] = m; } else if (t === 'Essay' || t === 'Short_Answer' || t === 'Fill in the Blank') { var v = ''; card.querySelectorAll('textarea, input[type="text"]').forEach(function(i){ if (i.value) v = i.value; }); out[q] = v; } else { var cbs = card.querySelectorAll('input[type="checkbox"]'); if (cbs.length) { var pk = []; cbs.forEach(function(c){ if (c.checked) pk.push(c.value); }); out[q] = pk.join(', '); } else { var pv = ''; radios.forEach(function(r){ if (r.checked) pv = r.value; }); out[q] = pv; } } }); return out; } function send(){ if (!started || finished) return; var n = document.getElementById('guestNameInput'); try { fetch('/api/exercise-progress', { method: 'POST', headers: {'Content-Type': 'application/json'}, keepalive: true, credentials: 'same-origin', body: JSON.stringify({ exercise_id: exId, client_id: cid, name: n ? n.value.trim() : '', current_q: curQ, answers: collect() }) }).catch(function(){}); } catch (e) {} } function schedule(card){ if (card && card.dataset) curQ = card.dataset.qnum || curQ; started = true; if (timer) return; timer = setTimeout(function(){ timer = null; send(); }, 1200); // gop nhieu thao tac lien tiep } document.addEventListener('change', function(e){ var c = e.target.closest && e.target.closest('.question-card'); if (c) schedule(c); }); document.addEventListener('input', function(e){ var c = e.target.closest && e.target.closest('.question-card'); if (c) schedule(c); }); setInterval(function(){ if (started && !finished && document.visibilityState === 'visible') send(); }, 10000); // nhip "con online" window._liveDone = function(){ finished = true; try { fetch('/api/exercise-progress/done', { method: 'POST', headers: {'Content-Type': 'application/json'}, keepalive: true, body: JSON.stringify({ exercise_id: exId, client_id: cid }) }); } catch (e) {} try { localStorage.removeItem('live_cid_' + exId); } catch (e) {} }; })(); </script> <script> (function(){try{var id=document.body.dataset.exerciseId;if(!id)return; fetch('/api/exercise-cap/'+id).then(function(r){return r.json()}).then(function(d){ if(!d||!d.blocked)return; var b=document.createElement('div'); b.style.cssText='position:sticky;top:0;z-index:9999;background:#dc2626;color:#fff;padding:12px 16px;text-align:center;font-weight:700;font-size:15px'; b.textContent='⛔ '+d.message;document.body.insertBefore(b,document.body.firstChild); document.querySelectorAll('.submit-btn').forEach(function(x){x.disabled=true;x.innerText='Bài đã đạt giới hạn lượt nộp'}); }).catch(function(){});}catch(e){}})(); </script> <script> /* Che do luyen tap (VIP): chon dap an la biet dung/sai ngay, cham o server. Chi chay khi GV bat cho bai nay. */ (function(){ var eid = document.body.dataset.exerciseId; if (!eid) return; function letter(s){ s = String(s||'').trim().toUpperCase(); var m = s.match(/^([A-D])(?:[.)\s]|$)/); return m ? m[1] : s; } function practiceExplain(d) { var first = document.querySelector('.question-card'); if (!first || document.getElementById('practice-explain-bar')) return; var upgrade = '/tao-bai-trac-nghiem?from=practice_explain'; var bar = document.createElement('button'); bar.id = 'practice-explain-bar'; bar.type = 'button'; bar.style.cssText = 'display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;margin:0 0 12px;padding:11px 14px;border:1.5px solid #ddd6fe;background:#f5f3ff;color:#5b21b6;border-radius:12px;font-size:14px;font-weight:700;cursor:pointer;text-align:left'; var blockedWhy = d.blocked ? (d.blocked_reason === 'anti_cheat' ? 'chế độ chống gian lận' : 'giới hạn thời gian' + (d.time_limit ? ' (' + d.time_limit + ' phút)' : '')) : ''; bar.innerHTML = '<span>🎯 Chế độ luyện tập: biết đúng/sai từng câu ngay khi chọn</span><span style="font-size:12px;font-weight:600;white-space:nowrap">Tìm hiểu ›</span>'; first.parentNode.insertBefore(bar, first); bar.onclick = function () { if (document.getElementById('practice-explain-modal')) return; var m = document.createElement('div'); m.id = 'practice-explain-modal'; m.style.cssText = 'position:fixed;inset:0;z-index:100010;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:16px'; m.innerHTML = '<div style="background:#fff;border-radius:20px;max-width:420px;width:100%;padding:22px 20px 18px;box-shadow:0 18px 44px rgba(0,0,0,.3);max-height:92vh;overflow:auto">' + '<div style="font-size:18px;font-weight:800;color:#0f172a;margin-bottom:8px">🎯 Chế độ luyện tập là gì?</div>' + '<p style="font-size:14px;line-height:1.55;color:#334155;margin:0 0 12px">Khi bật luyện tập, bạn <b>chọn đáp án nào là biết đúng hay sai ngay</b> và xem lời giải từng câu, không cần chờ nộp bài. Rất hợp để ôn tập. ' + (d.blocked ? 'Bài này đang đặt <b>' + blockedWhy + '</b> (kiểu bài kiểm tra) nên <b>chưa có chế độ luyện tập</b>, nâng VIP cũng chưa mở được. Bạn có thể nhờ giáo viên gỡ cài đặt đó và bật luyện tập:' : 'Chế độ này <b>chưa bật cho bài này</b>. Bạn có thể:') + '</p>' + '<div style="border:1.5px solid #e2e8f0;border-radius:14px;padding:12px;margin-bottom:10px"><div style="font-weight:700;font-size:14px;color:#0f172a;margin-bottom:6px">👩‍🏫 Nhờ giáo viên bật cho bài này</div>' + '<button type="button" id="pe-copy" style="width:100%;border:none;background:#1a56db;color:#fff;border-radius:10px;padding:10px;font-weight:700;font-size:13.5px;cursor:pointer">📋 Sao chép lời nhắn gửi giáo viên</button></div>' + (d.blocked ? '' : '<div style="border:1.5px solid #fde68a;background:#fffbeb;border-radius:14px;padding:12px;margin-bottom:12px"><div style="font-weight:700;font-size:14px;color:#92400e;margin-bottom:4px">✍️ Tự soạn đề để luyện tập riêng</div>' + '<div style="font-size:12.5px;line-height:1.5;color:#92400e;margin-bottom:8px">Bạn tự học? Tạo đề của riêng bạn trong vài giây. Tài khoản VIP có thể bật chế độ luyện tập không giới hạn cho mọi đề của mình.</div>' + '<a id="pe-vip" target="_blank" rel="noopener" style="display:block;text-align:center;background:#ea580c;color:#fff;border-radius:10px;padding:10px;font-weight:700;font-size:13.5px;text-decoration:none">Tạo đề của riêng tôi</a></div>') + '<button type="button" id="pe-close" style="width:100%;border:none;background:#f1f5f9;color:#475569;border-radius:10px;padding:9px;font-weight:600;font-size:13px;cursor:pointer">Để sau</button></div>'; document.body.appendChild(m); var vipA = m.querySelector('#pe-vip'); if (vipA) { vipA.href = upgrade; vipA.onclick = function () { var r = window.ddVipSheet ? ddVipSheet('gv', 'bt_pe') : true; if (r === false) close(); return r; }; } function close() { if (m.parentNode) m.parentNode.removeChild(m); } m.querySelector('#pe-close').onclick = close; m.addEventListener('click', function (ev) { if (ev.target === m) close(); }); m.querySelector('#pe-copy').onclick = function () { var msg = d.blocked ? 'Thầy/cô ơi, nhờ thầy/cô bỏ ' + blockedWhy + ' và bật Chế độ luyện tập (hiện đáp án đúng/sai từng câu) cho bài này giúp em ạ: ' + location.href : 'Thầy/cô ơi, nhờ thầy/cô bật Chế độ luyện tập (hiện đáp án đúng/sai từng câu) cho bài này giúp em ạ: ' + location.href; var btn = this; function done() { btn.textContent = '✅ Đã sao chép, hãy gửi cho giáo viên'; } if (navigator.share) { navigator.share({ text: msg }).then(done, function () {}); return; } if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(msg).then(done, function () {}); return; } var ta = document.createElement('textarea'); ta.value = msg; document.body.appendChild(ta); ta.select(); try { document.execCommand('copy'); done(); } catch (e) {} document.body.removeChild(ta); }; }; } fetch('/api/practice-mode/' + eid).then(function(r){return r.json();}).then(function(d){ if (!d.enabled) { if (!d.owner) practiceExplain(d); return; } document.querySelectorAll('.question-card').forEach(function(card){ var list = card.querySelector('.options-list'); if (!list || list.dataset.multi) return; var qn = card.dataset.qnum; list.querySelectorAll('input[type=radio]').forEach(function(inp){ inp.addEventListener('change', function(){ if (card.dataset.practiceDone) return; card.dataset.practiceDone = '1'; fetch('/api/exercise/' + eid + '/practice-check', {method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({qnum: qn, answer: inp.value})}) .then(function(r){return r.json();}).then(function(res){ if (res.error) { card.dataset.practiceDone = ''; return; } var right = letter(res.correct_answer); list.querySelectorAll('input[type=radio]').forEach(function(x){ var lab = x.closest('.option-item'); x.disabled = true; if (!lab) return; if (letter(x.value) === right) lab.classList.add('correct-style'); else if (x.checked) lab.classList.add('wrong-style'); }); var box = card.querySelector('.explanation-box'); if (box) { if (window.StudentAiTutor && !res.correct) { window.StudentAiTutor.enhanceCardExplanation(card, !!res.correct, res.correct_answer || '', res.explanation || ''); } else { box.innerHTML = '<h6 class="fw-bold ' + (res.correct ? 'text-success' : 'text-danger') + ' mb-0">' + (res.correct ? '✔ Chính xác!' : '✘ Chưa đúng — đáp án đúng: ' + (res.correct_answer || '')) + '</h6>' + (res.explanation ? '<div style="margin-top:6px;font-size:13px;color:#374151"></div>' : ''); var ex = box.querySelector('div'); if (ex) ex.textContent = res.explanation; box.classList.add('explanation-show'); } } }).catch(function(){ card.dataset.practiceDone = ''; }); }); }); }); }).catch(function(){}); })(); </script> <div style="max-width:760px;margin:24px auto;padding:16px 20px;border:1px solid #c7d2fe;background:#eef2ff;border-radius:12px;text-align:center;font-family:inherit"> <div style="font-weight:700;color:#1e1b4b;margin-bottom:6px">Muốn tạo bài trắc nghiệm tương tự từ file Word của bạn?</div> <a href="/tao-trac-nghiem-tu-file-word" style="display:inline-block;background:#4f46e5;color:#fff;padding:9px 18px;border-radius:8px;text-decoration:none;font-weight:600">Tạo trắc nghiệm từ file Word →</a> </div> <script src="/static/js/student_ai_tutor.js?v=8"></script> <script src="/static/js/quiz_stepper.js?v=2"></script> <script src="/static/js/noto_emoji.js?v=2"></script> <script src="/static/js/quiz_fx.js?v=3"></script> <div id="ddVipSheet" style="display:none;position:fixed;inset:0;z-index:100000;background:rgba(15,23,42,.55);align-items:flex-end;justify-content:center;font-family:system-ui,-apple-system,Segoe UI,sans-serif"> <div style="background:#fff;border-radius:22px 22px 0 0;padding:22px 18px 24px;width:100%;max-width:460px;position:relative;max-height:92vh;overflow:auto;box-shadow:0 -10px 40px rgba(0,0,0,.25)"> <button type="button" onclick="ddVipSheetClose()" aria-label="Đóng" style="position:absolute;top:10px;right:14px;border:0;background:#f1f5f9;border-radius:50%;width:30px;height:30px;font-size:16px;cursor:pointer;color:#64748b">×</button> <div style="text-align:center;margin-bottom:12px"><div style="font-size:30px">⭐</div> <div id="ddvsTitle" style="font-size:18px;font-weight:800;color:#0a2463"></div> <div id="ddvsSub" style="font-size:12.5px;color:#64748b;margin-top:2px"></div></div> <div id="ddvsPlans" style="display:grid;gap:8px;margin-bottom:12px"></div> <div id="ddvsEmailBox" style="display:none;margin-bottom:12px"> <input id="ddvsEmail" type="email" placeholder="Email của bạn (để nhận thông tin đăng nhập)" style="width:100%;box-sizing:border-box;border:1.5px solid #e2e8f0;border-radius:10px;padding:11px 12px;font-size:14px;outline:none"> </div> <button type="button" id="ddvsPay" onclick="ddVipSheetPay()" style="width:100%;border:0;border-radius:12px;padding:13px 0;background:linear-gradient(135deg,#f59e0b,#ea580c);color:#fff;font-weight:800;font-size:15px;cursor:pointer">⚡ Thanh toán qua PayOS</button> <div style="text-align:center;font-size:11px;color:#94a3b8;margin-top:8px">Kích hoạt tự động ngay sau khi thanh toán</div> </div> </div> <script> (function(){ var LOGGED=false, ROLE=""; var PLANS={ gv:[{id:'1year',label:'1 năm',price:499000,days:365,best:1},], hs:[{id:'hs_year',label:'1 năm',price:250000,days:365,best:1},{id:'hs_month',label:'1 tháng',price:29000,days:30}] }; var st={kind:'gv',from:'',plan:''}; function vnd(n){return Number(n).toLocaleString('vi-VN')+'đ'} function render(){ var box=document.getElementById('ddvsPlans');box.innerHTML=''; PLANS[st.kind].forEach(function(p){ var d=document.createElement('label');d.style.cssText='display:flex;align-items:center;gap:10px;border:2px solid '+(st.plan===p.id?'#2563eb':'#e2e8f0')+';border-radius:12px;padding:11px 12px;cursor:pointer;background:'+(st.plan===p.id?'#eff6ff':'#fff'); d.innerHTML='<input type="radio" name="ddvsPlan" '+(st.plan===p.id?'checked':'')+' style="accent-color:#2563eb"><div style="flex:1"><b style="color:#0a2463">'+p.label+'</b>'+(p.best?' <span style="background:#dcfce7;color:#15803d;font-size:11px;font-weight:700;padding:1px 8px;border-radius:99px">Tiết kiệm nhất</span>':'')+'<div style="font-size:12px;color:#15803d;font-weight:700">≈ '+vnd(Math.round(p.price/p.days/100)*100)+' / ngày</div></div><div style="font-weight:800;color:#1a56db">'+vnd(p.price)+'</div>'; d.onclick=function(){st.plan=p.id;render()};box.appendChild(d); }); } window.ddVipSheetClose=function(){document.getElementById('ddVipSheet').style.display='none'}; window.ddVipSheet=function(kind,from){ // HS chua dang nhap: giu luong cu (sang /vip-hs de dang ky hoc sinh truoc). Khong co goi nao bat: chuyen trang binh thuong. if(kind==='gv'&&LOGGED&&ROLE==='student')return true; if(!PLANS[kind]||!PLANS[kind].length)return true; st.kind=kind;st.from=(from||'demo').replace(/[^a-z0-9_]/gi,'');st.plan=PLANS[kind][0].id; document.getElementById('ddvsTitle').textContent=kind==='hs'?'Nâng VIP học sinh':'Nâng VIP giáo viên'; document.getElementById('ddvsSub').textContent=kind==='hs'?'Trợ lý thông minh Gia sư giải thích từng bước, luyện tập không giới hạn':'Tạo bài Trợ lý thông minh không giới hạn, bỏ quảng cáo, thông báo điểm danh tự động'; document.getElementById('ddvsEmailBox').style.display=(!LOGGED)?'block':'none'; render();document.getElementById('ddVipSheet').style.display='flex'; try{var v=JSON.stringify({source:'sheet_'+st.from,page:'demo'});navigator.sendBeacon&&navigator.sendBeacon('/api/vip-popup-shown',new Blob([v],{type:'application/json'}))}catch(e){} return false; }; window.ddVipSheetPay=function(){ var b=document.getElementById('ddvsPay'),url,body; if(st.kind==='hs'){var eh=(document.getElementById('ddvsEmail').value||'').trim(); if(!LOGGED&&(!eh||eh.indexOf('@')<0)){alert('Vui lòng nhập email hợp lệ để nhận thông tin đăng nhập sau khi thanh toán.');document.getElementById('ddvsEmail').focus();return} url='/vip-hs/payos/create';body='plan='+st.plan+'&source='+encodeURIComponent(('sheet_'+st.from).slice(0,30))+(eh&&!LOGGED?'&email='+encodeURIComponent(eh):'')} else{var em=(document.getElementById('ddvsEmail').value||'').trim(); if(!LOGGED&&(!em||em.indexOf('@')<0)){alert('Vui lòng nhập email hợp lệ để nhận thông tin đăng nhập sau khi thanh toán.');document.getElementById('ddvsEmail').focus();return} url='/vip/payos/create';body='plan='+st.plan+'&source='+encodeURIComponent(('demo_sheet_'+st.from).slice(0,40))+(em?'&email='+encodeURIComponent(em):'')} b.disabled=true;var old=b.textContent;b.textContent='Đang kết nối PayOS...'; fetch(url,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:body}).then(function(r){return r.json()}).then(function(d){ if(d&&d.checkout_url){location.href=d.checkout_url}else{alert((d&&d.error)||'Không tạo được link thanh toán, vui lòng thử lại.');b.disabled=false;b.textContent=old} }).catch(function(e){alert('Lỗi kết nối: '+e.message);b.disabled=false;b.textContent=old}); }; // Moi link /vip, /vip-hs (ke ca link do script khac chen vao) deu mo bang thanh toan ngay tren trang document.addEventListener('click',function(e){ var a=e.target&&e.target.closest?e.target.closest('a[href]'):null; if(!a||a.closest('#ddVipSheet')||a.hasAttribute('onclick')||a.hasAttribute('data-nosheet'))return; var u;try{u=new URL(a.getAttribute('href'),location.href)}catch(x){return} if(!/(^|\.)(diemdanh|baitracnghiem)\.app$/.test(u.hostname))return; var p=u.pathname.replace(/\/$/,''),kind=p==='/vip-hs'?'hs':(p==='/vip'?'gv':''); if(!kind||u.searchParams.get('gate'))return; if(window.ddVipSheet(kind,u.searchParams.get('from')||'link')===false){e.preventDefault();e.stopPropagation()} },true); })(); </script> <script>(function(){ var m=location.pathname.match(/^\/bai-tap\/([^\/]+)\/?$/),k='bt'; if(!m){m=location.pathname.match(/^\/demo\/share\/([^\/]+)\/?$/);k='dm';} if(!m)return;var key=decodeURIComponent(m[1]),LOGGED=false; function toast(t){var d=document.createElement('div');d.textContent=t;d.style.cssText='position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:100000;background:#065f46;color:#fff;padding:10px 16px;border-radius:10px;font:600 14px system-ui;box-shadow:0 6px 20px rgba(0,0,0,.25)';document.body.appendChild(d);setTimeout(function(){d.remove()},3500)} function save(cb){fetch('/api/hs-luu-bai',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({kind:k,key:key})}).then(function(r){return r.json()}).then(cb).catch(function(){cb({status:'error'})})} if(LOGGED&&/[?&]luu=1/.test(location.search)){save(function(d){if(d.status==='ok'||d.status==='exists')toast('✅ Đã lưu bài vào mục “Bài đã lưu”');else if(d.status==='limit')toast('Đã đủ bài miễn phí, nâng VIP để lưu thêm')});} var sub=document.getElementById('scoreSub')||document.getElementById('score-text');if(!sub)return; var w=document.createElement('div');w.style.cssText='margin:12px auto;text-align:center'; w.innerHTML='<button type="button" id="hsSaveBtn" style="background:#fff;color:#1a56db;border:1.5px solid #1a56db;padding:8px 16px;border-radius:10px;font-weight:700;font-size:14px;cursor:pointer">💾 Lưu bài để luyện tập sau</button><div id="hsSaveMsg" style="font-size:13px;margin-top:6px;color:#475569"></div>'; sub.parentNode.insertBefore(w,sub.nextSibling); var b=w.querySelector('#hsSaveBtn'),msg=w.querySelector('#hsSaveMsg'); b.onclick=function(){if(!LOGGED){location.href='/dang-ky-hoc-sinh?from=luu_bai&next='+encodeURIComponent(location.pathname+'?luu=1');return} b.disabled=true;save(function(d){b.disabled=false; if(d.status==='ok'||d.status==='exists'){b.style.display='none';msg.innerHTML='✅ Đã lưu. <a href="/luyen-tap/bai-da-luu" style="color:#1a56db;font-weight:700">Xem bài đã lưu →</a>'} else if(d.status==='limit'){msg.innerHTML='Đã đủ '+d.limit+' bài lưu miễn phí. <a href="/vip-hs?from=luu_bai_limit" style="color:#7c3aed;font-weight:800">Nâng VIP học sinh để lưu không giới hạn →</a>'} else if(d.status==='unavailable'){msg.textContent='Bài này chưa lưu được.'}else{msg.textContent='Chưa lưu được, thử lại nhé.'}})}; })();</script><script src="/static/video/vt.js" defer></script></body> </html>