{"id":35,"date":"2024-11-25T16:08:38","date_gmt":"2024-11-25T16:08:38","guid":{"rendered":"https:\/\/eliteacademicessays.com\/examples\/?page_id=35"},"modified":"2024-11-25T16:08:38","modified_gmt":"2024-11-25T16:08:38","slug":"35-2","status":"publish","type":"page","link":"https:\/\/eliteacademicessays.com\/examples\/index.php\/35-2\/","title":{"rendered":""},"content":{"rendered":"    <form id=\"research-generator-form\" style=\"max-width: 600px; margin: auto; padding: 20px; border: 1px solid #ddd; border-radius: 10px;\">\n        <h2 style=\"text-align: center; margin-bottom: 20px;\">Generate Research Assistance<\/h2>\n        \n        <div style=\"margin-bottom: 15px;\">\n            <label for=\"essay-topic\" style=\"display: block; font-weight: bold; margin-bottom: 5px;\">Essay Topic:<\/label>\n            <input type=\"text\" id=\"essay-topic\" name=\"essay_topic\" placeholder=\"Enter your essay topic\" \n                   style=\"width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px;\" maxlength=\"100\" required>\n        <\/div>\n        \n        <div style=\"margin-bottom: 15px;\">\n            <label for=\"essay-type\" style=\"display: block; font-weight: bold; margin-bottom: 5px;\">Essay Type:<\/label>\n            <select id=\"essay-type\" name=\"essay_type\" \n                    style=\"width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px;\" required>\n                <option value=\"\" disabled selected>Select an essay type<\/option>\n                <option value=\"argumentative\">Argumentative<\/option>\n                <option value=\"descriptive\">Descriptive<\/option>\n                <option value=\"narrative\">Narrative<\/option>\n                <option value=\"expository\">Expository<\/option>\n            <\/select>\n        <\/div>\n        \n        <div style=\"margin-bottom: 15px;\">\n            <label for=\"assignment-details\" style=\"display: block; font-weight: bold; margin-bottom: 5px;\">Assignment Details:<\/label>\n            <textarea id=\"assignment-details\" name=\"assignment_details\" placeholder=\"Provide additional details or requirements for your assignment\" \n                      style=\"width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px;\" maxlength=\"500\" rows=\"5\" required><\/textarea>\n        <\/div>\n        \n        <div style=\"display: flex; justify-content: space-between; gap: 10px;\">\n            <button type=\"button\" id=\"generate-outline\" style=\"flex: 1; padding: 10px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer;\">\n                Generate Outline\n            <\/button>\n            <button type=\"button\" id=\"generate-complete\" style=\"flex: 1; padding: 10px; background-color: #28a745; color: white; border: none; border-radius: 5px; cursor: pointer;\">\n                Generate Complete Essay\n            <\/button>\n        <\/div>\n        \n        <div id=\"response-container\" style=\"margin-top: 20px; padding: 10px; border: 1px solid #ddd; border-radius: 5px; display: none;\">\n            <!-- AI-generated content will appear here -->\n        <\/div>\n    <\/form>\n    <script>\n        document.getElementById('generate-outline').addEventListener('click', function() {\n            handleResearchGeneration('outline');\n        });\n\n        document.getElementById('generate-complete').addEventListener('click', function() {\n            handleResearchGeneration('complete');\n        });\n\n        function handleResearchGeneration(type) {\n            const topic = document.getElementById('essay-topic').value;\n            const essayType = document.getElementById('essay-type').value;\n            const details = document.getElementById('assignment-details').value;\n\n            if (!topic || !essayType || !details) {\n                alert('Please fill out all fields before proceeding.');\n                return;\n            }\n\n            const responseContainer = document.getElementById('response-container');\n            responseContainer.style.display = 'block';\n            responseContainer.innerHTML = `<p><strong>Generating ${type}...<\/strong> Please wait.<\/p>`;\n\n            fetch('https:\/\/your-ai-api-endpoint.com\/generate', {\n                method: 'POST',\n                headers: {\n                    'Content-Type': 'application\/json'\n                },\n                body: JSON.stringify({\n                    type: type,\n                    essay_topic: topic,\n                    essay_type: essayType,\n                    assignment_details: details\n                })\n            })\n            .then(response => response.json())\n            .then(data => {\n                if (data.content) {\n                    responseContainer.innerHTML = `<p>${data.content}<\/p>`;\n                } else {\n                    responseContainer.innerHTML = `<p><strong>Error:<\/strong> Unable to generate content. Please try again.<\/p>`;\n                }\n            })\n            .catch(error => {\n                responseContainer.innerHTML = `<p><strong>Error:<\/strong> ${error.message}<\/p>`;\n            });\n        }\n    <\/script>\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":{"footnotes":""},"class_list":["post-35","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/pages\/35","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/comments?post=35"}],"version-history":[{"count":1,"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/pages\/35\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/pages\/35\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/eliteacademicessays.com\/examples\/index.php\/wp-json\/wp\/v2\/media?parent=35"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}