{"id":4630,"date":"2025-07-06T11:36:49","date_gmt":"2025-07-06T04:36:49","guid":{"rendered":"https:\/\/labantrithuc.com\/?page_id=4630"},"modified":"2025-07-06T11:38:07","modified_gmt":"2025-07-06T04:38:07","slug":"mau-quy-doi-diem-hoc-ba-sat","status":"publish","type":"page","link":"https:\/\/labantrithuc.com\/?page_id=4630","title":{"rendered":"M\u1eabu quy \u0111\u1ed5i \u0111i\u1ec3m H\u1ecdc b\u1ea1\/SAT"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"vi\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>\u1ee8ng d\u1ee5ng Quy \u0111\u1ed5i \u0111i\u1ec3m h\u1ecdc b\u1ea1\/V-SAT sang \u0111i\u1ec3m thi THPT<\/title>\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\">\n  <link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.3\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\">\n  <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/xlsx\/0.18.5\/xlsx.full.min.js\"><\/script>\n  <style>\n    body { background: #f3f7fa; }\n    .container { max-width: 750px; margin-top: 40px;}\n    .table td, .table th { text-align: center; }\n    .explain-box {\n      background: #f0f8ff; border-left: 5px solid #1976d2; padding: 16px 22px; margin-bottom: 20px; border-radius: 8px;\n    }\n    .mon-btn { font-weight:500; font-size: 1rem;}\n    @media (max-width: 600px) {\n      .container { max-width: 100%!important; }\n      .table th, .table td { font-size: 0.96rem;}\n    }\n  <\/style>\n<\/head>\n<body>\n<div class=\"container shadow rounded-4 p-4 bg-white mb-4\">\n  <h3 class=\"mb-3 text-primary\">Quy \u0111\u1ed5i \u0111i\u1ec3m h\u1ecdc b\u1ea1\/V-SAT sang \u0111i\u1ec3m thi THPT<\/h3>\n  \n  <!-- Gi\u1ea3i th\u00edch c\u00f4ng th\u1ee9c v\u00e0 c\u00e1ch x\u00e2y d\u1ef1ng b\u1ea3ng quy \u0111\u1ed5i -->\n  <div class=\"explain-box mb-3\">\n    <b>C\u00f4ng th\u1ee9c quy \u0111\u1ed5i m\u1eabu:<\/b><br>\n    <span style=\"color: #1565c0\">N\u1ebfu \u0111i\u1ec3m \u0111\u1ea7u v\u00e0o <code>x<\/code> n\u1eb1m trong kho\u1ea3ng <code>a &lt; x \u2264 b<\/code> th\u00ec \u0111i\u1ec3m quy \u0111\u1ed5i <code>y<\/code> \u0111\u01b0\u1ee3c t\u00ednh theo:<\/span><br>\n    <code>y = c + (d - c) \u00d7 (x - a)\/(b - a)<\/code><br>\n    <small>\n      Trong \u0111\u00f3: <br>\n      &#8211; <b>x<\/b>: \u0110i\u1ec3m h\u1ecdc b\u1ea1 ho\u1eb7c \u0111i\u1ec3m V-SAT g\u1ed1c<br>\n      &#8211; <b>y<\/b>: \u0110i\u1ec3m quy \u0111\u1ed5i ra thang \u0111i\u1ec3m thi t\u1ed1t nghi\u1ec7p THPT (thang 10)<br>\n      &#8211; <b>a, b<\/b>: Kho\u1ea3ng \u0111i\u1ec3m \u0111\u1ea7u v\u00e0o \u1ee9ng v\u1edbi t\u1eebng nh\u00f3m \u201ct\u1ed1p\u201d h\u1ecdc sinh<br>\n      &#8211; <b>c, d<\/b>: Kho\u1ea3ng \u0111i\u1ec3m quy \u0111\u1ed5i t\u01b0\u01a1ng \u1ee9ng<br>\n    <\/small>\n    <hr>\n    <b>Nguy\u00ean t\u1eafc x\u00e2y d\u1ef1ng b\u1ea3ng quy \u0111\u1ed5i chu\u1ea9n:<\/b>\n    <ul style=\"margin-bottom:0;\">\n      <li>Chia ph\u1ed5 \u0111i\u1ec3m \u0111\u1ea7u v\u00e0o th\u00e0nh nhi\u1ec1u m\u1ee9c (top 5%, 10%, 20%, &#8230;)<\/li>\n      <li>C\u00e1c m\u1ee9c \u0111i\u1ec3m cao (top 5-10%) th\u01b0\u1eddng quy \u0111\u1ed5i s\u00e1t l\u00ean 10, v\u00ec \u00edt h\u1ecdc sinh \u0111\u1ea1t \u0111i\u1ec3m tuy\u1ec7t \u0111\u1ed1i \u1edf k\u1ef3 thi t\u1ed1t nghi\u1ec7p.<\/li>\n      <li>B\u1ea3ng quy \u0111\u1ed5i \u0111\u1ea3m b\u1ea3o \u0111i\u1ec3m h\u1ecdc b\u1ea1\/V-SAT v\u00e0 \u0111i\u1ec3m thi THPT c\u00f3 th\u1ec3 so s\u00e1nh c\u00f4ng b\u1eb1ng, h\u1ea1n ch\u1ebf t\u00ecnh tr\u1ea1ng &#8220;l\u1ea1m ph\u00e1t \u0111i\u1ec3m&#8221; h\u1ecdc b\u1ea1.<\/li>\n      <li>N\u1ebfu b\u1ea1n thu\u1ed9c top \u0111\u1ea7u, \u0111i\u1ec3m quy \u0111\u1ed5i c\u00f3 th\u1ec3 cao h\u01a1n \u0111i\u1ec3m g\u1ed1c, nh\u01b0ng kh\u00f4ng v\u01b0\u1ee3t qu\u00e1 10.<\/li>\n    <\/ul>\n    <span class=\"text-muted small\">B\u1ea3ng quy \u0111\u1ed5i m\u1eabu d\u00f9ng trong h\u1ec7 th\u1ed1ng l\u00e0 tham kh\u1ea3o, tr\u01b0\u1eddng c\u00f3 th\u1ec3 t\u00f9y ch\u1ec9nh theo quy ch\u1ebf t\u1eebng n\u0103m.<\/span>\n  <\/div>\n  \n  <div class=\"mb-3\">\n    <label for=\"method\" class=\"form-label\">Ch\u1ecdn ph\u01b0\u01a1ng th\u1ee9c:<\/label>\n    <select class=\"form-select\" id=\"method\" onchange=\"clearResult()\">\n      <option value=\"hm\">H\u1ecdc b\u1ea1 (HM)<\/option>\n      <option value=\"vsat\">V-SAT (VM)<\/option>\n    <\/select>\n  <\/div>\n  <div class=\"row g-2\">\n    <div class=\"col-12 col-md-6\">\n      <div class=\"card card-body mb-2 p-2 px-3 shadow-sm\">\n        <b>Nh\u1eadp \u0111i\u1ec3m c\u00e1c m\u00f4n c\u1ea7n quy \u0111\u1ed5i:<\/b>\n        <div class=\"row gx-1 gy-2 mb-2\" id=\"monInputs\">\n          <!-- JS render \u00f4 nh\u1eadp \u0111i\u1ec3m -->\n        <\/div>\n        <button onclick=\"convertAll()\" class=\"btn btn-success w-100 mb-1\">Quy \u0111\u1ed5i &#038; Hi\u1ec3n th\u1ecb<\/button>\n        <div id=\"msg\"><\/div>\n        <div class=\"d-flex gap-2 mb-2\">\n          <button class=\"btn btn-outline-primary btn-sm\" onclick=\"exportExcel()\">Xu\u1ea5t Excel<\/button>\n          <button class=\"btn btn-outline-secondary btn-sm\" onclick=\"loadSampleTable()\">D\u00f9ng b\u1ea3ng m\u1eabu<\/button>\n          <label class=\"btn btn-outline-info btn-sm mb-0\" style=\"cursor:pointer;\">\n            Nh\u1eadp b\u1ea3ng quy \u0111\u1ed5i\n            <input type=\"file\" id=\"importFile\" accept=\".xlsx,.xls\" style=\"display:none\" onchange=\"importTable(event)\">\n          <\/label>\n        <\/div>\n      <\/div>\n    <\/div>\n    <div class=\"col-12 col-md-6\">\n      <div>\n        <b>B\u1ea3ng k\u1ebft qu\u1ea3 quy \u0111\u1ed5i:<\/b>\n        <div id=\"resultTable\"><\/div>\n      <\/div>\n      <div class=\"mt-2\">\n        <b>Xem b\u1ea3ng quy \u0111\u1ed5i t\u1eebng m\u00f4n:<\/b><br>\n        <div id=\"monBtns\" class=\"d-flex flex-wrap gap-2 mt-1 mb-2\"><\/div>\n        <div id=\"tableArea\"><\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/xlsx\/0.18.5\/xlsx.full.min.js\"><\/script>\n<script>\n\/\/ D\u1eef li\u1ec7u b\u1ea3ng m\u1eabu h\u1ec7 th\u1ed1ng (c\u00f3 th\u1ec3 th\u00eam\/b\u1edbt m\u00f4n)\nlet quyDoi = {\n  \"hm\": {\n    \"toan\": [\n      {a:9.37, b:10.00, c:8.6, d:9.8, top:\"5%\"},\n      {a:9.10, b:9.37, c:8.4, d:8.6, top:\"10%\"},\n      {a:8.73, b:9.10, c:8.0, d:8.4, top:\"20%\"},\n      {a:8.40, b:8.73, c:7.8, d:8.0, top:\"30%\"},\n      {a:8.10, b:8.40, c:7.6, d:7.8, top:\"40%\"},\n      {a:7.77, b:8.10, c:7.2, d:7.6, top:\"50%\"},\n      {a:7.43, b:7.77, c:7.0, d:7.2, top:\"60%\"},\n      {a:7.07, b:7.43, c:6.6, d:7.0, top:\"70%\"},\n      {a:6.63, b:7.07, c:6.2, d:6.6, top:\"80%\"},\n      {a:6.07, b:6.63, c:5.4, d:6.2, top:\"90%\"},\n      {a:1.99, b:6.07, c:1.0, d:5.4, top:\">90%\"}\n    ],\n    \"ly\": [\n      {a:9.25, b:10.0, c:8.5, d:9.7, top:\"5%\"},\n      {a:8.85, b:9.25, c:8.2, d:8.5, top:\"10%\"},\n      {a:8.5, b:8.85, c:8.0, d:8.2, top:\"20%\"},\n      {a:8.10, b:8.5, c:7.8, d:8.0, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.5, d:7.8, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.2, d:7.5, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.9, d:7.2, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.6, d:6.9, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.2, d:6.6, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.6, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.6, top:\">90%\"}\n    ],\n    \"hoa\": [\n      {a:9.20, b:10.0, c:8.6, d:9.8, top:\"5%\"},\n      {a:8.85, b:9.20, c:8.4, d:8.6, top:\"10%\"},\n      {a:8.5, b:8.85, c:8.1, d:8.4, top:\"20%\"},\n      {a:8.10, b:8.5, c:7.8, d:8.1, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.5, d:7.8, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.2, d:7.5, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.9, d:7.2, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.6, d:6.9, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.2, d:6.6, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.6, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.6, top:\">90%\"}\n    ],\n    \"sinh\": [\n      {a:9.15, b:10.0, c:8.4, d:9.6, top:\"5%\"},\n      {a:8.85, b:9.15, c:8.1, d:8.4, top:\"10%\"},\n      {a:8.5, b:8.85, c:7.9, d:8.1, top:\"20%\"},\n      {a:8.10, b:8.5, c:7.6, d:7.9, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.3, d:7.6, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.1, d:7.3, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.8, d:7.1, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.5, d:6.8, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.1, d:6.5, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.5, d:6.1, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.5, top:\">90%\"}\n    ],\n    \"van\": [\n      {a:8.90, b:10.0, c:8.7, d:9.7, top:\"5%\"},\n      {a:8.50, b:8.90, c:8.5, d:8.7, top:\"10%\"},\n      {a:8.10, b:8.50, c:8.2, d:8.5, top:\"20%\"},\n      {a:7.80, b:8.10, c:8.0, d:8.2, top:\"30%\"},\n      {a:7.40, b:7.80, c:7.8, d:8.0, top:\"40%\"},\n      {a:7.00, b:7.40, c:7.4, d:7.8, top:\"50%\"},\n      {a:6.70, b:7.00, c:7.1, d:7.4, top:\"60%\"},\n      {a:6.30, b:6.70, c:6.7, d:7.1, top:\"70%\"},\n      {a:5.90, b:6.30, c:6.2, d:6.7, top:\"80%\"},\n      {a:5.50, b:5.90, c:5.8, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.5, c:1.0, d:5.8, top:\">90%\"}\n    ],\n    \"anh\": [\n      {a:9.20, b:10.0, c:8.5, d:9.7, top:\"5%\"},\n      {a:8.85, b:9.20, c:8.2, d:8.5, top:\"10%\"},\n      {a:8.50, b:8.85, c:8.0, d:8.2, top:\"20%\"},\n      {a:8.10, b:8.50, c:7.8, d:8.0, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.5, d:7.8, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.2, d:7.5, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.9, d:7.2, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.6, d:6.9, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.2, d:6.6, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.6, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.6, top:\">90%\"}\n    ],\n    \"su\": [\n      {a:9.20, b:10.0, c:8.5, d:9.7, top:\"5%\"},\n      {a:8.85, b:9.20, c:8.2, d:8.5, top:\"10%\"},\n      {a:8.50, b:8.85, c:8.0, d:8.2, top:\"20%\"},\n      {a:8.10, b:8.50, c:7.8, d:8.0, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.5, d:7.8, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.2, d:7.5, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.9, d:7.2, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.6, d:6.9, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.2, d:6.6, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.6, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.6, top:\">90%\"}\n    ],\n    \"dia\": [\n      {a:9.15, b:10.0, c:8.4, d:9.6, top:\"5%\"},\n      {a:8.85, b:9.15, c:8.1, d:8.4, top:\"10%\"},\n      {a:8.50, b:8.85, c:7.9, d:8.1, top:\"20%\"},\n      {a:8.10, b:8.50, c:7.6, d:7.9, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.3, d:7.6, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.1, d:7.3, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.8, d:7.1, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.5, d:6.8, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.1, d:6.5, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.5, d:6.1, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.5, top:\">90%\"}\n    ],\n    \"gdcd\": [\n      {a:9.10, b:10.0, c:8.5, d:9.7, top:\"5%\"},\n      {a:8.85, b:9.10, c:8.2, d:8.5, top:\"10%\"},\n      {a:8.50, b:8.85, c:8.0, d:8.2, top:\"20%\"},\n      {a:8.10, b:8.50, c:7.8, d:8.0, top:\"30%\"},\n      {a:7.7, b:8.10, c:7.5, d:7.8, top:\"40%\"},\n      {a:7.3, b:7.7, c:7.2, d:7.5, top:\"50%\"},\n      {a:7.0, b:7.3, c:6.9, d:7.2, top:\"60%\"},\n      {a:6.7, b:7.0, c:6.6, d:6.9, top:\"70%\"},\n      {a:6.3, b:6.7, c:6.2, d:6.6, top:\"80%\"},\n      {a:5.8, b:6.3, c:5.6, d:6.2, top:\"90%\"},\n      {a:2.0, b:5.8, c:1.0, d:5.6, top:\">90%\"}\n    ]\n  },\n  \"vsat\": {\n    \"toan\": [\n      {a:137, b:150, c:9.0, d:10.0, top:\"1%\"},\n      {a:127.5, b:137, c:8.8, d:9.0, top:\"5%\"},\n      {a:121, b:127.5, c:8.6, d:8.8, top:\"10%\"},\n      {a:112.5, b:121, c:8.4, d:8.6, top:\"20%\"},\n      {a:106, b:112.5, c:8.2, d:8.4, top:\"30%\"},\n      {a:99.5, b:106, c:8.0, d:8.2, top:\"40%\"},\n      {a:94, b:99.5, c:7.8, d:8.0, top:\"50%\"},\n      {a:88, b:94, c:7.6, d:7.8, top:\"60%\"},\n      {a:81.5, b:88, c:7.4, d:7.6, top:\"70%\"},\n      {a:74, b:81.5, c:7.0, d:7.4, top:\"80%\"},\n      {a:64, b:74, c:6.4, d:7.0, top:\">80%\"}\n    ],\n    \"ly\": [\n      {a:130, b:150, c:8.6, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.2, d:8.6, top:\"10%\"},\n      {a:110, b:120, c:8.0, d:8.2, top:\"20%\"},\n      {a:100, b:110, c:7.8, d:8.0, top:\"30%\"},\n      {a:90, b:100, c:7.5, d:7.8, top:\"40%\"},\n      {a:80, b:90, c:7.1, d:7.5, top:\"50%\"},\n      {a:70, b:80, c:6.7, d:7.1, top:\"60%\"},\n      {a:60, b:70, c:6.3, d:6.7, top:\"70%\"},\n      {a:50, b:60, c:5.8, d:6.3, top:\"80%\"},\n      {a:40, b:50, c:5.2, d:5.8, top:\">80%\"}\n    ],\n    \"hoa\": [\n      {a:130, b:150, c:8.8, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.4, d:8.8, top:\"10%\"},\n      {a:110, b:120, c:8.0, d:8.4, top:\"20%\"},\n      {a:100, b:110, c:7.6, d:8.0, top:\"30%\"},\n      {a:90, b:100, c:7.2, d:7.6, top:\"40%\"},\n      {a:80, b:90, c:6.7, d:7.2, top:\"50%\"},\n      {a:70, b:80, c:6.2, d:6.7, top:\"60%\"},\n      {a:60, b:70, c:5.7, d:6.2, top:\"70%\"},\n      {a:50, b:60, c:5.2, d:5.7, top:\"80%\"},\n      {a:40, b:50, c:4.7, d:5.2, top:\">80%\"}\n    ],\n    \"sinh\": [\n      {a:130, b:150, c:8.5, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.0, d:8.5, top:\"10%\"},\n      {a:110, b:120, c:7.7, d:8.0, top:\"20%\"},\n      {a:100, b:110, c:7.4, d:7.7, top:\"30%\"},\n      {a:90, b:100, c:7.0, d:7.4, top:\"40%\"},\n      {a:80, b:90, c:6.5, d:7.0, top:\"50%\"},\n      {a:70, b:80, c:6.0, d:6.5, top:\"60%\"},\n      {a:60, b:70, c:5.5, d:6.0, top:\"70%\"},\n      {a:50, b:60, c:5.0, d:5.5, top:\"80%\"},\n      {a:40, b:50, c:4.3, d:5.0, top:\">80%\"}\n    ],\n    \"van\": [\n      {a:130, b:150, c:8.8, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.5, d:8.8, top:\"10%\"},\n      {a:110, b:120, c:8.1, d:8.5, top:\"20%\"},\n      {a:100, b:110, c:7.7, d:8.1, top:\"30%\"},\n      {a:90, b:100, c:7.2, d:7.7, top:\"40%\"},\n      {a:80, b:90, c:6.7, d:7.2, top:\"50%\"},\n      {a:70, b:80, c:6.2, d:6.7, top:\"60%\"},\n      {a:60, b:70, c:5.7, d:6.2, top:\"70%\"},\n      {a:50, b:60, c:5.2, d:5.7, top:\"80%\"},\n      {a:40, b:50, c:4.7, d:5.2, top:\">80%\"}\n    ],\n    \"anh\": [\n      {a:130, b:150, c:8.5, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.0, d:8.5, top:\"10%\"},\n      {a:110, b:120, c:7.7, d:8.0, top:\"20%\"},\n      {a:100, b:110, c:7.4, d:7.7, top:\"30%\"},\n      {a:90, b:100, c:7.0, d:7.4, top:\"40%\"},\n      {a:80, b:90, c:6.5, d:7.0, top:\"50%\"},\n      {a:70, b:80, c:6.0, d:6.5, top:\"60%\"},\n      {a:60, b:70, c:5.5, d:6.0, top:\"70%\"},\n      {a:50, b:60, c:5.0, d:5.5, top:\"80%\"},\n      {a:40, b:50, c:4.3, d:5.0, top:\">80%\"}\n    ],\n    \"su\": [\n      {a:130, b:150, c:8.5, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.0, d:8.5, top:\"10%\"},\n      {a:110, b:120, c:7.7, d:8.0, top:\"20%\"},\n      {a:100, b:110, c:7.4, d:7.7, top:\"30%\"},\n      {a:90, b:100, c:7.0, d:7.4, top:\"40%\"},\n      {a:80, b:90, c:6.5, d:7.0, top:\"50%\"},\n      {a:70, b:80, c:6.0, d:6.5, top:\"60%\"},\n      {a:60, b:70, c:5.5, d:6.0, top:\"70%\"},\n      {a:50, b:60, c:5.0, d:5.5, top:\"80%\"},\n      {a:40, b:50, c:4.3, d:5.0, top:\">80%\"}\n    ],\n    \"dia\": [\n      {a:130, b:150, c:8.5, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.0, d:8.5, top:\"10%\"},\n      {a:110, b:120, c:7.7, d:8.0, top:\"20%\"},\n      {a:100, b:110, c:7.4, d:7.7, top:\"30%\"},\n      {a:90, b:100, c:7.0, d:7.4, top:\"40%\"},\n      {a:80, b:90, c:6.5, d:7.0, top:\"50%\"},\n      {a:70, b:80, c:6.0, d:6.5, top:\"60%\"},\n      {a:60, b:70, c:5.5, d:6.0, top:\"70%\"},\n      {a:50, b:60, c:5.0, d:5.5, top:\"80%\"},\n      {a:40, b:50, c:4.3, d:5.0, top:\">80%\"}\n    ],\n    \"gdcd\": [\n      {a:130, b:150, c:8.5, d:10.0, top:\"5%\"},\n      {a:120, b:130, c:8.0, d:8.5, top:\"10%\"},\n      {a:110, b:120, c:7.7, d:8.0, top:\"20%\"},\n      {a:100, b:110, c:7.4, d:7.7, top:\"30%\"},\n      {a:90, b:100, c:7.0, d:7.4, top:\"40%\"},\n      {a:80, b:90, c:6.5, d:7.0, top:\"50%\"},\n      {a:70, b:80, c:6.0, d:6.5, top:\"60%\"},\n      {a:60, b:70, c:5.5, d:6.0, top:\"70%\"},\n      {a:50, b:60, c:5.0, d:5.5, top:\"80%\"},\n      {a:40, b:50, c:4.3, d:5.0, top:\">80%\"}\n    ]\n  }\n};\n\nconst monList = [\"toan\",\"ly\",\"hoa\",\"sinh\",\"van\",\"anh\",\"su\",\"dia\",\"gdcd\"];\nconst monName = {\n  \"toan\":\"To\u00e1n\", \"ly\":\"V\u1eadt l\u00ed\", \"hoa\":\"H\u00f3a h\u1ecdc\", \"sinh\":\"Sinh h\u1ecdc\",\n  \"van\":\"Ng\u1eef v\u0103n\", \"anh\":\"Ti\u1ebfng Anh\", \"su\":\"L\u1ecbch s\u1eed\", \"dia\":\"\u0110\u1ecba l\u00ed\", \"gdcd\":\"GDCD\"\n};\n\n\/\/ Hi\u1ec3n th\u1ecb c\u00e1c \u00f4 nh\u1eadp \u0111i\u1ec3m\nfunction renderMonInputs(){\n  let html = \"\";\n  for(let mon of monList){\n    html += `<div class=\"col-4 col-md-4\">\n      <label class=\"form-label\">${monName[mon]}<\/label>\n      <input type=\"number\" step=\"0.01\" min=\"0\" max=\"150\" class=\"form-control\" id=\"${mon}\" placeholder=\"Nh\u1eadp \u0111i\u1ec3m\">\n    <\/div>`;\n  }\n  document.getElementById('monInputs').innerHTML = html;\n  \/\/ render n\u00fat m\u00f4n xem b\u1ea3ng quy \u0111\u1ed5i\n  let btns = '';\n  for(let mon of monList){\n    btns += `<button class=\"btn btn-outline-primary btn-sm mon-btn\" onclick=\"showTable('${mon}')\">${monName[mon]}<\/button> `;\n  }\n  document.getElementById('monBtns').innerHTML = btns;\n}\nrenderMonInputs();\n\nfunction convertScore(x, table) {\n  if (x == null || x === \"\") return \"\";\n  x = parseFloat(x);\n  for (let row of table) {\n    if (x > row.a && x <= row.b) {\n      let y = row.c + (row.d - row.c)*(x - row.a)\/(row.b - row.a);\n      return Math.round(y*100)\/100;\n    }\n  }\n  return \"\";\n}\n\nfunction convertAll() {\n  let method = document.getElementById('method').value;\n  let data = [];\n  let entered = false;\n  for(let mon of monList){\n    let x = document.getElementById(mon).value;\n    if(x &#038;&#038; x!==\"\"){ entered = true; }\n    let table = quyDoi[method] &#038;&#038; quyDoi[method][mon];\n    let y = (x &#038;&#038; table) ? convertScore(x, table) : \"\";\n    data.push({mon:monName[mon], x:x, y:y});\n  }\n  let msg = document.getElementById(\"msg\");\n  if(!entered) {\n    msg.innerHTML = `<div class=\"alert alert-warning\">Vui l\u00f2ng nh\u1eadp \u00edt nh\u1ea5t 1 \u0111i\u1ec3m \u0111\u1ec3 quy \u0111\u1ed5i!<\/div>`;\n    document.getElementById(\"resultTable\").innerHTML = \"\";\n    return;\n  }\n  msg.innerHTML = \"\";\n  let html = `<table class=\"table table-bordered table-hover\"><thead class=\"table-success\">\n    <tr><th>M\u00f4n<\/th><th>\u0110i\u1ec3m nh\u1eadp<\/th><th>\u0110i\u1ec3m quy \u0111\u1ed5i<\/th><\/tr><\/thead><tbody>`;\n  for(let r of data) {\n    html += `<tr>\n      <td>${r.mon}<\/td>\n      <td>${r.x||\"\"}<\/td>\n      <td class=\"fw-bold fs-5\">${r.y!==\"\"?r.y:\"\"}<\/td>\n    <\/tr>`;\n  }\n  html += \"<\/tbody><\/table>\";\n  document.getElementById(\"resultTable\").innerHTML = html;\n}\n\n\/\/ Xem b\u1ea3ng quy \u0111\u1ed5i c\u1ee7a t\u1eebng m\u00f4n\nfunction showTable(mon) {\n  let method = document.getElementById('method').value;\n  let table = quyDoi[method] && quyDoi[method][mon];\n  if(!table) {\n    document.getElementById('tableArea').innerHTML = \"<b>Ch\u01b0a c\u00f3 b\u1ea3ng quy \u0111\u1ed5i cho m\u00f4n n\u00e0y!<\/b>\";\n    return;\n  }\n  let html = `<div class=\"fw-bold text-primary mb-2\">B\u1ea3ng quy \u0111\u1ed5i ${monName[mon]} (${method==\"hm\"?\"H\u1ecdc b\u1ea1\":\"V-SAT\"})<\/div>\n  <table class=\"table table-bordered table-sm\"><thead>\n  <tr><th>T\u1ed1p<\/th><th>\u0110i\u1ec3m \u0111\u1ea7u v\u00e0o<br>(a &lt; x \u2264 b)<\/th><th>\u0110i\u1ec3m quy \u0111\u1ed5i<br>(c &lt; y \u2264 d)<\/th><\/tr><\/thead><tbody>`;\n  for (let r of table) {\n    html += `<tr><td>${r.top}<\/td><td>${r.a} &lt; x \u2264 ${r.b}<\/td><td>${r.c} &lt; y \u2264 ${r.d}<\/td><\/tr>`;\n  }\n  html += \"<\/tbody><\/table>\";\n  document.getElementById('tableArea').innerHTML = html;\n}\n\nfunction clearResult() {\n  document.getElementById('resultTable').innerHTML = \"\";\n  document.getElementById('tableArea').innerHTML = \"\";\n  document.getElementById('msg').innerHTML = \"\";\n}\n\n\/\/ Nh\u1eadp b\u1ea3ng quy \u0111\u1ed5i t\u1eeb file Excel\nfunction importTable(event){\n  let file = event.target.files[0];\n  if(!file) return;\n  let reader = new FileReader();\n  reader.onload = function(e){\n    let data = new Uint8Array(e.target.result);\n    let workbook = XLSX.read(data, {type:'array'});\n    let sheet = workbook.Sheets[workbook.SheetNames[0]];\n    let rows = XLSX.utils.sheet_to_json(sheet,{header:1});\n    \/\/ Y\u00eau c\u1ea7u: c\u1ed9t 1: ph\u01b0\u01a1ng th\u1ee9c (hm\/vsat), c\u1ed9t 2: m\u00f4n, c\u00e1c c\u1ed9t ti\u1ebfp: a, b, c, d, top\n    let newQD = {hm:{}, vsat:{}};\n    for(let i=1;i<rows.length;i++){\n      let [phthuc, mon, a, b, c, d, top] = rows[i];\n      if(!phthuc || !mon) continue;\n      phthuc = phthuc.trim().toLowerCase();\n      mon = mon.trim().toLowerCase();\n      if(!newQD[phthuc][mon]) newQD[phthuc][mon]=[];\n      newQD[phthuc][mon].push({a:Number(a),b:Number(b),c:Number(c),d:Number(d),top:top+\"\"});\n    }\n    quyDoi = newQD;\n    alert(\"\u0110\u00e3 nh\u1eadp b\u1ea3ng quy \u0111\u1ed5i th\u00e0nh c\u00f4ng!\");\n    clearResult();\n  }\n  reader.readAsArrayBuffer(file);\n}\n\nfunction loadSampleTable(){\n  quyDoi = JSON.parse(JSON.stringify(window.defaultQD));\n  clearResult();\n  alert(\"\u0110\u00e3 chuy\u1ec3n v\u1ec1 b\u1ea3ng m\u1eabu!\");\n}\n\nwindow.defaultQD = JSON.parse(JSON.stringify(quyDoi));\n\n\/\/ Xu\u1ea5t Excel k\u1ebft qu\u1ea3\nfunction exportExcel(){\n  let table = document.getElementById(\"resultTable\");\n  if(!table || table.innerText.trim() === \"\") {\n    alert(\"Kh\u00f4ng c\u00f3 d\u1eef li\u1ec7u \u0111\u1ec3 xu\u1ea5t!\");\n    return;\n  }\n  let wb = XLSX.utils.table_to_book(table, {sheet:\"KQ Quy doi\"});\n  XLSX.writeFile(wb, \"QuyDoiDiem.xlsx\");\n}\n<\/script>\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"class_list":["post-4630","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/pages\/4630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labantrithuc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4630"}],"version-history":[{"count":2,"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/pages\/4630\/revisions"}],"predecessor-version":[{"id":4632,"href":"https:\/\/labantrithuc.com\/index.php?rest_route=\/wp\/v2\/pages\/4630\/revisions\/4632"}],"wp:attachment":[{"href":"https:\/\/labantrithuc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}