| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Writing Feedback Tool</title> |
| <style> |
| body { |
| font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; |
| background: linear-gradient(to right, #e0f7fa, #f1f8e9); |
| margin: 0; |
| padding: 2rem; |
| color: #333; |
| } |
| .container { |
| max-width: 800px; |
| margin: 0 auto; |
| background: white; |
| padding: 2rem; |
| border-radius: 12px; |
| box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
| } |
| h2 { |
| text-align: center; |
| color: #00796b; |
| } |
| label { |
| font-weight: bold; |
| margin-top: 1rem; |
| } |
| select, textarea, button { |
| width: 100%; |
| padding: 0.75rem; |
| margin-top: 0.5rem; |
| margin-bottom: 1.5rem; |
| border: 1px solid #ccc; |
| border-radius: 8px; |
| font-size: 1rem; |
| } |
| button { |
| background-color: #00796b; |
| color: white; |
| border: none; |
| cursor: pointer; |
| transition: background-color 0.3s; |
| } |
| button:hover { |
| background-color: #004d40; |
| } |
| .feedback { |
| display: none; |
| background: #f9fbe7; |
| padding: 1.5rem; |
| border-radius: 10px; |
| border-left: 6px solid #cddc39; |
| margin-top: 2rem; |
| } |
| .feedback h3 { |
| color: #558b2f; |
| } |
| .feedback p { |
| margin: 0.5rem 0; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="container"> |
| <h2>Writing Feedback Tool</h2> |
| <label for="exam-type">Select Exam Type:</label> |
| <select id="exam-type"> |
| <option value="IELTS">IELTS</option> |
| <option value="CBSE">CBSE</option> |
| <option value="College">College Essay</option> |
| </select> |
|
|
| <label for="essay">Enter Student Essay (max 1000 words):</label> |
| <textarea id="essay" rows="10"></textarea> |
|
|
| <button onclick="getFeedback()">Get Feedback</button> |
|
|
| <div id="feedback" class="feedback"></div> |
| </div> |
|
|
| <script> |
| async function getFeedback() { |
| const examType = document.getElementById('exam-type').value; |
| const essay = document.getElementById('essay').value; |
| |
| const response = await fetch('https://alexvatti-english-essay-writing-analyst.hf.space/feedback', { |
| method: 'POST', |
| headers: { 'Content-Type': 'application/json' }, |
| body: JSON.stringify({ exam_type: examType, essay_text: essay }) |
| }); |
| |
| const data = await response.json(); |
| console.log("API Response:", data); |
| const feedbackDiv = document.getElementById('feedback'); |
| feedbackDiv.innerHTML = ` |
| <h3>Feedback Summary</h3> |
| <p><strong>Logic & Relevance:</strong> ${data.logic}</p> |
| <p><strong>Grammar & Style:</strong> ${data.grammar}</p> |
| <p><strong>Score:</strong> ${data.score}</p> |
| <p><strong>Suggestions:</strong> ${data.suggestions}</p> |
| `; |
| feedbackDiv.style.display = 'block'; |
| } |
| </script> |
| </body> |
| </html> |
|
|
|
|