Saturday, 15 July 2023

English learning course Ai

this example, each lesson is represented as a <div class="lesson"> element, and exercises are represented as <div class="exercise"> elements. The user can input their answers for text-based exercises or select the correct option for multiple-choice exercises.

The progress bar is displayed at the bottom, which updates dynamically as the user completes lessons and exercises. The JavaScript code keeps track of the user's progress and updates the progress bar accordingly.

Feel free to customize the styling, add more lessons and exercises, and expand the functionality to suit your needs. Remember to include relevant content and interactions within each lesson/exercise based on your English learning course material.
<!DOCTYPE html>
<html>
<head>
  <title>English Learning Course AI</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f7f7f7;
      margin: 0;
      padding: 0;
    }

    .container {
      max-width: 800px;
      margin: 20px auto;
      padding: 20px;
      background-color: #fff;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    h1 {
      color: #333;
      text-align: center;
    }

    .lesson {
      margin-bottom: 20px;
      padding: 10px;
      background-color: #f9f9f9;
      border-radius: 5px;
    }

    .exercise {
      margin-top: 10px;
    }

    .exercise input[type="text"] {
      width: 100%;
      padding: 10px;
      border-radius: 3px;
      border: 1px solid #ccc;
    }

    .progress-bar {
      margin-top: 20px;
      height: 10px;
      background-color: #e9e9e9;
      border-radius: 5px;
    }

    .progress-bar-fill {
      height: 100%;
      background-color: #4caf50;
      border-radius: 5px;
    }

    .button {
      display: inline-block;
      padding: 10px 20px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      border-radius: 3px;
      transition: background-color 0.3s;
    }

    .button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>English Learning Course AI</h1>

    <div class="lesson">
      <h2>Lesson 1: Basic Vocabulary</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus id fringilla nisl. Donec eu bibendum ipsum. In eu vulputate mi. Praesent rhoncus nibh sed pulvinar venenatis.</p>
    </div>

    <div class="lesson">
      <h2>Lesson 2: Grammar</h2>
      <p>Quisque fermentum tortor in turpis gravida, sed ullamcorper libero pellentesque. Aenean maximus nisi et urna volutpat bibendum. Mauris scelerisque, ex et interdum consectetur, ante mauris sollicitudin odio, et lacinia ipsum massa et lacus.</p>
    </div>

    <div class="exercise">
      <h3>Exercise 1: Fill in the Blanks</h3>
      <p>Complete the following sentence: "I _____ to the park yesterday."</p>
      <input type="text" id="exercise1Input">
      <button class="button" onclick="checkAnswer('went')">Check Answer</button>
    </div>

    <div class="exercise">
      <h3>Exercise 2: Multiple Choice</h3>
      <p>What is the opposite of "happy"?</p>
      <label><input type="radio" name="exercise2Option" value="sad">Sad</label>
      <label><input type="radio" name="exercise2Option" value="angry">Angry</label>
      <label><input type="radio" name="exercise2Option" value="excited">Excited</label>
      <button class="button" onclick="checkAnswer('sad')">Check Answer</button>
    </div>

    <div class="progress-bar">
      <div class="progress-bar-fill" id="progressBarFill" style="width: 0%;"></div>
    </div>
  </div>

  <script>
    const progress = {
      currentLesson: 0,
      totalLessons: document.querySelectorAll('.lesson').length,
      correctAnswers: 0,
    };

    function checkAnswer(answer) {
      if (answer.toLowerCase() === 'went') {
        progress.correctAnswers++;
      }
      updateProgressBar();
    }

    function updateProgressBar() {
      progress.currentLesson++;
      const percentage = (progress.currentLesson / progress.totalLessons) * 100;
      document.getElementById('progressBarFill').style.width = percentage + '%';
    }
  </script>
</body>
</html>

No comments:

Post a Comment

configuration of website

Menu Type: Dropdown with Full Width Ensure the navigation items in the dropdown menu contain relevant keywords related to the we...