{"id":2063,"date":"2025-11-27T16:23:45","date_gmt":"2025-11-27T16:23:45","guid":{"rendered":"https:\/\/ainchkef.com\/?page_id=2063"},"modified":"2025-11-27T16:28:30","modified_gmt":"2025-11-27T16:28:30","slug":"%d8%aa%d9%82%d9%8a%d9%8a%d9%85-%d8%b1%d8%b6%d9%89-%d8%a7%d9%84%d9%85%d8%b1%d8%aa%d9%81%d9%82%d9%8a%d9%86","status":"publish","type":"page","link":"https:\/\/ainchkef.com\/?page_id=2063","title":{"rendered":"\u062a\u0642\u064a\u064a\u0645 \u0631\u0636\u0649 \u0627\u0644\u0645\u0631\u062a\u0641\u0642\u064a\u0646"},"content":{"rendered":"\n<div class=\"container\">\n    <h1>\u2b50 \u062a\u0642\u064a\u064a\u0645 \u0631\u0636\u0649 \u0627\u0644\u0645\u0631\u062a\u0641\u0642\u064a\u0646 \u2b50<\/h1>\n    <p style=\"font-size: 14px;\">\u064a\u0631\u062c\u0649 \u062a\u0642\u064a\u064a\u0645 \u0645\u0633\u062a\u0648\u0649 \u0631\u0636\u0627\u0626\u0643 \u0639\u0646 \u0627\u0644\u062e\u062f\u0645\u0627\u062a \u0627\u0644\u0645\u0642\u062f\u0645\u0629 \u0645\u0646 1 (\u063a\u064a\u0631 \u0631\u0627\u0636\u064d) \u0625\u0644\u0649 5 (\u0631\u0627\u0636\u064d \u062c\u062f\u0627\u064b).<\/p>\n\n    <div id=\"survey-form\">\n        <\/div>\n\n    <button onclick=\"submitSurvey()\">\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062a\u0642\u064a\u064a\u0645<\/button>\n\n    <hr>\n\n    <h2>\ud83d\udcca \u0645\u0639\u062f\u0644\u0627\u062a \u0627\u0644\u062a\u0642\u064a\u064a\u0645 \u0627\u0644\u062d\u0627\u0644\u064a\u0629<\/h2>\n    <div id=\"results\">\n        <p class=\"loading-message\" style=\"font-size: 14px;\">&#8230;\u062c\u0627\u0631\u064d \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0623\u0648 \u0627\u0646\u062a\u0638\u0627\u0631 \u0623\u0648\u0644 \u062a\u0642\u064a\u064a\u0645&#8230;<\/p>\n    <\/div>\n<\/div>\n\n<script>\n    \/\/ (\u0645\u062d\u0627\u0643\u0627\u0629 \u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0645\u062e\u0632\u0646\u0629 \u0639\u0644\u0649 \u0627\u0644\u062e\u0627\u062f\u0645)\n    let questionRatings = {\n        quality: { name: \"\u062c\u0648\u062f\u0629 \u0627\u0644\u062e\u062f\u0645\u0629 \u0627\u0644\u0645\u0642\u062f\u0645\u0629\", totalScore: 120, count: 30 }, \n        speed: { name: \"\u0633\u0631\u0639\u0629 \u0625\u0646\u062c\u0627\u0632 \u0627\u0644\u0645\u0639\u0627\u0645\u0644\u0629\", totalScore: 90, count: 25 }, \n        staff: { name: \"\u062a\u0639\u0627\u0645\u0644 \u0627\u0644\u0645\u0648\u0638\u0641\u064a\u0646\", totalScore: 180, count: 40 } \n    };\n\n    const questions = [\n        { id: 'quality', text: '\u062c\u0648\u062f\u0629 \u0627\u0644\u062e\u062f\u0645\u0629 \u0627\u0644\u0645\u0642\u062f\u0645\u0629' },\n        { id: 'speed', text: '\u0633\u0631\u0639\u0629 \u0625\u0646\u062c\u0627\u0632 \u0627\u0644\u0645\u0639\u0627\u0645\u0644\u0629' },\n        { id: 'staff', text: '\u062a\u0639\u0627\u0645\u0644 \u0627\u0644\u0645\u0648\u0638\u0641\u064a\u0646' }\n    ];\n\n    function renderSurveyForm() {\n        const formDiv = document.getElementById('survey-form');\n        let html = '<form id=\"rating-form\">';\n\n        questions.forEach(q => {\n            html += `\n                <div class=\"question-item\">\n                    <label for=\"${q.id}\">${q.text}:<\/label>\n                    <div class=\"rating-options\">\n                        <input type=\"radio\" id=\"${q.id}-1\" name=\"${q.id}\" value=\"1\" required><label for=\"${q.id}-1\">1<\/label>\n                        <input type=\"radio\" id=\"${q.id}-2\" name=\"${q.id}\" value=\"2\"><label for=\"${q.id}-2\">2<\/label>\n                        <input type=\"radio\" id=\"${q.id}-3\" name=\"${q.id}\" value=\"3\"><label for=\"${q.id}-3\">3<\/label>\n                        <input type=\"radio\" id=\"${q.id}-4\" name=\"${q.id}\" value=\"4\"><label for=\"${q.id}-4\">4<\/label>\n                        <input type=\"radio\" id=\"${q.id}-5\" name=\"${q.id}\" value=\"5\"><label for=\"${q.id}-5\">5<\/label>\n                    <\/div>\n                <\/div>\n            `;\n        });\n        html += '<\/form>';\n        formDiv.innerHTML = html;\n    }\n\n    function submitSurvey() {\n        let allRated = true;\n        let newRatings = {};\n\n        questions.forEach(q => {\n            const selected = document.querySelector(`input[name=\"${q.id}\"]:checked`);\n            if (!selected) {\n                allRated = false;\n            } else {\n                newRatings[q.id] = parseInt(selected.value);\n            }\n        });\n\n        if (!allRated) {\n            alert(\"\u0627\u0644\u0631\u062c\u0627\u0621 \u062a\u0642\u064a\u064a\u0645 \u062c\u0645\u064a\u0639 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0642\u0628\u0644 \u0627\u0644\u0625\u0631\u0633\u0627\u0644.\");\n            return;\n        }\n\n        for (const id in newRatings) {\n            if (questionRatings[id]) {\n                questionRatings[id].totalScore += newRatings[id];\n                questionRatings[id].count++;\n            }\n        }\n\n        alert(\"\u0634\u0643\u0631\u0627\u064b \u0644\u0643! \u062a\u0645 \u0627\u0633\u062a\u0644\u0627\u0645 \u062a\u0642\u064a\u064a\u0645\u0643 \u0628\u0646\u062c\u0627\u062d.\");\n        \n        renderResults();\n        \n        document.getElementById('rating-form').reset();\n    }\n\n    function renderResults() {\n        const resultsDiv = document.getElementById('results');\n        let html = '';\n        \n        for (const id in questionRatings) {\n            const data = questionRatings[id];\n            \n            const average = data.count > 0 ? (data.totalScore \/ data.count) : 0;\n            \n            const percentage = (average \/ 5) * 100;\n            const displayPercentage = percentage.toFixed(1); \n\n            html += `\n                <div class=\"result-item\">\n                    <span>${data.name} (${data.count} \u062a\u0642\u064a\u064a\u0645)<\/span>\n                    <div class=\"rating-bar-container\">\n                        <div class=\"rating-bar\" style=\"width: ${percentage}%\"><\/div>\n                    <\/div>\n                    <span class=\"average-score\">${displayPercentage} %<\/span>\n                <\/div>\n            `;\n        }\n\n        resultsDiv.innerHTML = html;\n    }\n\n    window.onload = () => {\n        renderSurveyForm();\n        renderResults();\n    };\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\u2b50 \u062a\u0642\u064a\u064a\u0645 \u0631\u0636\u0649 \u0627\u0644\u0645\u0631\u062a\u0641\u0642\u064a\u0646 \u2b50 \u064a\u0631\u062c\u0649 \u062a\u0642\u064a\u064a\u0645 \u0645\u0633\u062a\u0648\u0649 \u0631\u0636\u0627\u0626\u0643 \u0639\u0646 \u0627\u0644\u062e\u062f\u0645\u0627\u062a \u0627\u0644\u0645\u0642\u062f\u0645\u0629 \u0645\u0646 1 (\u063a\u064a\u0631 \u0631\u0627\u0636\u064d) \u0625\u0644\u0649 5 (\u0631\u0627\u0636\u064d \u062c\u062f\u0627\u064b). \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u062a\u0642\u064a\u064a\u0645 \ud83d\udcca \u0645\u0639\u062f\u0644\u0627\u062a \u0627\u0644\u062a\u0642\u064a\u064a\u0645 \u0627\u0644\u062d\u0627\u0644\u064a\u0629 &#8230;\u062c\u0627\u0631\u064d \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0623\u0648 \u0627\u0646\u062a\u0638\u0627\u0631 \u0623\u0648\u0644 \u062a\u0642\u064a\u064a\u0645&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2063","page","type-page","status-publish",""],"_links":{"self":[{"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/pages\/2063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ainchkef.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2063"}],"version-history":[{"count":2,"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/pages\/2063\/revisions"}],"predecessor-version":[{"id":2068,"href":"https:\/\/ainchkef.com\/index.php?rest_route=\/wp\/v2\/pages\/2063\/revisions\/2068"}],"wp:attachment":[{"href":"https:\/\/ainchkef.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}